
(FPCore (x y z t a) :precision binary64 (/ (- x (* y z)) (- t (* a z))))
double code(double x, double y, double z, double t, double a) {
return (x - (y * z)) / (t - (a * z));
}
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 - (a * z))
end function
public static double code(double x, double y, double z, double t, double a) {
return (x - (y * z)) / (t - (a * z));
}
def code(x, y, z, t, a): return (x - (y * z)) / (t - (a * z))
function code(x, y, z, t, a) return Float64(Float64(x - Float64(y * z)) / Float64(t - Float64(a * z))) end
function tmp = code(x, y, z, t, a) tmp = (x - (y * z)) / (t - (a * z)); end
code[x_, y_, z_, t_, a_] := N[(N[(x - N[(y * z), $MachinePrecision]), $MachinePrecision] / N[(t - N[(a * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{x - y \cdot z}{t - a \cdot z}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 12 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t a) :precision binary64 (/ (- x (* y z)) (- t (* a z))))
double code(double x, double y, double z, double t, double a) {
return (x - (y * z)) / (t - (a * z));
}
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 - (a * z))
end function
public static double code(double x, double y, double z, double t, double a) {
return (x - (y * z)) / (t - (a * z));
}
def code(x, y, z, t, a): return (x - (y * z)) / (t - (a * z))
function code(x, y, z, t, a) return Float64(Float64(x - Float64(y * z)) / Float64(t - Float64(a * z))) end
function tmp = code(x, y, z, t, a) tmp = (x - (y * z)) / (t - (a * z)); end
code[x_, y_, z_, t_, a_] := N[(N[(x - N[(y * z), $MachinePrecision]), $MachinePrecision] / N[(t - N[(a * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{x - y \cdot z}{t - a \cdot z}
\end{array}
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (- x (* y z)))
(t_2 (- t (* z a)))
(t_3 (fma -1.0 (/ y (/ t_2 z)) (/ x t_2)))
(t_4 (/ t_1 t_2)))
(if (<= t_4 -2e-94)
t_3
(if (<= t_4 1e-165)
(pow (+ (* a (* z (/ -1.0 t_1))) (/ t t_1)) -1.0)
(if (<= t_4 INFINITY) t_3 (/ y a))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = x - (y * z);
double t_2 = t - (z * a);
double t_3 = fma(-1.0, (y / (t_2 / z)), (x / t_2));
double t_4 = t_1 / t_2;
double tmp;
if (t_4 <= -2e-94) {
tmp = t_3;
} else if (t_4 <= 1e-165) {
tmp = pow(((a * (z * (-1.0 / t_1))) + (t / t_1)), -1.0);
} else if (t_4 <= ((double) INFINITY)) {
tmp = t_3;
} else {
tmp = y / a;
}
return tmp;
}
function code(x, y, z, t, a) t_1 = Float64(x - Float64(y * z)) t_2 = Float64(t - Float64(z * a)) t_3 = fma(-1.0, Float64(y / Float64(t_2 / z)), Float64(x / t_2)) t_4 = Float64(t_1 / t_2) tmp = 0.0 if (t_4 <= -2e-94) tmp = t_3; elseif (t_4 <= 1e-165) tmp = Float64(Float64(a * Float64(z * Float64(-1.0 / t_1))) + Float64(t / t_1)) ^ -1.0; elseif (t_4 <= Inf) tmp = t_3; else tmp = Float64(y / a); end return tmp end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(x - N[(y * z), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(t - N[(z * a), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(-1.0 * N[(y / N[(t$95$2 / z), $MachinePrecision]), $MachinePrecision] + N[(x / t$95$2), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$4 = N[(t$95$1 / t$95$2), $MachinePrecision]}, If[LessEqual[t$95$4, -2e-94], t$95$3, If[LessEqual[t$95$4, 1e-165], N[Power[N[(N[(a * N[(z * N[(-1.0 / t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(t / t$95$1), $MachinePrecision]), $MachinePrecision], -1.0], $MachinePrecision], If[LessEqual[t$95$4, Infinity], t$95$3, N[(y / a), $MachinePrecision]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x - y \cdot z\\
t_2 := t - z \cdot a\\
t_3 := \mathsf{fma}\left(-1, \frac{y}{\frac{t_2}{z}}, \frac{x}{t_2}\right)\\
t_4 := \frac{t_1}{t_2}\\
\mathbf{if}\;t_4 \leq -2 \cdot 10^{-94}:\\
\;\;\;\;t_3\\
\mathbf{elif}\;t_4 \leq 10^{-165}:\\
\;\;\;\;{\left(a \cdot \left(z \cdot \frac{-1}{t_1}\right) + \frac{t}{t_1}\right)}^{-1}\\
\mathbf{elif}\;t_4 \leq \infty:\\
\;\;\;\;t_3\\
\mathbf{else}:\\
\;\;\;\;\frac{y}{a}\\
\end{array}
\end{array}
if (/.f64 (-.f64 x (*.f64 y z)) (-.f64 t (*.f64 a z))) < -1.9999999999999999e-94 or 1e-165 < (/.f64 (-.f64 x (*.f64 y z)) (-.f64 t (*.f64 a z))) < +inf.0Initial program 92.9%
*-commutative92.9%
Simplified92.9%
Taylor expanded in x around 0 92.8%
fma-def92.8%
associate-/l*99.8%
*-commutative99.8%
*-commutative99.8%
Simplified99.8%
if -1.9999999999999999e-94 < (/.f64 (-.f64 x (*.f64 y z)) (-.f64 t (*.f64 a z))) < 1e-165Initial program 78.7%
*-commutative78.7%
Simplified78.7%
clear-num77.2%
inv-pow77.2%
sub-neg77.2%
+-commutative77.2%
*-commutative77.2%
distribute-rgt-neg-in77.2%
fma-def77.2%
Applied egg-rr77.2%
Taylor expanded in a around 0 77.2%
div-inv77.3%
associate-*l*97.9%
*-commutative97.9%
Applied egg-rr97.9%
if +inf.0 < (/.f64 (-.f64 x (*.f64 y z)) (-.f64 t (*.f64 a z))) Initial program 0.0%
*-commutative0.0%
Simplified0.0%
Taylor expanded in z around inf 100.0%
Final simplification99.4%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (- t (* z a)))
(t_2 (fma -1.0 (/ y (/ t_1 z)) (/ x t_1)))
(t_3 (/ (- x (* y z)) t_1)))
(if (<= t_3 -5e-304)
t_2
(if (<= t_3 0.0)
(- (/ y a) (/ (/ x z) a))
(if (<= t_3 INFINITY) t_2 (/ y a))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = t - (z * a);
double t_2 = fma(-1.0, (y / (t_1 / z)), (x / t_1));
double t_3 = (x - (y * z)) / t_1;
double tmp;
if (t_3 <= -5e-304) {
tmp = t_2;
} else if (t_3 <= 0.0) {
tmp = (y / a) - ((x / z) / a);
} else if (t_3 <= ((double) INFINITY)) {
tmp = t_2;
} else {
tmp = y / a;
}
return tmp;
}
function code(x, y, z, t, a) t_1 = Float64(t - Float64(z * a)) t_2 = fma(-1.0, Float64(y / Float64(t_1 / z)), Float64(x / t_1)) t_3 = Float64(Float64(x - Float64(y * z)) / t_1) tmp = 0.0 if (t_3 <= -5e-304) tmp = t_2; elseif (t_3 <= 0.0) tmp = Float64(Float64(y / a) - Float64(Float64(x / z) / a)); elseif (t_3 <= Inf) tmp = t_2; else tmp = Float64(y / a); end return tmp end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(t - N[(z * a), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(-1.0 * N[(y / N[(t$95$1 / z), $MachinePrecision]), $MachinePrecision] + N[(x / t$95$1), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(N[(x - N[(y * z), $MachinePrecision]), $MachinePrecision] / t$95$1), $MachinePrecision]}, If[LessEqual[t$95$3, -5e-304], t$95$2, If[LessEqual[t$95$3, 0.0], N[(N[(y / a), $MachinePrecision] - N[(N[(x / z), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$3, Infinity], t$95$2, N[(y / a), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := t - z \cdot a\\
t_2 := \mathsf{fma}\left(-1, \frac{y}{\frac{t_1}{z}}, \frac{x}{t_1}\right)\\
t_3 := \frac{x - y \cdot z}{t_1}\\
\mathbf{if}\;t_3 \leq -5 \cdot 10^{-304}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;t_3 \leq 0:\\
\;\;\;\;\frac{y}{a} - \frac{\frac{x}{z}}{a}\\
\mathbf{elif}\;t_3 \leq \infty:\\
\;\;\;\;t_2\\
\mathbf{else}:\\
\;\;\;\;\frac{y}{a}\\
\end{array}
\end{array}
if (/.f64 (-.f64 x (*.f64 y z)) (-.f64 t (*.f64 a z))) < -4.99999999999999965e-304 or -0.0 < (/.f64 (-.f64 x (*.f64 y z)) (-.f64 t (*.f64 a z))) < +inf.0Initial program 93.9%
*-commutative93.9%
Simplified93.9%
Taylor expanded in x around 0 93.9%
fma-def93.9%
associate-/l*97.9%
*-commutative97.9%
*-commutative97.9%
Simplified97.9%
if -4.99999999999999965e-304 < (/.f64 (-.f64 x (*.f64 y z)) (-.f64 t (*.f64 a z))) < -0.0Initial program 47.9%
*-commutative47.9%
Simplified47.9%
Taylor expanded in t around 0 39.8%
associate-*r*39.8%
neg-mul-139.8%
*-commutative39.8%
Simplified39.8%
Taylor expanded in x around 0 72.5%
+-commutative72.5%
mul-1-neg72.5%
unsub-neg72.5%
*-commutative72.5%
associate-/r*91.8%
Simplified91.8%
if +inf.0 < (/.f64 (-.f64 x (*.f64 y z)) (-.f64 t (*.f64 a z))) Initial program 0.0%
*-commutative0.0%
Simplified0.0%
Taylor expanded in z around inf 100.0%
Final simplification97.4%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (/ x (- t (* z a)))) (t_2 (/ y (- a (/ t z)))))
(if (<= z -4.4e+74)
t_2
(if (<= z -8.2e-74)
t_1
(if (<= z 1e-39)
(/ (- x (* y z)) t)
(if (<= z 1.55e+25)
t_1
(if (<= z 3.4e+101) t_2 (- (/ y a) (/ (/ x z) a)))))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = x / (t - (z * a));
double t_2 = y / (a - (t / z));
double tmp;
if (z <= -4.4e+74) {
tmp = t_2;
} else if (z <= -8.2e-74) {
tmp = t_1;
} else if (z <= 1e-39) {
tmp = (x - (y * z)) / t;
} else if (z <= 1.55e+25) {
tmp = t_1;
} else if (z <= 3.4e+101) {
tmp = t_2;
} else {
tmp = (y / a) - ((x / z) / a);
}
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
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = x / (t - (z * a))
t_2 = y / (a - (t / z))
if (z <= (-4.4d+74)) then
tmp = t_2
else if (z <= (-8.2d-74)) then
tmp = t_1
else if (z <= 1d-39) then
tmp = (x - (y * z)) / t
else if (z <= 1.55d+25) then
tmp = t_1
else if (z <= 3.4d+101) then
tmp = t_2
else
tmp = (y / a) - ((x / z) / a)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double t_1 = x / (t - (z * a));
double t_2 = y / (a - (t / z));
double tmp;
if (z <= -4.4e+74) {
tmp = t_2;
} else if (z <= -8.2e-74) {
tmp = t_1;
} else if (z <= 1e-39) {
tmp = (x - (y * z)) / t;
} else if (z <= 1.55e+25) {
tmp = t_1;
} else if (z <= 3.4e+101) {
tmp = t_2;
} else {
tmp = (y / a) - ((x / z) / a);
}
return tmp;
}
def code(x, y, z, t, a): t_1 = x / (t - (z * a)) t_2 = y / (a - (t / z)) tmp = 0 if z <= -4.4e+74: tmp = t_2 elif z <= -8.2e-74: tmp = t_1 elif z <= 1e-39: tmp = (x - (y * z)) / t elif z <= 1.55e+25: tmp = t_1 elif z <= 3.4e+101: tmp = t_2 else: tmp = (y / a) - ((x / z) / a) return tmp
function code(x, y, z, t, a) t_1 = Float64(x / Float64(t - Float64(z * a))) t_2 = Float64(y / Float64(a - Float64(t / z))) tmp = 0.0 if (z <= -4.4e+74) tmp = t_2; elseif (z <= -8.2e-74) tmp = t_1; elseif (z <= 1e-39) tmp = Float64(Float64(x - Float64(y * z)) / t); elseif (z <= 1.55e+25) tmp = t_1; elseif (z <= 3.4e+101) tmp = t_2; else tmp = Float64(Float64(y / a) - Float64(Float64(x / z) / a)); end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = x / (t - (z * a)); t_2 = y / (a - (t / z)); tmp = 0.0; if (z <= -4.4e+74) tmp = t_2; elseif (z <= -8.2e-74) tmp = t_1; elseif (z <= 1e-39) tmp = (x - (y * z)) / t; elseif (z <= 1.55e+25) tmp = t_1; elseif (z <= 3.4e+101) tmp = t_2; else tmp = (y / a) - ((x / z) / a); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(x / N[(t - N[(z * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(y / N[(a - N[(t / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -4.4e+74], t$95$2, If[LessEqual[z, -8.2e-74], t$95$1, If[LessEqual[z, 1e-39], N[(N[(x - N[(y * z), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision], If[LessEqual[z, 1.55e+25], t$95$1, If[LessEqual[z, 3.4e+101], t$95$2, N[(N[(y / a), $MachinePrecision] - N[(N[(x / z), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{x}{t - z \cdot a}\\
t_2 := \frac{y}{a - \frac{t}{z}}\\
\mathbf{if}\;z \leq -4.4 \cdot 10^{+74}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;z \leq -8.2 \cdot 10^{-74}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq 10^{-39}:\\
\;\;\;\;\frac{x - y \cdot z}{t}\\
\mathbf{elif}\;z \leq 1.55 \cdot 10^{+25}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq 3.4 \cdot 10^{+101}:\\
\;\;\;\;t_2\\
\mathbf{else}:\\
\;\;\;\;\frac{y}{a} - \frac{\frac{x}{z}}{a}\\
\end{array}
\end{array}
if z < -4.4000000000000002e74 or 1.5499999999999999e25 < z < 3.40000000000000017e101Initial program 67.8%
*-commutative67.8%
Simplified67.8%
clear-num67.1%
inv-pow67.1%
sub-neg67.1%
+-commutative67.1%
*-commutative67.1%
distribute-rgt-neg-in67.1%
fma-def67.1%
Applied egg-rr67.1%
Taylor expanded in a around 0 66.7%
Taylor expanded in y around inf 89.3%
mul-1-neg89.3%
unsub-neg89.3%
Simplified89.3%
if -4.4000000000000002e74 < z < -8.20000000000000063e-74 or 9.99999999999999929e-40 < z < 1.5499999999999999e25Initial program 99.8%
*-commutative99.8%
Simplified99.8%
Taylor expanded in x around inf 71.7%
*-commutative71.7%
Simplified71.7%
if -8.20000000000000063e-74 < z < 9.99999999999999929e-40Initial program 99.8%
*-commutative99.8%
Simplified99.8%
Taylor expanded in t around inf 86.3%
if 3.40000000000000017e101 < z Initial program 62.1%
*-commutative62.1%
Simplified62.1%
Taylor expanded in t around 0 53.7%
associate-*r*53.7%
neg-mul-153.7%
*-commutative53.7%
Simplified53.7%
Taylor expanded in x around 0 71.6%
+-commutative71.6%
mul-1-neg71.6%
unsub-neg71.6%
*-commutative71.6%
associate-/r*83.0%
Simplified83.0%
Final simplification83.9%
(FPCore (x y z t a)
:precision binary64
(if (<= z -1.66e+97)
(/ y (- a (/ t z)))
(if (<= z 3.6e+149)
(/ (- x (* y z)) (- t (* z a)))
(- (/ y a) (/ (/ x z) a)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -1.66e+97) {
tmp = y / (a - (t / z));
} else if (z <= 3.6e+149) {
tmp = (x - (y * z)) / (t - (z * a));
} else {
tmp = (y / a) - ((x / z) / a);
}
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
real(8) :: tmp
if (z <= (-1.66d+97)) then
tmp = y / (a - (t / z))
else if (z <= 3.6d+149) then
tmp = (x - (y * z)) / (t - (z * a))
else
tmp = (y / a) - ((x / z) / a)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -1.66e+97) {
tmp = y / (a - (t / z));
} else if (z <= 3.6e+149) {
tmp = (x - (y * z)) / (t - (z * a));
} else {
tmp = (y / a) - ((x / z) / a);
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -1.66e+97: tmp = y / (a - (t / z)) elif z <= 3.6e+149: tmp = (x - (y * z)) / (t - (z * a)) else: tmp = (y / a) - ((x / z) / a) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -1.66e+97) tmp = Float64(y / Float64(a - Float64(t / z))); elseif (z <= 3.6e+149) tmp = Float64(Float64(x - Float64(y * z)) / Float64(t - Float64(z * a))); else tmp = Float64(Float64(y / a) - Float64(Float64(x / z) / a)); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (z <= -1.66e+97) tmp = y / (a - (t / z)); elseif (z <= 3.6e+149) tmp = (x - (y * z)) / (t - (z * a)); else tmp = (y / a) - ((x / z) / a); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -1.66e+97], N[(y / N[(a - N[(t / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 3.6e+149], N[(N[(x - N[(y * z), $MachinePrecision]), $MachinePrecision] / N[(t - N[(z * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(y / a), $MachinePrecision] - N[(N[(x / z), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.66 \cdot 10^{+97}:\\
\;\;\;\;\frac{y}{a - \frac{t}{z}}\\
\mathbf{elif}\;z \leq 3.6 \cdot 10^{+149}:\\
\;\;\;\;\frac{x - y \cdot z}{t - z \cdot a}\\
\mathbf{else}:\\
\;\;\;\;\frac{y}{a} - \frac{\frac{x}{z}}{a}\\
\end{array}
\end{array}
if z < -1.6599999999999999e97Initial program 59.4%
*-commutative59.4%
Simplified59.4%
clear-num59.4%
inv-pow59.4%
sub-neg59.4%
+-commutative59.4%
*-commutative59.4%
distribute-rgt-neg-in59.4%
fma-def59.4%
Applied egg-rr59.4%
Taylor expanded in a around 0 58.8%
Taylor expanded in y around inf 93.4%
mul-1-neg93.4%
unsub-neg93.4%
Simplified93.4%
if -1.6599999999999999e97 < z < 3.59999999999999995e149Initial program 97.8%
if 3.59999999999999995e149 < z Initial program 55.6%
*-commutative55.6%
Simplified55.6%
Taylor expanded in t around 0 52.4%
associate-*r*52.4%
neg-mul-152.4%
*-commutative52.4%
Simplified52.4%
Taylor expanded in x around 0 75.1%
+-commutative75.1%
mul-1-neg75.1%
unsub-neg75.1%
*-commutative75.1%
associate-/r*86.0%
Simplified86.0%
Final simplification95.9%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (/ y (- a (/ t z)))))
(if (<= z -5e+76)
t_1
(if (<= z -7.5e-76)
(/ x (- t (* z a)))
(if (<= z 1.32e-17) (/ (- x (* y z)) t) t_1)))))
double code(double x, double y, double z, double t, double a) {
double t_1 = y / (a - (t / z));
double tmp;
if (z <= -5e+76) {
tmp = t_1;
} else if (z <= -7.5e-76) {
tmp = x / (t - (z * a));
} else if (z <= 1.32e-17) {
tmp = (x - (y * z)) / t;
} 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
real(8) :: t_1
real(8) :: tmp
t_1 = y / (a - (t / z))
if (z <= (-5d+76)) then
tmp = t_1
else if (z <= (-7.5d-76)) then
tmp = x / (t - (z * a))
else if (z <= 1.32d-17) then
tmp = (x - (y * z)) / t
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double t_1 = y / (a - (t / z));
double tmp;
if (z <= -5e+76) {
tmp = t_1;
} else if (z <= -7.5e-76) {
tmp = x / (t - (z * a));
} else if (z <= 1.32e-17) {
tmp = (x - (y * z)) / t;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = y / (a - (t / z)) tmp = 0 if z <= -5e+76: tmp = t_1 elif z <= -7.5e-76: tmp = x / (t - (z * a)) elif z <= 1.32e-17: tmp = (x - (y * z)) / t else: tmp = t_1 return tmp
function code(x, y, z, t, a) t_1 = Float64(y / Float64(a - Float64(t / z))) tmp = 0.0 if (z <= -5e+76) tmp = t_1; elseif (z <= -7.5e-76) tmp = Float64(x / Float64(t - Float64(z * a))); elseif (z <= 1.32e-17) tmp = Float64(Float64(x - Float64(y * z)) / t); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = y / (a - (t / z)); tmp = 0.0; if (z <= -5e+76) tmp = t_1; elseif (z <= -7.5e-76) tmp = x / (t - (z * a)); elseif (z <= 1.32e-17) tmp = (x - (y * z)) / t; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(y / N[(a - N[(t / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -5e+76], t$95$1, If[LessEqual[z, -7.5e-76], N[(x / N[(t - N[(z * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.32e-17], N[(N[(x - N[(y * z), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{y}{a - \frac{t}{z}}\\
\mathbf{if}\;z \leq -5 \cdot 10^{+76}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq -7.5 \cdot 10^{-76}:\\
\;\;\;\;\frac{x}{t - z \cdot a}\\
\mathbf{elif}\;z \leq 1.32 \cdot 10^{-17}:\\
\;\;\;\;\frac{x - y \cdot z}{t}\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if z < -4.99999999999999991e76 or 1.3200000000000001e-17 < z Initial program 67.5%
*-commutative67.5%
Simplified67.5%
clear-num67.1%
inv-pow67.1%
sub-neg67.1%
+-commutative67.1%
*-commutative67.1%
distribute-rgt-neg-in67.1%
fma-def67.1%
Applied egg-rr67.1%
Taylor expanded in a around 0 65.7%
Taylor expanded in y around inf 81.0%
mul-1-neg81.0%
unsub-neg81.0%
Simplified81.0%
if -4.99999999999999991e76 < z < -7.4999999999999997e-76Initial program 99.7%
*-commutative99.7%
Simplified99.7%
Taylor expanded in x around inf 66.0%
*-commutative66.0%
Simplified66.0%
if -7.4999999999999997e-76 < z < 1.3200000000000001e-17Initial program 99.8%
*-commutative99.8%
Simplified99.8%
Taylor expanded in t around inf 85.2%
Final simplification80.8%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -1.36e+79) (not (<= z 1.45e+26))) (/ y a) (/ x (- t (* z a)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -1.36e+79) || !(z <= 1.45e+26)) {
tmp = y / a;
} else {
tmp = x / (t - (z * a));
}
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
real(8) :: tmp
if ((z <= (-1.36d+79)) .or. (.not. (z <= 1.45d+26))) then
tmp = y / a
else
tmp = x / (t - (z * a))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -1.36e+79) || !(z <= 1.45e+26)) {
tmp = y / a;
} else {
tmp = x / (t - (z * a));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -1.36e+79) or not (z <= 1.45e+26): tmp = y / a else: tmp = x / (t - (z * a)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -1.36e+79) || !(z <= 1.45e+26)) tmp = Float64(y / a); else tmp = Float64(x / Float64(t - Float64(z * a))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((z <= -1.36e+79) || ~((z <= 1.45e+26))) tmp = y / a; else tmp = x / (t - (z * a)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -1.36e+79], N[Not[LessEqual[z, 1.45e+26]], $MachinePrecision]], N[(y / a), $MachinePrecision], N[(x / N[(t - N[(z * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.36 \cdot 10^{+79} \lor \neg \left(z \leq 1.45 \cdot 10^{+26}\right):\\
\;\;\;\;\frac{y}{a}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{t - z \cdot a}\\
\end{array}
\end{array}
if z < -1.36000000000000003e79 or 1.45e26 < z Initial program 65.8%
*-commutative65.8%
Simplified65.8%
Taylor expanded in z around inf 60.8%
if -1.36000000000000003e79 < z < 1.45e26Initial program 99.8%
*-commutative99.8%
Simplified99.8%
Taylor expanded in x around inf 70.6%
*-commutative70.6%
Simplified70.6%
Final simplification66.9%
(FPCore (x y z t a) :precision binary64 (if (or (<= y -7.2e+86) (not (<= y 6.2e-80))) (/ y (- a (/ t z))) (/ x (- t (* z a)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((y <= -7.2e+86) || !(y <= 6.2e-80)) {
tmp = y / (a - (t / z));
} else {
tmp = x / (t - (z * a));
}
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
real(8) :: tmp
if ((y <= (-7.2d+86)) .or. (.not. (y <= 6.2d-80))) then
tmp = y / (a - (t / z))
else
tmp = x / (t - (z * a))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((y <= -7.2e+86) || !(y <= 6.2e-80)) {
tmp = y / (a - (t / z));
} else {
tmp = x / (t - (z * a));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (y <= -7.2e+86) or not (y <= 6.2e-80): tmp = y / (a - (t / z)) else: tmp = x / (t - (z * a)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((y <= -7.2e+86) || !(y <= 6.2e-80)) tmp = Float64(y / Float64(a - Float64(t / z))); else tmp = Float64(x / Float64(t - Float64(z * a))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((y <= -7.2e+86) || ~((y <= 6.2e-80))) tmp = y / (a - (t / z)); else tmp = x / (t - (z * a)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[y, -7.2e+86], N[Not[LessEqual[y, 6.2e-80]], $MachinePrecision]], N[(y / N[(a - N[(t / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x / N[(t - N[(z * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -7.2 \cdot 10^{+86} \lor \neg \left(y \leq 6.2 \cdot 10^{-80}\right):\\
\;\;\;\;\frac{y}{a - \frac{t}{z}}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{t - z \cdot a}\\
\end{array}
\end{array}
if y < -7.20000000000000011e86 or 6.20000000000000032e-80 < y Initial program 80.7%
*-commutative80.7%
Simplified80.7%
clear-num80.6%
inv-pow80.6%
sub-neg80.6%
+-commutative80.6%
*-commutative80.6%
distribute-rgt-neg-in80.6%
fma-def80.6%
Applied egg-rr80.6%
Taylor expanded in a around 0 78.7%
Taylor expanded in y around inf 73.2%
mul-1-neg73.2%
unsub-neg73.2%
Simplified73.2%
if -7.20000000000000011e86 < y < 6.20000000000000032e-80Initial program 93.2%
*-commutative93.2%
Simplified93.2%
Taylor expanded in x around inf 78.2%
*-commutative78.2%
Simplified78.2%
Final simplification75.7%
(FPCore (x y z t a) :precision binary64 (if (<= z -1.26e+54) (/ y a) (if (<= z -9.4e-42) (/ (- z) (/ t y)) (if (<= z 1e-15) (/ x t) (/ y a)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -1.26e+54) {
tmp = y / a;
} else if (z <= -9.4e-42) {
tmp = -z / (t / y);
} else if (z <= 1e-15) {
tmp = x / t;
} else {
tmp = y / a;
}
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
real(8) :: tmp
if (z <= (-1.26d+54)) then
tmp = y / a
else if (z <= (-9.4d-42)) then
tmp = -z / (t / y)
else if (z <= 1d-15) then
tmp = x / t
else
tmp = y / a
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -1.26e+54) {
tmp = y / a;
} else if (z <= -9.4e-42) {
tmp = -z / (t / y);
} else if (z <= 1e-15) {
tmp = x / t;
} else {
tmp = y / a;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -1.26e+54: tmp = y / a elif z <= -9.4e-42: tmp = -z / (t / y) elif z <= 1e-15: tmp = x / t else: tmp = y / a return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -1.26e+54) tmp = Float64(y / a); elseif (z <= -9.4e-42) tmp = Float64(Float64(-z) / Float64(t / y)); elseif (z <= 1e-15) tmp = Float64(x / t); else tmp = Float64(y / a); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (z <= -1.26e+54) tmp = y / a; elseif (z <= -9.4e-42) tmp = -z / (t / y); elseif (z <= 1e-15) tmp = x / t; else tmp = y / a; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -1.26e+54], N[(y / a), $MachinePrecision], If[LessEqual[z, -9.4e-42], N[((-z) / N[(t / y), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1e-15], N[(x / t), $MachinePrecision], N[(y / a), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.26 \cdot 10^{+54}:\\
\;\;\;\;\frac{y}{a}\\
\mathbf{elif}\;z \leq -9.4 \cdot 10^{-42}:\\
\;\;\;\;\frac{-z}{\frac{t}{y}}\\
\mathbf{elif}\;z \leq 10^{-15}:\\
\;\;\;\;\frac{x}{t}\\
\mathbf{else}:\\
\;\;\;\;\frac{y}{a}\\
\end{array}
\end{array}
if z < -1.25999999999999995e54 or 1.0000000000000001e-15 < z Initial program 68.7%
*-commutative68.7%
Simplified68.7%
Taylor expanded in z around inf 58.7%
if -1.25999999999999995e54 < z < -9.4000000000000001e-42Initial program 99.8%
*-commutative99.8%
Simplified99.8%
Taylor expanded in x around 0 39.8%
mul-1-neg39.8%
associate-/l*39.8%
*-commutative39.8%
Simplified39.8%
Taylor expanded in t around inf 33.1%
*-commutative33.1%
associate-/l*36.7%
Simplified36.7%
if -9.4000000000000001e-42 < z < 1.0000000000000001e-15Initial program 99.8%
*-commutative99.8%
Simplified99.8%
Taylor expanded in z around 0 61.7%
Final simplification57.9%
(FPCore (x y z t a)
:precision binary64
(if (<= z -1.25e+54)
(/ y a)
(if (<= z -3.45e-41)
(/ (/ (- x) a) z)
(if (<= z 2.75e-15) (/ x t) (/ y a)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -1.25e+54) {
tmp = y / a;
} else if (z <= -3.45e-41) {
tmp = (-x / a) / z;
} else if (z <= 2.75e-15) {
tmp = x / t;
} else {
tmp = y / a;
}
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
real(8) :: tmp
if (z <= (-1.25d+54)) then
tmp = y / a
else if (z <= (-3.45d-41)) then
tmp = (-x / a) / z
else if (z <= 2.75d-15) then
tmp = x / t
else
tmp = y / a
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -1.25e+54) {
tmp = y / a;
} else if (z <= -3.45e-41) {
tmp = (-x / a) / z;
} else if (z <= 2.75e-15) {
tmp = x / t;
} else {
tmp = y / a;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -1.25e+54: tmp = y / a elif z <= -3.45e-41: tmp = (-x / a) / z elif z <= 2.75e-15: tmp = x / t else: tmp = y / a return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -1.25e+54) tmp = Float64(y / a); elseif (z <= -3.45e-41) tmp = Float64(Float64(Float64(-x) / a) / z); elseif (z <= 2.75e-15) tmp = Float64(x / t); else tmp = Float64(y / a); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (z <= -1.25e+54) tmp = y / a; elseif (z <= -3.45e-41) tmp = (-x / a) / z; elseif (z <= 2.75e-15) tmp = x / t; else tmp = y / a; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -1.25e+54], N[(y / a), $MachinePrecision], If[LessEqual[z, -3.45e-41], N[(N[((-x) / a), $MachinePrecision] / z), $MachinePrecision], If[LessEqual[z, 2.75e-15], N[(x / t), $MachinePrecision], N[(y / a), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.25 \cdot 10^{+54}:\\
\;\;\;\;\frac{y}{a}\\
\mathbf{elif}\;z \leq -3.45 \cdot 10^{-41}:\\
\;\;\;\;\frac{\frac{-x}{a}}{z}\\
\mathbf{elif}\;z \leq 2.75 \cdot 10^{-15}:\\
\;\;\;\;\frac{x}{t}\\
\mathbf{else}:\\
\;\;\;\;\frac{y}{a}\\
\end{array}
\end{array}
if z < -1.25000000000000001e54 or 2.7500000000000001e-15 < z Initial program 68.7%
*-commutative68.7%
Simplified68.7%
Taylor expanded in z around inf 58.7%
if -1.25000000000000001e54 < z < -3.4499999999999999e-41Initial program 99.8%
*-commutative99.8%
Simplified99.8%
Taylor expanded in t around 0 70.5%
associate-*r*70.5%
neg-mul-170.5%
*-commutative70.5%
Simplified70.5%
*-un-lft-identity70.5%
times-frac68.1%
frac-2neg68.1%
metadata-eval68.1%
add-sqr-sqrt67.8%
sqrt-unprod68.1%
sqr-neg68.1%
sqrt-unprod0.0%
add-sqr-sqrt5.6%
sub-neg5.6%
*-commutative5.6%
distribute-lft-neg-in5.6%
add-sqr-sqrt5.6%
sqrt-unprod5.6%
sqr-neg5.6%
sqrt-unprod0.0%
add-sqr-sqrt11.5%
add-sqr-sqrt6.3%
sqrt-unprod26.2%
sqr-neg26.2%
sqrt-unprod27.2%
add-sqr-sqrt62.2%
Applied egg-rr62.2%
Taylor expanded in z around 0 62.9%
mul-1-neg62.9%
associate-/r*62.7%
Simplified62.7%
if -3.4499999999999999e-41 < z < 2.7500000000000001e-15Initial program 99.8%
*-commutative99.8%
Simplified99.8%
Taylor expanded in z around 0 61.7%
Final simplification60.6%
(FPCore (x y z t a)
:precision binary64
(if (<= z -5.1e+53)
(/ y a)
(if (<= z -3.45e-41)
(/ (- x) (* z a))
(if (<= z 2.85e-15) (/ x t) (/ y a)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -5.1e+53) {
tmp = y / a;
} else if (z <= -3.45e-41) {
tmp = -x / (z * a);
} else if (z <= 2.85e-15) {
tmp = x / t;
} else {
tmp = y / a;
}
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
real(8) :: tmp
if (z <= (-5.1d+53)) then
tmp = y / a
else if (z <= (-3.45d-41)) then
tmp = -x / (z * a)
else if (z <= 2.85d-15) then
tmp = x / t
else
tmp = y / a
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -5.1e+53) {
tmp = y / a;
} else if (z <= -3.45e-41) {
tmp = -x / (z * a);
} else if (z <= 2.85e-15) {
tmp = x / t;
} else {
tmp = y / a;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -5.1e+53: tmp = y / a elif z <= -3.45e-41: tmp = -x / (z * a) elif z <= 2.85e-15: tmp = x / t else: tmp = y / a return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -5.1e+53) tmp = Float64(y / a); elseif (z <= -3.45e-41) tmp = Float64(Float64(-x) / Float64(z * a)); elseif (z <= 2.85e-15) tmp = Float64(x / t); else tmp = Float64(y / a); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (z <= -5.1e+53) tmp = y / a; elseif (z <= -3.45e-41) tmp = -x / (z * a); elseif (z <= 2.85e-15) tmp = x / t; else tmp = y / a; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -5.1e+53], N[(y / a), $MachinePrecision], If[LessEqual[z, -3.45e-41], N[((-x) / N[(z * a), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 2.85e-15], N[(x / t), $MachinePrecision], N[(y / a), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -5.1 \cdot 10^{+53}:\\
\;\;\;\;\frac{y}{a}\\
\mathbf{elif}\;z \leq -3.45 \cdot 10^{-41}:\\
\;\;\;\;\frac{-x}{z \cdot a}\\
\mathbf{elif}\;z \leq 2.85 \cdot 10^{-15}:\\
\;\;\;\;\frac{x}{t}\\
\mathbf{else}:\\
\;\;\;\;\frac{y}{a}\\
\end{array}
\end{array}
if z < -5.0999999999999998e53 or 2.8500000000000002e-15 < z Initial program 68.7%
*-commutative68.7%
Simplified68.7%
Taylor expanded in z around inf 58.7%
if -5.0999999999999998e53 < z < -3.4499999999999999e-41Initial program 99.8%
*-commutative99.8%
Simplified99.8%
Taylor expanded in t around 0 70.5%
associate-*r*70.5%
neg-mul-170.5%
*-commutative70.5%
Simplified70.5%
clear-num70.3%
associate-/r/70.3%
associate-/r*70.2%
frac-2neg70.2%
metadata-eval70.2%
add-sqr-sqrt70.0%
sqrt-unprod70.2%
sqr-neg70.2%
sqrt-unprod0.0%
add-sqr-sqrt5.6%
add-sqr-sqrt1.2%
sqrt-unprod25.3%
sqr-neg25.3%
sqrt-unprod27.9%
add-sqr-sqrt70.2%
sub-neg70.2%
*-commutative70.2%
distribute-lft-neg-in70.2%
add-sqr-sqrt70.2%
sqrt-unprod70.2%
sqr-neg70.2%
sqrt-unprod0.0%
add-sqr-sqrt62.2%
Applied egg-rr62.2%
Taylor expanded in z around 0 62.9%
associate-*r/62.9%
neg-mul-162.9%
Simplified62.9%
if -3.4499999999999999e-41 < z < 2.8500000000000002e-15Initial program 99.8%
*-commutative99.8%
Simplified99.8%
Taylor expanded in z around 0 61.7%
Final simplification60.6%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -6.3e+75) (not (<= z 8.2e-18))) (/ y a) (/ x t)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -6.3e+75) || !(z <= 8.2e-18)) {
tmp = y / a;
} else {
tmp = x / t;
}
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
real(8) :: tmp
if ((z <= (-6.3d+75)) .or. (.not. (z <= 8.2d-18))) then
tmp = y / a
else
tmp = x / t
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -6.3e+75) || !(z <= 8.2e-18)) {
tmp = y / a;
} else {
tmp = x / t;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -6.3e+75) or not (z <= 8.2e-18): tmp = y / a else: tmp = x / t return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -6.3e+75) || !(z <= 8.2e-18)) tmp = Float64(y / a); else tmp = Float64(x / t); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((z <= -6.3e+75) || ~((z <= 8.2e-18))) tmp = y / a; else tmp = x / t; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -6.3e+75], N[Not[LessEqual[z, 8.2e-18]], $MachinePrecision]], N[(y / a), $MachinePrecision], N[(x / t), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -6.3 \cdot 10^{+75} \lor \neg \left(z \leq 8.2 \cdot 10^{-18}\right):\\
\;\;\;\;\frac{y}{a}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{t}\\
\end{array}
\end{array}
if z < -6.30000000000000036e75 or 8.1999999999999995e-18 < z Initial program 67.5%
*-commutative67.5%
Simplified67.5%
Taylor expanded in z around inf 59.9%
if -6.30000000000000036e75 < z < 8.1999999999999995e-18Initial program 99.8%
*-commutative99.8%
Simplified99.8%
Taylor expanded in z around 0 53.5%
Final simplification56.0%
(FPCore (x y z t a) :precision binary64 (/ x t))
double code(double x, double y, double z, double t, double a) {
return x / t;
}
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 / t
end function
public static double code(double x, double y, double z, double t, double a) {
return x / t;
}
def code(x, y, z, t, a): return x / t
function code(x, y, z, t, a) return Float64(x / t) end
function tmp = code(x, y, z, t, a) tmp = x / t; end
code[x_, y_, z_, t_, a_] := N[(x / t), $MachinePrecision]
\begin{array}{l}
\\
\frac{x}{t}
\end{array}
Initial program 87.1%
*-commutative87.1%
Simplified87.1%
Taylor expanded in z around 0 36.3%
Final simplification36.3%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (- t (* a z))) (t_2 (- (/ x t_1) (/ y (- (/ t z) a)))))
(if (< z -32113435955957344.0)
t_2
(if (< z 3.5139522372978296e-86) (* (- x (* y z)) (/ 1.0 t_1)) t_2))))
double code(double x, double y, double z, double t, double a) {
double t_1 = t - (a * z);
double t_2 = (x / t_1) - (y / ((t / z) - a));
double tmp;
if (z < -32113435955957344.0) {
tmp = t_2;
} else if (z < 3.5139522372978296e-86) {
tmp = (x - (y * z)) * (1.0 / t_1);
} else {
tmp = t_2;
}
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
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = t - (a * z)
t_2 = (x / t_1) - (y / ((t / z) - a))
if (z < (-32113435955957344.0d0)) then
tmp = t_2
else if (z < 3.5139522372978296d-86) then
tmp = (x - (y * z)) * (1.0d0 / t_1)
else
tmp = t_2
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double t_1 = t - (a * z);
double t_2 = (x / t_1) - (y / ((t / z) - a));
double tmp;
if (z < -32113435955957344.0) {
tmp = t_2;
} else if (z < 3.5139522372978296e-86) {
tmp = (x - (y * z)) * (1.0 / t_1);
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = t - (a * z) t_2 = (x / t_1) - (y / ((t / z) - a)) tmp = 0 if z < -32113435955957344.0: tmp = t_2 elif z < 3.5139522372978296e-86: tmp = (x - (y * z)) * (1.0 / t_1) else: tmp = t_2 return tmp
function code(x, y, z, t, a) t_1 = Float64(t - Float64(a * z)) t_2 = Float64(Float64(x / t_1) - Float64(y / Float64(Float64(t / z) - a))) tmp = 0.0 if (z < -32113435955957344.0) tmp = t_2; elseif (z < 3.5139522372978296e-86) tmp = Float64(Float64(x - Float64(y * z)) * Float64(1.0 / t_1)); else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = t - (a * z); t_2 = (x / t_1) - (y / ((t / z) - a)); tmp = 0.0; if (z < -32113435955957344.0) tmp = t_2; elseif (z < 3.5139522372978296e-86) tmp = (x - (y * z)) * (1.0 / t_1); else tmp = t_2; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(t - N[(a * z), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(x / t$95$1), $MachinePrecision] - N[(y / N[(N[(t / z), $MachinePrecision] - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[Less[z, -32113435955957344.0], t$95$2, If[Less[z, 3.5139522372978296e-86], N[(N[(x - N[(y * z), $MachinePrecision]), $MachinePrecision] * N[(1.0 / t$95$1), $MachinePrecision]), $MachinePrecision], t$95$2]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := t - a \cdot z\\
t_2 := \frac{x}{t_1} - \frac{y}{\frac{t}{z} - a}\\
\mathbf{if}\;z < -32113435955957344:\\
\;\;\;\;t_2\\
\mathbf{elif}\;z < 3.5139522372978296 \cdot 10^{-86}:\\
\;\;\;\;\left(x - y \cdot z\right) \cdot \frac{1}{t_1}\\
\mathbf{else}:\\
\;\;\;\;t_2\\
\end{array}
\end{array}
herbie shell --seed 2023332
(FPCore (x y z t a)
:name "Diagrams.Solve.Tridiagonal:solveTriDiagonal from diagrams-solve-0.1, A"
:precision binary64
:herbie-target
(if (< z -32113435955957344.0) (- (/ x (- t (* a z))) (/ y (- (/ t z) a))) (if (< z 3.5139522372978296e-86) (* (- x (* y z)) (/ 1.0 (- t (* a z)))) (- (/ x (- t (* a z))) (/ y (- (/ t z) a)))))
(/ (- x (* y z)) (- t (* a z))))