File: ipoldemo.e

package info (click to toggle)
euler 1.61.0-12
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, bullseye, forky, sid, trixie
  • size: 5,164 kB
  • sloc: ansic: 24,761; sh: 8,314; makefile: 141; cpp: 47; php: 1
file content (19 lines) | stat: -rw-r--r-- 458 bytes parent folder | download | duplicates (8)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
comment
demo of xpolyval
This file computes the correct values of a badly
conditioned polynomial, after showing that the
normal values are completely wrong.
endcomment

comments off
load "x.e"

p=[-945804881,1753426039,-1083557822,223200658];
t=linspace(1.61801916,1.61801917,100);
s=polyval(p,t);
xplot(t-1.61801916,s);
title("Incorrect polynomial values"); wait(180);

s=xpolyval(p,t);
xplot(t-1.61801916,s);
title("Correct polynomial values"); wait(180);