(FPCore (x y z t a) :precision binary64 (+ x (* (- y z) (/ (- t x) (- a z)))))
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (+ x (* (- y z) (/ (- t x) (- a z)))))
(t_2 (/ (- a z) y))
(t_3
(+
(* x (/ z (- a z)))
(- (+ x (/ t t_2)) (+ (* z (/ t (- a z))) (* x (/ y (- a z)))))))
(t_4 (+ (/ (* x z) (- a z)) (+ x (/ (* y t) (- a z))))))
(if (<= t_1 -6e+77)
t_3
(if (<= t_1 -2e-294)
(- t_4 (+ (/ x t_2) (/ (* z t) (- a z))))
(if (<= t_1 0.0)
(+
(* x (/ y z))
(+ t (- (* t (/ a z)) (+ (/ t (/ z y)) (* x (/ a z))))))
(if (<= t_1 1e+109)
(- t_4 (+ (/ (* x y) (- a z)) (/ t (+ (/ a z) -1.0))))
t_3))))))double code(double x, double y, double z, double t, double a) {
return x + ((y - z) * ((t - x) / (a - z)));
}
double code(double x, double y, double z, double t, double a) {
double t_1 = x + ((y - z) * ((t - x) / (a - z)));
double t_2 = (a - z) / y;
double t_3 = (x * (z / (a - z))) + ((x + (t / t_2)) - ((z * (t / (a - z))) + (x * (y / (a - z)))));
double t_4 = ((x * z) / (a - z)) + (x + ((y * t) / (a - z)));
double tmp;
if (t_1 <= -6e+77) {
tmp = t_3;
} else if (t_1 <= -2e-294) {
tmp = t_4 - ((x / t_2) + ((z * t) / (a - z)));
} else if (t_1 <= 0.0) {
tmp = (x * (y / z)) + (t + ((t * (a / z)) - ((t / (z / y)) + (x * (a / z)))));
} else if (t_1 <= 1e+109) {
tmp = t_4 - (((x * y) / (a - z)) + (t / ((a / z) + -1.0)));
} else {
tmp = t_3;
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
code = x + ((y - z) * ((t - x) / (a - z)))
end function
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: t_1
real(8) :: t_2
real(8) :: t_3
real(8) :: t_4
real(8) :: tmp
t_1 = x + ((y - z) * ((t - x) / (a - z)))
t_2 = (a - z) / y
t_3 = (x * (z / (a - z))) + ((x + (t / t_2)) - ((z * (t / (a - z))) + (x * (y / (a - z)))))
t_4 = ((x * z) / (a - z)) + (x + ((y * t) / (a - z)))
if (t_1 <= (-6d+77)) then
tmp = t_3
else if (t_1 <= (-2d-294)) then
tmp = t_4 - ((x / t_2) + ((z * t) / (a - z)))
else if (t_1 <= 0.0d0) then
tmp = (x * (y / z)) + (t + ((t * (a / z)) - ((t / (z / y)) + (x * (a / z)))))
else if (t_1 <= 1d+109) then
tmp = t_4 - (((x * y) / (a - z)) + (t / ((a / z) + (-1.0d0))))
else
tmp = t_3
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
return x + ((y - z) * ((t - x) / (a - z)));
}
public static double code(double x, double y, double z, double t, double a) {
double t_1 = x + ((y - z) * ((t - x) / (a - z)));
double t_2 = (a - z) / y;
double t_3 = (x * (z / (a - z))) + ((x + (t / t_2)) - ((z * (t / (a - z))) + (x * (y / (a - z)))));
double t_4 = ((x * z) / (a - z)) + (x + ((y * t) / (a - z)));
double tmp;
if (t_1 <= -6e+77) {
tmp = t_3;
} else if (t_1 <= -2e-294) {
tmp = t_4 - ((x / t_2) + ((z * t) / (a - z)));
} else if (t_1 <= 0.0) {
tmp = (x * (y / z)) + (t + ((t * (a / z)) - ((t / (z / y)) + (x * (a / z)))));
} else if (t_1 <= 1e+109) {
tmp = t_4 - (((x * y) / (a - z)) + (t / ((a / z) + -1.0)));
} else {
tmp = t_3;
}
return tmp;
}
def code(x, y, z, t, a): return x + ((y - z) * ((t - x) / (a - z)))
def code(x, y, z, t, a): t_1 = x + ((y - z) * ((t - x) / (a - z))) t_2 = (a - z) / y t_3 = (x * (z / (a - z))) + ((x + (t / t_2)) - ((z * (t / (a - z))) + (x * (y / (a - z))))) t_4 = ((x * z) / (a - z)) + (x + ((y * t) / (a - z))) tmp = 0 if t_1 <= -6e+77: tmp = t_3 elif t_1 <= -2e-294: tmp = t_4 - ((x / t_2) + ((z * t) / (a - z))) elif t_1 <= 0.0: tmp = (x * (y / z)) + (t + ((t * (a / z)) - ((t / (z / y)) + (x * (a / z))))) elif t_1 <= 1e+109: tmp = t_4 - (((x * y) / (a - z)) + (t / ((a / z) + -1.0))) else: tmp = t_3 return tmp
function code(x, y, z, t, a) return Float64(x + Float64(Float64(y - z) * Float64(Float64(t - x) / Float64(a - z)))) end
function code(x, y, z, t, a) t_1 = Float64(x + Float64(Float64(y - z) * Float64(Float64(t - x) / Float64(a - z)))) t_2 = Float64(Float64(a - z) / y) t_3 = Float64(Float64(x * Float64(z / Float64(a - z))) + Float64(Float64(x + Float64(t / t_2)) - Float64(Float64(z * Float64(t / Float64(a - z))) + Float64(x * Float64(y / Float64(a - z)))))) t_4 = Float64(Float64(Float64(x * z) / Float64(a - z)) + Float64(x + Float64(Float64(y * t) / Float64(a - z)))) tmp = 0.0 if (t_1 <= -6e+77) tmp = t_3; elseif (t_1 <= -2e-294) tmp = Float64(t_4 - Float64(Float64(x / t_2) + Float64(Float64(z * t) / Float64(a - z)))); elseif (t_1 <= 0.0) tmp = Float64(Float64(x * Float64(y / z)) + Float64(t + Float64(Float64(t * Float64(a / z)) - Float64(Float64(t / Float64(z / y)) + Float64(x * Float64(a / z)))))); elseif (t_1 <= 1e+109) tmp = Float64(t_4 - Float64(Float64(Float64(x * y) / Float64(a - z)) + Float64(t / Float64(Float64(a / z) + -1.0)))); else tmp = t_3; end return tmp end
function tmp = code(x, y, z, t, a) tmp = x + ((y - z) * ((t - x) / (a - z))); end
function tmp_2 = code(x, y, z, t, a) t_1 = x + ((y - z) * ((t - x) / (a - z))); t_2 = (a - z) / y; t_3 = (x * (z / (a - z))) + ((x + (t / t_2)) - ((z * (t / (a - z))) + (x * (y / (a - z))))); t_4 = ((x * z) / (a - z)) + (x + ((y * t) / (a - z))); tmp = 0.0; if (t_1 <= -6e+77) tmp = t_3; elseif (t_1 <= -2e-294) tmp = t_4 - ((x / t_2) + ((z * t) / (a - z))); elseif (t_1 <= 0.0) tmp = (x * (y / z)) + (t + ((t * (a / z)) - ((t / (z / y)) + (x * (a / z))))); elseif (t_1 <= 1e+109) tmp = t_4 - (((x * y) / (a - z)) + (t / ((a / z) + -1.0))); else tmp = t_3; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := N[(x + N[(N[(y - z), $MachinePrecision] * N[(N[(t - x), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(x + N[(N[(y - z), $MachinePrecision] * N[(N[(t - x), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(a - z), $MachinePrecision] / y), $MachinePrecision]}, Block[{t$95$3 = N[(N[(x * N[(z / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(x + N[(t / t$95$2), $MachinePrecision]), $MachinePrecision] - N[(N[(z * N[(t / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(x * N[(y / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$4 = N[(N[(N[(x * z), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision] + N[(x + N[(N[(y * t), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, -6e+77], t$95$3, If[LessEqual[t$95$1, -2e-294], N[(t$95$4 - N[(N[(x / t$95$2), $MachinePrecision] + N[(N[(z * t), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 0.0], N[(N[(x * N[(y / z), $MachinePrecision]), $MachinePrecision] + N[(t + N[(N[(t * N[(a / z), $MachinePrecision]), $MachinePrecision] - N[(N[(t / N[(z / y), $MachinePrecision]), $MachinePrecision] + N[(x * N[(a / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 1e+109], N[(t$95$4 - N[(N[(N[(x * y), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision] + N[(t / N[(N[(a / z), $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$3]]]]]]]]
x + \left(y - z\right) \cdot \frac{t - x}{a - z}
\begin{array}{l}
t_1 := x + \left(y - z\right) \cdot \frac{t - x}{a - z}\\
t_2 := \frac{a - z}{y}\\
t_3 := x \cdot \frac{z}{a - z} + \left(\left(x + \frac{t}{t_2}\right) - \left(z \cdot \frac{t}{a - z} + x \cdot \frac{y}{a - z}\right)\right)\\
t_4 := \frac{x \cdot z}{a - z} + \left(x + \frac{y \cdot t}{a - z}\right)\\
\mathbf{if}\;t_1 \leq -6 \cdot 10^{+77}:\\
\;\;\;\;t_3\\
\mathbf{elif}\;t_1 \leq -2 \cdot 10^{-294}:\\
\;\;\;\;t_4 - \left(\frac{x}{t_2} + \frac{z \cdot t}{a - z}\right)\\
\mathbf{elif}\;t_1 \leq 0:\\
\;\;\;\;x \cdot \frac{y}{z} + \left(t + \left(t \cdot \frac{a}{z} - \left(\frac{t}{\frac{z}{y}} + x \cdot \frac{a}{z}\right)\right)\right)\\
\mathbf{elif}\;t_1 \leq 10^{+109}:\\
\;\;\;\;t_4 - \left(\frac{x \cdot y}{a - z} + \frac{t}{\frac{a}{z} + -1}\right)\\
\mathbf{else}:\\
\;\;\;\;t_3\\
\end{array}



Bits error versus x



Bits error versus y



Bits error versus z



Bits error versus t



Bits error versus a
Results
if (+.f64 x (*.f64 (-.f64 y z) (/.f64 (-.f64 t x) (-.f64 a z)))) < -5.9999999999999996e77 or 9.99999999999999982e108 < (+.f64 x (*.f64 (-.f64 y z) (/.f64 (-.f64 t x) (-.f64 a z)))) Initial program 6.2
Simplified6.2
Taylor expanded in y around 0 28.1
Simplified5.6
if -5.9999999999999996e77 < (+.f64 x (*.f64 (-.f64 y z) (/.f64 (-.f64 t x) (-.f64 a z)))) < -2.00000000000000003e-294Initial program 9.2
Simplified9.2
Taylor expanded in y around 0 3.4
Applied egg-rr3.4
Applied egg-rr3.4
if -2.00000000000000003e-294 < (+.f64 x (*.f64 (-.f64 y z) (/.f64 (-.f64 t x) (-.f64 a z)))) < 0.0Initial program 61.2
Simplified60.8
Taylor expanded in z around inf 11.6
Simplified1.9
if 0.0 < (+.f64 x (*.f64 (-.f64 y z) (/.f64 (-.f64 t x) (-.f64 a z)))) < 9.99999999999999982e108Initial program 8.9
Simplified8.9
Taylor expanded in y around 0 4.8
Applied egg-rr3.2
Applied egg-rr3.2
Final simplification4.2
herbie shell --seed 2022166
(FPCore (x y z t a)
:name "Numeric.Signal:interpolate from hsignal-0.2.7.1"
:precision binary64
(+ x (* (- y z) (/ (- t x) (- a z)))))