(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
(+
t
(- (+ (* (/ y z) x) (/ a (/ z t))) (+ (/ y (/ z t)) (* x (/ a z))))))
(t_2 (/ (- a z) z))
(t_3
(-
(+ (+ x (/ x t_2)) (* (/ y (- a z)) (- t x)))
(* z (/ t (- a z))))))
(if (<= z -3.682259159630762e+209)
t_1
(if (<= z -3.9658125341391284e-195)
t_3
(if (<= z 7.326205365430645e-52)
(+ x (- (/ (- t x) (/ (- a z) y)) (/ t t_2)))
(if (<= z 2.6384624238560835e+141) t_3 t_1))))))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 = t + ((((y / z) * x) + (a / (z / t))) - ((y / (z / t)) + (x * (a / z))));
double t_2 = (a - z) / z;
double t_3 = ((x + (x / t_2)) + ((y / (a - z)) * (t - x))) - (z * (t / (a - z)));
double tmp;
if (z <= -3.682259159630762e+209) {
tmp = t_1;
} else if (z <= -3.9658125341391284e-195) {
tmp = t_3;
} else if (z <= 7.326205365430645e-52) {
tmp = x + (((t - x) / ((a - z) / y)) - (t / t_2));
} else if (z <= 2.6384624238560835e+141) {
tmp = t_3;
} else {
tmp = t_1;
}
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) :: tmp
t_1 = t + ((((y / z) * x) + (a / (z / t))) - ((y / (z / t)) + (x * (a / z))))
t_2 = (a - z) / z
t_3 = ((x + (x / t_2)) + ((y / (a - z)) * (t - x))) - (z * (t / (a - z)))
if (z <= (-3.682259159630762d+209)) then
tmp = t_1
else if (z <= (-3.9658125341391284d-195)) then
tmp = t_3
else if (z <= 7.326205365430645d-52) then
tmp = x + (((t - x) / ((a - z) / y)) - (t / t_2))
else if (z <= 2.6384624238560835d+141) then
tmp = t_3
else
tmp = t_1
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 = t + ((((y / z) * x) + (a / (z / t))) - ((y / (z / t)) + (x * (a / z))));
double t_2 = (a - z) / z;
double t_3 = ((x + (x / t_2)) + ((y / (a - z)) * (t - x))) - (z * (t / (a - z)));
double tmp;
if (z <= -3.682259159630762e+209) {
tmp = t_1;
} else if (z <= -3.9658125341391284e-195) {
tmp = t_3;
} else if (z <= 7.326205365430645e-52) {
tmp = x + (((t - x) / ((a - z) / y)) - (t / t_2));
} else if (z <= 2.6384624238560835e+141) {
tmp = t_3;
} else {
tmp = t_1;
}
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 = t + ((((y / z) * x) + (a / (z / t))) - ((y / (z / t)) + (x * (a / z)))) t_2 = (a - z) / z t_3 = ((x + (x / t_2)) + ((y / (a - z)) * (t - x))) - (z * (t / (a - z))) tmp = 0 if z <= -3.682259159630762e+209: tmp = t_1 elif z <= -3.9658125341391284e-195: tmp = t_3 elif z <= 7.326205365430645e-52: tmp = x + (((t - x) / ((a - z) / y)) - (t / t_2)) elif z <= 2.6384624238560835e+141: tmp = t_3 else: tmp = t_1 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(t + Float64(Float64(Float64(Float64(y / z) * x) + Float64(a / Float64(z / t))) - Float64(Float64(y / Float64(z / t)) + Float64(x * Float64(a / z))))) t_2 = Float64(Float64(a - z) / z) t_3 = Float64(Float64(Float64(x + Float64(x / t_2)) + Float64(Float64(y / Float64(a - z)) * Float64(t - x))) - Float64(z * Float64(t / Float64(a - z)))) tmp = 0.0 if (z <= -3.682259159630762e+209) tmp = t_1; elseif (z <= -3.9658125341391284e-195) tmp = t_3; elseif (z <= 7.326205365430645e-52) tmp = Float64(x + Float64(Float64(Float64(t - x) / Float64(Float64(a - z) / y)) - Float64(t / t_2))); elseif (z <= 2.6384624238560835e+141) tmp = t_3; else tmp = t_1; 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 = t + ((((y / z) * x) + (a / (z / t))) - ((y / (z / t)) + (x * (a / z)))); t_2 = (a - z) / z; t_3 = ((x + (x / t_2)) + ((y / (a - z)) * (t - x))) - (z * (t / (a - z))); tmp = 0.0; if (z <= -3.682259159630762e+209) tmp = t_1; elseif (z <= -3.9658125341391284e-195) tmp = t_3; elseif (z <= 7.326205365430645e-52) tmp = x + (((t - x) / ((a - z) / y)) - (t / t_2)); elseif (z <= 2.6384624238560835e+141) tmp = t_3; else tmp = t_1; 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[(t + N[(N[(N[(N[(y / z), $MachinePrecision] * x), $MachinePrecision] + N[(a / N[(z / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(N[(y / N[(z / t), $MachinePrecision]), $MachinePrecision] + N[(x * N[(a / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(a - z), $MachinePrecision] / z), $MachinePrecision]}, Block[{t$95$3 = N[(N[(N[(x + N[(x / t$95$2), $MachinePrecision]), $MachinePrecision] + N[(N[(y / N[(a - z), $MachinePrecision]), $MachinePrecision] * N[(t - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(z * N[(t / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -3.682259159630762e+209], t$95$1, If[LessEqual[z, -3.9658125341391284e-195], t$95$3, If[LessEqual[z, 7.326205365430645e-52], N[(x + N[(N[(N[(t - x), $MachinePrecision] / N[(N[(a - z), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision] - N[(t / t$95$2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 2.6384624238560835e+141], t$95$3, t$95$1]]]]]]]
x + \left(y - z\right) \cdot \frac{t - x}{a - z}
\begin{array}{l}
t_1 := t + \left(\left(\frac{y}{z} \cdot x + \frac{a}{\frac{z}{t}}\right) - \left(\frac{y}{\frac{z}{t}} + x \cdot \frac{a}{z}\right)\right)\\
t_2 := \frac{a - z}{z}\\
t_3 := \left(\left(x + \frac{x}{t_2}\right) + \frac{y}{a - z} \cdot \left(t - x\right)\right) - z \cdot \frac{t}{a - z}\\
\mathbf{if}\;z \leq -3.682259159630762 \cdot 10^{+209}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq -3.9658125341391284 \cdot 10^{-195}:\\
\;\;\;\;t_3\\
\mathbf{elif}\;z \leq 7.326205365430645 \cdot 10^{-52}:\\
\;\;\;\;x + \left(\frac{t - x}{\frac{a - z}{y}} - \frac{t}{t_2}\right)\\
\mathbf{elif}\;z \leq 2.6384624238560835 \cdot 10^{+141}:\\
\;\;\;\;t_3\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}



Bits error versus x



Bits error versus y



Bits error versus z



Bits error versus t



Bits error versus a
Results
if z < -3.68225915963076195e209 or 2.6384624238560835e141 < z Initial program 28.1
Taylor expanded in z around inf 23.8
Simplified8.2
if -3.68225915963076195e209 < z < -3.96581253413912841e-195 or 7.3262053654306445e-52 < z < 2.6384624238560835e141Initial program 12.5
Applied egg-rr12.5
Taylor expanded in x around 0 17.8
Simplified5.6
if -3.96581253413912841e-195 < z < 7.3262053654306445e-52Initial program 7.0
Applied egg-rr7.0
Taylor expanded in t around inf 7.5
Simplified7.6
Taylor expanded in y around 0 8.0
Simplified3.7
Applied egg-rr3.6
Final simplification5.7
herbie shell --seed 2022153
(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)))))