
(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 (/ t_1 t_2)))
(if (<= t_3 -5e-321)
t_3
(if (<= t_3 0.0)
(/ (/ t_1 (- (/ t a) z)) a)
(if (<= t_3 5e-47)
t_3
(if (<= t_3 INFINITY)
(fma y (/ z (fma z a (- 0.0 t))) (/ x t_2))
(/ 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 = t_1 / t_2;
double tmp;
if (t_3 <= -5e-321) {
tmp = t_3;
} else if (t_3 <= 0.0) {
tmp = (t_1 / ((t / a) - z)) / a;
} else if (t_3 <= 5e-47) {
tmp = t_3;
} else if (t_3 <= ((double) INFINITY)) {
tmp = fma(y, (z / fma(z, a, (0.0 - t))), (x / t_2));
} 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 = Float64(t_1 / t_2) tmp = 0.0 if (t_3 <= -5e-321) tmp = t_3; elseif (t_3 <= 0.0) tmp = Float64(Float64(t_1 / Float64(Float64(t / a) - z)) / a); elseif (t_3 <= 5e-47) tmp = t_3; elseif (t_3 <= Inf) tmp = fma(y, Float64(z / fma(z, a, Float64(0.0 - t))), Float64(x / t_2)); 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[(t$95$1 / t$95$2), $MachinePrecision]}, If[LessEqual[t$95$3, -5e-321], t$95$3, If[LessEqual[t$95$3, 0.0], N[(N[(t$95$1 / N[(N[(t / a), $MachinePrecision] - z), $MachinePrecision]), $MachinePrecision] / a), $MachinePrecision], If[LessEqual[t$95$3, 5e-47], t$95$3, If[LessEqual[t$95$3, Infinity], N[(y * N[(z / N[(z * a + N[(0.0 - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(x / t$95$2), $MachinePrecision]), $MachinePrecision], N[(y / a), $MachinePrecision]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x - y \cdot z\\
t_2 := t - z \cdot a\\
t_3 := \frac{t\_1}{t\_2}\\
\mathbf{if}\;t\_3 \leq -5 \cdot 10^{-321}:\\
\;\;\;\;t\_3\\
\mathbf{elif}\;t\_3 \leq 0:\\
\;\;\;\;\frac{\frac{t\_1}{\frac{t}{a} - z}}{a}\\
\mathbf{elif}\;t\_3 \leq 5 \cdot 10^{-47}:\\
\;\;\;\;t\_3\\
\mathbf{elif}\;t\_3 \leq \infty:\\
\;\;\;\;\mathsf{fma}\left(y, \frac{z}{\mathsf{fma}\left(z, a, 0 - t\right)}, \frac{x}{t\_2}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{y}{a}\\
\end{array}
\end{array}
if (/.f64 (-.f64 x (*.f64 y z)) (-.f64 t (*.f64 a z))) < -4.99994e-321 or -0.0 < (/.f64 (-.f64 x (*.f64 y z)) (-.f64 t (*.f64 a z))) < 5.00000000000000011e-47Initial program 97.7%
if -4.99994e-321 < (/.f64 (-.f64 x (*.f64 y z)) (-.f64 t (*.f64 a z))) < -0.0Initial program 49.8%
Taylor expanded in a around inf
*-lowering-*.f64N/A
--lowering--.f64N/A
/-lowering-/.f6449.8
Simplified49.8%
*-commutativeN/A
associate-/r*N/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
--lowering--.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
--lowering--.f64N/A
/-lowering-/.f6499.7
Applied egg-rr99.7%
if 5.00000000000000011e-47 < (/.f64 (-.f64 x (*.f64 y z)) (-.f64 t (*.f64 a z))) < +inf.0Initial program 91.6%
Taylor expanded in x around 0
mul-1-negN/A
associate-/l*N/A
distribute-rgt-neg-inN/A
mul-1-negN/A
accelerator-lowering-fma.f64N/A
Simplified99.8%
if +inf.0 < (/.f64 (-.f64 x (*.f64 y z)) (-.f64 t (*.f64 a z))) Initial program 0.0%
Taylor expanded in z around inf
/-lowering-/.f64100.0
Simplified100.0%
Final simplification98.6%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (- x (* y z))) (t_2 (/ t_1 (- t (* z a)))))
(if (<= t_2 -5e-321)
t_2
(if (<= t_2 0.0)
(/ (/ t_1 (- (/ t a) z)) a)
(if (<= t_2 1e+307)
t_2
(if (<= t_2 INFINITY)
(fma z (/ y (fma z a (- 0.0 t))) (/ x t))
(/ y a)))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = x - (y * z);
double t_2 = t_1 / (t - (z * a));
double tmp;
if (t_2 <= -5e-321) {
tmp = t_2;
} else if (t_2 <= 0.0) {
tmp = (t_1 / ((t / a) - z)) / a;
} else if (t_2 <= 1e+307) {
tmp = t_2;
} else if (t_2 <= ((double) INFINITY)) {
tmp = fma(z, (y / fma(z, a, (0.0 - t))), (x / t));
} else {
tmp = y / a;
}
return tmp;
}
function code(x, y, z, t, a) t_1 = Float64(x - Float64(y * z)) t_2 = Float64(t_1 / Float64(t - Float64(z * a))) tmp = 0.0 if (t_2 <= -5e-321) tmp = t_2; elseif (t_2 <= 0.0) tmp = Float64(Float64(t_1 / Float64(Float64(t / a) - z)) / a); elseif (t_2 <= 1e+307) tmp = t_2; elseif (t_2 <= Inf) tmp = fma(z, Float64(y / fma(z, a, Float64(0.0 - t))), Float64(x / t)); 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$95$1 / N[(t - N[(z * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$2, -5e-321], t$95$2, If[LessEqual[t$95$2, 0.0], N[(N[(t$95$1 / N[(N[(t / a), $MachinePrecision] - z), $MachinePrecision]), $MachinePrecision] / a), $MachinePrecision], If[LessEqual[t$95$2, 1e+307], t$95$2, If[LessEqual[t$95$2, Infinity], N[(z * N[(y / N[(z * a + N[(0.0 - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(x / t), $MachinePrecision]), $MachinePrecision], N[(y / a), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x - y \cdot z\\
t_2 := \frac{t\_1}{t - z \cdot a}\\
\mathbf{if}\;t\_2 \leq -5 \cdot 10^{-321}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;t\_2 \leq 0:\\
\;\;\;\;\frac{\frac{t\_1}{\frac{t}{a} - z}}{a}\\
\mathbf{elif}\;t\_2 \leq 10^{+307}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;t\_2 \leq \infty:\\
\;\;\;\;\mathsf{fma}\left(z, \frac{y}{\mathsf{fma}\left(z, a, 0 - t\right)}, \frac{x}{t}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{y}{a}\\
\end{array}
\end{array}
if (/.f64 (-.f64 x (*.f64 y z)) (-.f64 t (*.f64 a z))) < -4.99994e-321 or -0.0 < (/.f64 (-.f64 x (*.f64 y z)) (-.f64 t (*.f64 a z))) < 9.99999999999999986e306Initial program 98.2%
if -4.99994e-321 < (/.f64 (-.f64 x (*.f64 y z)) (-.f64 t (*.f64 a z))) < -0.0Initial program 49.8%
Taylor expanded in a around inf
*-lowering-*.f64N/A
--lowering--.f64N/A
/-lowering-/.f6449.8
Simplified49.8%
*-commutativeN/A
associate-/r*N/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
--lowering--.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
--lowering--.f64N/A
/-lowering-/.f6499.7
Applied egg-rr99.7%
if 9.99999999999999986e306 < (/.f64 (-.f64 x (*.f64 y z)) (-.f64 t (*.f64 a z))) < +inf.0Initial program 73.6%
Taylor expanded in x around 0
mul-1-negN/A
associate-/l*N/A
distribute-rgt-neg-inN/A
mul-1-negN/A
accelerator-lowering-fma.f64N/A
Simplified99.9%
Taylor expanded in t around inf
/-lowering-/.f6496.5
Simplified96.5%
associate-*r/N/A
*-commutativeN/A
sub0-negN/A
sub-negN/A
associate-/l*N/A
accelerator-lowering-fma.f64N/A
/-lowering-/.f64N/A
sub-negN/A
sub0-negN/A
accelerator-lowering-fma.f64N/A
--lowering--.f64N/A
/-lowering-/.f6496.6
Applied egg-rr96.6%
if +inf.0 < (/.f64 (-.f64 x (*.f64 y z)) (-.f64 t (*.f64 a z))) Initial program 0.0%
Taylor expanded in z around inf
/-lowering-/.f64100.0
Simplified100.0%
Final simplification98.3%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (/ (- x (* y z)) (- t (* z a)))))
(if (<= t_1 -5e-321)
t_1
(if (<= t_1 0.0)
(/ (- y (/ x z)) a)
(if (<= t_1 1e+307)
t_1
(if (<= t_1 INFINITY)
(fma z (/ y (fma z a (- 0.0 t))) (/ x t))
(/ y a)))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = (x - (y * z)) / (t - (z * a));
double tmp;
if (t_1 <= -5e-321) {
tmp = t_1;
} else if (t_1 <= 0.0) {
tmp = (y - (x / z)) / a;
} else if (t_1 <= 1e+307) {
tmp = t_1;
} else if (t_1 <= ((double) INFINITY)) {
tmp = fma(z, (y / fma(z, a, (0.0 - t))), (x / t));
} else {
tmp = y / a;
}
return tmp;
}
function code(x, y, z, t, a) t_1 = Float64(Float64(x - Float64(y * z)) / Float64(t - Float64(z * a))) tmp = 0.0 if (t_1 <= -5e-321) tmp = t_1; elseif (t_1 <= 0.0) tmp = Float64(Float64(y - Float64(x / z)) / a); elseif (t_1 <= 1e+307) tmp = t_1; elseif (t_1 <= Inf) tmp = fma(z, Float64(y / fma(z, a, Float64(0.0 - t))), Float64(x / t)); else tmp = Float64(y / a); end return tmp end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(x - N[(y * z), $MachinePrecision]), $MachinePrecision] / N[(t - N[(z * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, -5e-321], t$95$1, If[LessEqual[t$95$1, 0.0], N[(N[(y - N[(x / z), $MachinePrecision]), $MachinePrecision] / a), $MachinePrecision], If[LessEqual[t$95$1, 1e+307], t$95$1, If[LessEqual[t$95$1, Infinity], N[(z * N[(y / N[(z * a + N[(0.0 - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(x / t), $MachinePrecision]), $MachinePrecision], N[(y / a), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{x - y \cdot z}{t - z \cdot a}\\
\mathbf{if}\;t\_1 \leq -5 \cdot 10^{-321}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t\_1 \leq 0:\\
\;\;\;\;\frac{y - \frac{x}{z}}{a}\\
\mathbf{elif}\;t\_1 \leq 10^{+307}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t\_1 \leq \infty:\\
\;\;\;\;\mathsf{fma}\left(z, \frac{y}{\mathsf{fma}\left(z, a, 0 - t\right)}, \frac{x}{t}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{y}{a}\\
\end{array}
\end{array}
if (/.f64 (-.f64 x (*.f64 y z)) (-.f64 t (*.f64 a z))) < -4.99994e-321 or -0.0 < (/.f64 (-.f64 x (*.f64 y z)) (-.f64 t (*.f64 a z))) < 9.99999999999999986e306Initial program 98.2%
if -4.99994e-321 < (/.f64 (-.f64 x (*.f64 y z)) (-.f64 t (*.f64 a z))) < -0.0Initial program 49.8%
Taylor expanded in x around 0
mul-1-negN/A
associate-/l*N/A
distribute-rgt-neg-inN/A
mul-1-negN/A
accelerator-lowering-fma.f64N/A
Simplified49.8%
Taylor expanded in a around inf
/-lowering-/.f64N/A
mul-1-negN/A
unsub-negN/A
--lowering--.f64N/A
/-lowering-/.f6496.6
Simplified96.6%
if 9.99999999999999986e306 < (/.f64 (-.f64 x (*.f64 y z)) (-.f64 t (*.f64 a z))) < +inf.0Initial program 73.6%
Taylor expanded in x around 0
mul-1-negN/A
associate-/l*N/A
distribute-rgt-neg-inN/A
mul-1-negN/A
accelerator-lowering-fma.f64N/A
Simplified99.9%
Taylor expanded in t around inf
/-lowering-/.f6496.5
Simplified96.5%
associate-*r/N/A
*-commutativeN/A
sub0-negN/A
sub-negN/A
associate-/l*N/A
accelerator-lowering-fma.f64N/A
/-lowering-/.f64N/A
sub-negN/A
sub0-negN/A
accelerator-lowering-fma.f64N/A
--lowering--.f64N/A
/-lowering-/.f6496.6
Applied egg-rr96.6%
if +inf.0 < (/.f64 (-.f64 x (*.f64 y z)) (-.f64 t (*.f64 a z))) Initial program 0.0%
Taylor expanded in z around inf
/-lowering-/.f64100.0
Simplified100.0%
Final simplification98.0%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (/ (- x (* y z)) (- t (* z a)))))
(if (<= t_1 -5e-321)
t_1
(if (<= t_1 0.0)
(/ (- y (/ x z)) a)
(if (<= t_1 1e+307)
t_1
(if (<= t_1 INFINITY)
(fma y (/ z (fma z a (- 0.0 t))) (/ x t))
(/ y a)))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = (x - (y * z)) / (t - (z * a));
double tmp;
if (t_1 <= -5e-321) {
tmp = t_1;
} else if (t_1 <= 0.0) {
tmp = (y - (x / z)) / a;
} else if (t_1 <= 1e+307) {
tmp = t_1;
} else if (t_1 <= ((double) INFINITY)) {
tmp = fma(y, (z / fma(z, a, (0.0 - t))), (x / t));
} else {
tmp = y / a;
}
return tmp;
}
function code(x, y, z, t, a) t_1 = Float64(Float64(x - Float64(y * z)) / Float64(t - Float64(z * a))) tmp = 0.0 if (t_1 <= -5e-321) tmp = t_1; elseif (t_1 <= 0.0) tmp = Float64(Float64(y - Float64(x / z)) / a); elseif (t_1 <= 1e+307) tmp = t_1; elseif (t_1 <= Inf) tmp = fma(y, Float64(z / fma(z, a, Float64(0.0 - t))), Float64(x / t)); else tmp = Float64(y / a); end return tmp end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(x - N[(y * z), $MachinePrecision]), $MachinePrecision] / N[(t - N[(z * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, -5e-321], t$95$1, If[LessEqual[t$95$1, 0.0], N[(N[(y - N[(x / z), $MachinePrecision]), $MachinePrecision] / a), $MachinePrecision], If[LessEqual[t$95$1, 1e+307], t$95$1, If[LessEqual[t$95$1, Infinity], N[(y * N[(z / N[(z * a + N[(0.0 - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(x / t), $MachinePrecision]), $MachinePrecision], N[(y / a), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{x - y \cdot z}{t - z \cdot a}\\
\mathbf{if}\;t\_1 \leq -5 \cdot 10^{-321}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t\_1 \leq 0:\\
\;\;\;\;\frac{y - \frac{x}{z}}{a}\\
\mathbf{elif}\;t\_1 \leq 10^{+307}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t\_1 \leq \infty:\\
\;\;\;\;\mathsf{fma}\left(y, \frac{z}{\mathsf{fma}\left(z, a, 0 - t\right)}, \frac{x}{t}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{y}{a}\\
\end{array}
\end{array}
if (/.f64 (-.f64 x (*.f64 y z)) (-.f64 t (*.f64 a z))) < -4.99994e-321 or -0.0 < (/.f64 (-.f64 x (*.f64 y z)) (-.f64 t (*.f64 a z))) < 9.99999999999999986e306Initial program 98.2%
if -4.99994e-321 < (/.f64 (-.f64 x (*.f64 y z)) (-.f64 t (*.f64 a z))) < -0.0Initial program 49.8%
Taylor expanded in x around 0
mul-1-negN/A
associate-/l*N/A
distribute-rgt-neg-inN/A
mul-1-negN/A
accelerator-lowering-fma.f64N/A
Simplified49.8%
Taylor expanded in a around inf
/-lowering-/.f64N/A
mul-1-negN/A
unsub-negN/A
--lowering--.f64N/A
/-lowering-/.f6496.6
Simplified96.6%
if 9.99999999999999986e306 < (/.f64 (-.f64 x (*.f64 y z)) (-.f64 t (*.f64 a z))) < +inf.0Initial program 73.6%
Taylor expanded in x around 0
mul-1-negN/A
associate-/l*N/A
distribute-rgt-neg-inN/A
mul-1-negN/A
accelerator-lowering-fma.f64N/A
Simplified99.9%
Taylor expanded in t around inf
/-lowering-/.f6496.5
Simplified96.5%
if +inf.0 < (/.f64 (-.f64 x (*.f64 y z)) (-.f64 t (*.f64 a z))) Initial program 0.0%
Taylor expanded in z around inf
/-lowering-/.f64100.0
Simplified100.0%
Final simplification98.0%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (/ (- x (* y z)) (- t (* z a)))))
(if (<= t_1 -5e-321)
t_1
(if (<= t_1 0.0)
(/ (- y (/ x z)) a)
(if (<= t_1 INFINITY) t_1 (/ y a))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = (x - (y * z)) / (t - (z * a));
double tmp;
if (t_1 <= -5e-321) {
tmp = t_1;
} else if (t_1 <= 0.0) {
tmp = (y - (x / z)) / a;
} else if (t_1 <= ((double) INFINITY)) {
tmp = t_1;
} else {
tmp = y / a;
}
return tmp;
}
public static double code(double x, double y, double z, double t, double a) {
double t_1 = (x - (y * z)) / (t - (z * a));
double tmp;
if (t_1 <= -5e-321) {
tmp = t_1;
} else if (t_1 <= 0.0) {
tmp = (y - (x / z)) / a;
} else if (t_1 <= Double.POSITIVE_INFINITY) {
tmp = t_1;
} else {
tmp = y / a;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = (x - (y * z)) / (t - (z * a)) tmp = 0 if t_1 <= -5e-321: tmp = t_1 elif t_1 <= 0.0: tmp = (y - (x / z)) / a elif t_1 <= math.inf: tmp = t_1 else: tmp = y / a return tmp
function code(x, y, z, t, a) t_1 = Float64(Float64(x - Float64(y * z)) / Float64(t - Float64(z * a))) tmp = 0.0 if (t_1 <= -5e-321) tmp = t_1; elseif (t_1 <= 0.0) tmp = Float64(Float64(y - Float64(x / z)) / a); elseif (t_1 <= Inf) tmp = t_1; else tmp = Float64(y / a); end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = (x - (y * z)) / (t - (z * a)); tmp = 0.0; if (t_1 <= -5e-321) tmp = t_1; elseif (t_1 <= 0.0) tmp = (y - (x / z)) / a; elseif (t_1 <= Inf) tmp = t_1; else tmp = y / a; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(x - N[(y * z), $MachinePrecision]), $MachinePrecision] / N[(t - N[(z * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, -5e-321], t$95$1, If[LessEqual[t$95$1, 0.0], N[(N[(y - N[(x / z), $MachinePrecision]), $MachinePrecision] / a), $MachinePrecision], If[LessEqual[t$95$1, Infinity], t$95$1, N[(y / a), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{x - y \cdot z}{t - z \cdot a}\\
\mathbf{if}\;t\_1 \leq -5 \cdot 10^{-321}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t\_1 \leq 0:\\
\;\;\;\;\frac{y - \frac{x}{z}}{a}\\
\mathbf{elif}\;t\_1 \leq \infty:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;\frac{y}{a}\\
\end{array}
\end{array}
if (/.f64 (-.f64 x (*.f64 y z)) (-.f64 t (*.f64 a z))) < -4.99994e-321 or -0.0 < (/.f64 (-.f64 x (*.f64 y z)) (-.f64 t (*.f64 a z))) < +inf.0Initial program 95.8%
if -4.99994e-321 < (/.f64 (-.f64 x (*.f64 y z)) (-.f64 t (*.f64 a z))) < -0.0Initial program 49.8%
Taylor expanded in x around 0
mul-1-negN/A
associate-/l*N/A
distribute-rgt-neg-inN/A
mul-1-negN/A
accelerator-lowering-fma.f64N/A
Simplified49.8%
Taylor expanded in a around inf
/-lowering-/.f64N/A
mul-1-negN/A
unsub-negN/A
--lowering--.f64N/A
/-lowering-/.f6496.6
Simplified96.6%
if +inf.0 < (/.f64 (-.f64 x (*.f64 y z)) (-.f64 t (*.f64 a z))) Initial program 0.0%
Taylor expanded in z around inf
/-lowering-/.f64100.0
Simplified100.0%
Final simplification96.1%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (* y (/ z (- (* z a) t)))))
(if (<= z -4.5e+168)
(/ y a)
(if (<= z -7.2e-32)
t_1
(if (<= z 5e+25)
(/ (- x (* y z)) t)
(if (<= z 1.65e+206) t_1 (/ y a)))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = y * (z / ((z * a) - t));
double tmp;
if (z <= -4.5e+168) {
tmp = y / a;
} else if (z <= -7.2e-32) {
tmp = t_1;
} else if (z <= 5e+25) {
tmp = (x - (y * z)) / t;
} else if (z <= 1.65e+206) {
tmp = t_1;
} 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) :: t_1
real(8) :: tmp
t_1 = y * (z / ((z * a) - t))
if (z <= (-4.5d+168)) then
tmp = y / a
else if (z <= (-7.2d-32)) then
tmp = t_1
else if (z <= 5d+25) then
tmp = (x - (y * z)) / t
else if (z <= 1.65d+206) then
tmp = t_1
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 t_1 = y * (z / ((z * a) - t));
double tmp;
if (z <= -4.5e+168) {
tmp = y / a;
} else if (z <= -7.2e-32) {
tmp = t_1;
} else if (z <= 5e+25) {
tmp = (x - (y * z)) / t;
} else if (z <= 1.65e+206) {
tmp = t_1;
} else {
tmp = y / a;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = y * (z / ((z * a) - t)) tmp = 0 if z <= -4.5e+168: tmp = y / a elif z <= -7.2e-32: tmp = t_1 elif z <= 5e+25: tmp = (x - (y * z)) / t elif z <= 1.65e+206: tmp = t_1 else: tmp = y / a return tmp
function code(x, y, z, t, a) t_1 = Float64(y * Float64(z / Float64(Float64(z * a) - t))) tmp = 0.0 if (z <= -4.5e+168) tmp = Float64(y / a); elseif (z <= -7.2e-32) tmp = t_1; elseif (z <= 5e+25) tmp = Float64(Float64(x - Float64(y * z)) / t); elseif (z <= 1.65e+206) tmp = t_1; else tmp = Float64(y / a); end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = y * (z / ((z * a) - t)); tmp = 0.0; if (z <= -4.5e+168) tmp = y / a; elseif (z <= -7.2e-32) tmp = t_1; elseif (z <= 5e+25) tmp = (x - (y * z)) / t; elseif (z <= 1.65e+206) tmp = t_1; else tmp = y / a; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(y * N[(z / N[(N[(z * a), $MachinePrecision] - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -4.5e+168], N[(y / a), $MachinePrecision], If[LessEqual[z, -7.2e-32], t$95$1, If[LessEqual[z, 5e+25], N[(N[(x - N[(y * z), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision], If[LessEqual[z, 1.65e+206], t$95$1, N[(y / a), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := y \cdot \frac{z}{z \cdot a - t}\\
\mathbf{if}\;z \leq -4.5 \cdot 10^{+168}:\\
\;\;\;\;\frac{y}{a}\\
\mathbf{elif}\;z \leq -7.2 \cdot 10^{-32}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 5 \cdot 10^{+25}:\\
\;\;\;\;\frac{x - y \cdot z}{t}\\
\mathbf{elif}\;z \leq 1.65 \cdot 10^{+206}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;\frac{y}{a}\\
\end{array}
\end{array}
if z < -4.50000000000000012e168 or 1.64999999999999992e206 < z Initial program 58.2%
Taylor expanded in z around inf
/-lowering-/.f6474.8
Simplified74.8%
if -4.50000000000000012e168 < z < -7.19999999999999986e-32 or 5.00000000000000024e25 < z < 1.64999999999999992e206Initial program 80.8%
div-invN/A
flip--N/A
clear-numN/A
frac-2negN/A
metadata-evalN/A
frac-timesN/A
metadata-evalN/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
clear-numN/A
flip--N/A
/-lowering-/.f64N/A
--lowering--.f64N/A
*-lowering-*.f64N/A
neg-sub0N/A
Applied egg-rr79.6%
Taylor expanded in x around 0
associate-/l*N/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
--lowering--.f64N/A
*-commutativeN/A
*-lowering-*.f6467.8
Simplified67.8%
if -7.19999999999999986e-32 < z < 5.00000000000000024e25Initial program 99.8%
Taylor expanded in t around inf
/-lowering-/.f64N/A
--lowering--.f64N/A
*-lowering-*.f6478.0
Simplified78.0%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (/ (- y (/ x z)) a)))
(if (<= z -3.5e+30)
t_1
(if (<= z 5.5e+28)
(/ (- x (* y z)) t)
(if (<= z 5.7e+203) (* y (/ z (- (* z a) t))) t_1)))))
double code(double x, double y, double z, double t, double a) {
double t_1 = (y - (x / z)) / a;
double tmp;
if (z <= -3.5e+30) {
tmp = t_1;
} else if (z <= 5.5e+28) {
tmp = (x - (y * z)) / t;
} else if (z <= 5.7e+203) {
tmp = y * (z / ((z * a) - 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 - (x / z)) / a
if (z <= (-3.5d+30)) then
tmp = t_1
else if (z <= 5.5d+28) then
tmp = (x - (y * z)) / t
else if (z <= 5.7d+203) then
tmp = y * (z / ((z * a) - 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 - (x / z)) / a;
double tmp;
if (z <= -3.5e+30) {
tmp = t_1;
} else if (z <= 5.5e+28) {
tmp = (x - (y * z)) / t;
} else if (z <= 5.7e+203) {
tmp = y * (z / ((z * a) - t));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = (y - (x / z)) / a tmp = 0 if z <= -3.5e+30: tmp = t_1 elif z <= 5.5e+28: tmp = (x - (y * z)) / t elif z <= 5.7e+203: tmp = y * (z / ((z * a) - t)) else: tmp = t_1 return tmp
function code(x, y, z, t, a) t_1 = Float64(Float64(y - Float64(x / z)) / a) tmp = 0.0 if (z <= -3.5e+30) tmp = t_1; elseif (z <= 5.5e+28) tmp = Float64(Float64(x - Float64(y * z)) / t); elseif (z <= 5.7e+203) tmp = Float64(y * Float64(z / Float64(Float64(z * a) - t))); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = (y - (x / z)) / a; tmp = 0.0; if (z <= -3.5e+30) tmp = t_1; elseif (z <= 5.5e+28) tmp = (x - (y * z)) / t; elseif (z <= 5.7e+203) tmp = y * (z / ((z * a) - t)); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(y - N[(x / z), $MachinePrecision]), $MachinePrecision] / a), $MachinePrecision]}, If[LessEqual[z, -3.5e+30], t$95$1, If[LessEqual[z, 5.5e+28], N[(N[(x - N[(y * z), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision], If[LessEqual[z, 5.7e+203], N[(y * N[(z / N[(N[(z * a), $MachinePrecision] - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{y - \frac{x}{z}}{a}\\
\mathbf{if}\;z \leq -3.5 \cdot 10^{+30}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 5.5 \cdot 10^{+28}:\\
\;\;\;\;\frac{x - y \cdot z}{t}\\
\mathbf{elif}\;z \leq 5.7 \cdot 10^{+203}:\\
\;\;\;\;y \cdot \frac{z}{z \cdot a - t}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -3.50000000000000021e30 or 5.7e203 < z Initial program 66.2%
Taylor expanded in x around 0
mul-1-negN/A
associate-/l*N/A
distribute-rgt-neg-inN/A
mul-1-negN/A
accelerator-lowering-fma.f64N/A
Simplified72.2%
Taylor expanded in a around inf
/-lowering-/.f64N/A
mul-1-negN/A
unsub-negN/A
--lowering--.f64N/A
/-lowering-/.f6485.0
Simplified85.0%
if -3.50000000000000021e30 < z < 5.5000000000000003e28Initial program 99.8%
Taylor expanded in t around inf
/-lowering-/.f64N/A
--lowering--.f64N/A
*-lowering-*.f6476.1
Simplified76.1%
if 5.5000000000000003e28 < z < 5.7e203Initial program 69.6%
div-invN/A
flip--N/A
clear-numN/A
frac-2negN/A
metadata-evalN/A
frac-timesN/A
metadata-evalN/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
clear-numN/A
flip--N/A
/-lowering-/.f64N/A
--lowering--.f64N/A
*-lowering-*.f64N/A
neg-sub0N/A
Applied egg-rr69.4%
Taylor expanded in x around 0
associate-/l*N/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
--lowering--.f64N/A
*-commutativeN/A
*-lowering-*.f6474.5
Simplified74.5%
(FPCore (x y z t a)
:precision binary64
(if (<= z -3.3e+28)
(/ y a)
(if (<= z 1.6e+20)
(/ x (- t (* z a)))
(if (<= z 1.45e+201) (* y (/ (- 0.0 z) t)) (/ y a)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -3.3e+28) {
tmp = y / a;
} else if (z <= 1.6e+20) {
tmp = x / (t - (z * a));
} else if (z <= 1.45e+201) {
tmp = y * ((0.0 - z) / 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 <= (-3.3d+28)) then
tmp = y / a
else if (z <= 1.6d+20) then
tmp = x / (t - (z * a))
else if (z <= 1.45d+201) then
tmp = y * ((0.0d0 - z) / 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 <= -3.3e+28) {
tmp = y / a;
} else if (z <= 1.6e+20) {
tmp = x / (t - (z * a));
} else if (z <= 1.45e+201) {
tmp = y * ((0.0 - z) / t);
} else {
tmp = y / a;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -3.3e+28: tmp = y / a elif z <= 1.6e+20: tmp = x / (t - (z * a)) elif z <= 1.45e+201: tmp = y * ((0.0 - z) / t) else: tmp = y / a return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -3.3e+28) tmp = Float64(y / a); elseif (z <= 1.6e+20) tmp = Float64(x / Float64(t - Float64(z * a))); elseif (z <= 1.45e+201) tmp = Float64(y * Float64(Float64(0.0 - z) / t)); else tmp = Float64(y / a); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (z <= -3.3e+28) tmp = y / a; elseif (z <= 1.6e+20) tmp = x / (t - (z * a)); elseif (z <= 1.45e+201) tmp = y * ((0.0 - z) / t); else tmp = y / a; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -3.3e+28], N[(y / a), $MachinePrecision], If[LessEqual[z, 1.6e+20], N[(x / N[(t - N[(z * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.45e+201], N[(y * N[(N[(0.0 - z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision], N[(y / a), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -3.3 \cdot 10^{+28}:\\
\;\;\;\;\frac{y}{a}\\
\mathbf{elif}\;z \leq 1.6 \cdot 10^{+20}:\\
\;\;\;\;\frac{x}{t - z \cdot a}\\
\mathbf{elif}\;z \leq 1.45 \cdot 10^{+201}:\\
\;\;\;\;y \cdot \frac{0 - z}{t}\\
\mathbf{else}:\\
\;\;\;\;\frac{y}{a}\\
\end{array}
\end{array}
if z < -3.3e28 or 1.4500000000000001e201 < z Initial program 67.0%
Taylor expanded in z around inf
/-lowering-/.f6466.7
Simplified66.7%
if -3.3e28 < z < 1.6e20Initial program 99.8%
Taylor expanded in x around inf
/-lowering-/.f64N/A
--lowering--.f64N/A
*-commutativeN/A
*-lowering-*.f6472.4
Simplified72.4%
if 1.6e20 < z < 1.4500000000000001e201Initial program 71.6%
Taylor expanded in a around inf
*-lowering-*.f64N/A
--lowering--.f64N/A
/-lowering-/.f6458.3
Simplified58.3%
Taylor expanded in a around 0
/-lowering-/.f64N/A
--lowering--.f64N/A
*-commutativeN/A
*-lowering-*.f6452.1
Simplified52.1%
Taylor expanded in x around 0
mul-1-negN/A
associate-/l*N/A
distribute-rgt-neg-inN/A
mul-1-negN/A
*-lowering-*.f64N/A
mul-1-negN/A
distribute-neg-frac2N/A
mul-1-negN/A
/-lowering-/.f64N/A
mul-1-negN/A
neg-sub0N/A
--lowering--.f6453.7
Simplified53.7%
Final simplification68.3%
(FPCore (x y z t a)
:precision binary64
(if (<= z -1.05e-35)
(/ y a)
(if (<= z 9.2e+18)
(/ x t)
(if (<= z 1.45e+201) (* y (/ (- 0.0 z) t)) (/ y a)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -1.05e-35) {
tmp = y / a;
} else if (z <= 9.2e+18) {
tmp = x / t;
} else if (z <= 1.45e+201) {
tmp = y * ((0.0 - z) / 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.05d-35)) then
tmp = y / a
else if (z <= 9.2d+18) then
tmp = x / t
else if (z <= 1.45d+201) then
tmp = y * ((0.0d0 - z) / 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.05e-35) {
tmp = y / a;
} else if (z <= 9.2e+18) {
tmp = x / t;
} else if (z <= 1.45e+201) {
tmp = y * ((0.0 - z) / t);
} else {
tmp = y / a;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -1.05e-35: tmp = y / a elif z <= 9.2e+18: tmp = x / t elif z <= 1.45e+201: tmp = y * ((0.0 - z) / t) else: tmp = y / a return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -1.05e-35) tmp = Float64(y / a); elseif (z <= 9.2e+18) tmp = Float64(x / t); elseif (z <= 1.45e+201) tmp = Float64(y * Float64(Float64(0.0 - z) / 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.05e-35) tmp = y / a; elseif (z <= 9.2e+18) tmp = x / t; elseif (z <= 1.45e+201) tmp = y * ((0.0 - z) / t); else tmp = y / a; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -1.05e-35], N[(y / a), $MachinePrecision], If[LessEqual[z, 9.2e+18], N[(x / t), $MachinePrecision], If[LessEqual[z, 1.45e+201], N[(y * N[(N[(0.0 - z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision], N[(y / a), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.05 \cdot 10^{-35}:\\
\;\;\;\;\frac{y}{a}\\
\mathbf{elif}\;z \leq 9.2 \cdot 10^{+18}:\\
\;\;\;\;\frac{x}{t}\\
\mathbf{elif}\;z \leq 1.45 \cdot 10^{+201}:\\
\;\;\;\;y \cdot \frac{0 - z}{t}\\
\mathbf{else}:\\
\;\;\;\;\frac{y}{a}\\
\end{array}
\end{array}
if z < -1.05e-35 or 1.4500000000000001e201 < z Initial program 71.0%
Taylor expanded in z around inf
/-lowering-/.f6461.9
Simplified61.9%
if -1.05e-35 < z < 9.2e18Initial program 99.8%
Taylor expanded in z around 0
/-lowering-/.f6461.4
Simplified61.4%
if 9.2e18 < z < 1.4500000000000001e201Initial program 71.6%
Taylor expanded in a around inf
*-lowering-*.f64N/A
--lowering--.f64N/A
/-lowering-/.f6458.3
Simplified58.3%
Taylor expanded in a around 0
/-lowering-/.f64N/A
--lowering--.f64N/A
*-commutativeN/A
*-lowering-*.f6452.1
Simplified52.1%
Taylor expanded in x around 0
mul-1-negN/A
associate-/l*N/A
distribute-rgt-neg-inN/A
mul-1-negN/A
*-lowering-*.f64N/A
mul-1-negN/A
distribute-neg-frac2N/A
mul-1-negN/A
/-lowering-/.f64N/A
mul-1-negN/A
neg-sub0N/A
--lowering--.f6453.7
Simplified53.7%
Final simplification60.7%
(FPCore (x y z t a) :precision binary64 (if (<= z -5.8e+33) (/ y a) (if (<= z 1.45e+201) (/ (- x (* y z)) t) (/ y a))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -5.8e+33) {
tmp = y / a;
} else if (z <= 1.45e+201) {
tmp = (x - (y * z)) / 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.8d+33)) then
tmp = y / a
else if (z <= 1.45d+201) then
tmp = (x - (y * z)) / 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.8e+33) {
tmp = y / a;
} else if (z <= 1.45e+201) {
tmp = (x - (y * z)) / t;
} else {
tmp = y / a;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -5.8e+33: tmp = y / a elif z <= 1.45e+201: tmp = (x - (y * z)) / t else: tmp = y / a return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -5.8e+33) tmp = Float64(y / a); elseif (z <= 1.45e+201) tmp = Float64(Float64(x - Float64(y * z)) / 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.8e+33) tmp = y / a; elseif (z <= 1.45e+201) tmp = (x - (y * z)) / t; else tmp = y / a; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -5.8e+33], N[(y / a), $MachinePrecision], If[LessEqual[z, 1.45e+201], N[(N[(x - N[(y * z), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision], N[(y / a), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -5.8 \cdot 10^{+33}:\\
\;\;\;\;\frac{y}{a}\\
\mathbf{elif}\;z \leq 1.45 \cdot 10^{+201}:\\
\;\;\;\;\frac{x - y \cdot z}{t}\\
\mathbf{else}:\\
\;\;\;\;\frac{y}{a}\\
\end{array}
\end{array}
if z < -5.80000000000000049e33 or 1.4500000000000001e201 < z Initial program 66.2%
Taylor expanded in z around inf
/-lowering-/.f6467.0
Simplified67.0%
if -5.80000000000000049e33 < z < 1.4500000000000001e201Initial program 94.8%
Taylor expanded in t around inf
/-lowering-/.f64N/A
--lowering--.f64N/A
*-lowering-*.f6471.6
Simplified71.6%
(FPCore (x y z t a) :precision binary64 (if (<= z -1.35e-35) (/ y a) (if (<= z 4.2e+30) (/ x t) (/ y a))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -1.35e-35) {
tmp = y / a;
} else if (z <= 4.2e+30) {
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.35d-35)) then
tmp = y / a
else if (z <= 4.2d+30) 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.35e-35) {
tmp = y / a;
} else if (z <= 4.2e+30) {
tmp = x / t;
} else {
tmp = y / a;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -1.35e-35: tmp = y / a elif z <= 4.2e+30: tmp = x / t else: tmp = y / a return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -1.35e-35) tmp = Float64(y / a); elseif (z <= 4.2e+30) 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.35e-35) tmp = y / a; elseif (z <= 4.2e+30) tmp = x / t; else tmp = y / a; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -1.35e-35], N[(y / a), $MachinePrecision], If[LessEqual[z, 4.2e+30], N[(x / t), $MachinePrecision], N[(y / a), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.35 \cdot 10^{-35}:\\
\;\;\;\;\frac{y}{a}\\
\mathbf{elif}\;z \leq 4.2 \cdot 10^{+30}:\\
\;\;\;\;\frac{x}{t}\\
\mathbf{else}:\\
\;\;\;\;\frac{y}{a}\\
\end{array}
\end{array}
if z < -1.3499999999999999e-35 or 4.2e30 < z Initial program 70.7%
Taylor expanded in z around inf
/-lowering-/.f6456.7
Simplified56.7%
if -1.3499999999999999e-35 < z < 4.2e30Initial program 99.8%
Taylor expanded in z around 0
/-lowering-/.f6461.2
Simplified61.2%
(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 85.3%
Taylor expanded in z around 0
/-lowering-/.f6435.1
Simplified35.1%
(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 2024196
(FPCore (x y z t a)
:name "Diagrams.Solve.Tridiagonal:solveTriDiagonal from diagrams-solve-0.1, A"
:precision binary64
:alt
(! :herbie-platform default (if (< z -32113435955957344) (- (/ x (- t (* a z))) (/ y (- (/ t z) a))) (if (< z 4392440296622287/125000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000) (* (- x (* y z)) (/ 1 (- t (* a z)))) (- (/ x (- t (* a z))) (/ y (- (/ t z) a))))))
(/ (- x (* y z)) (- t (* a z))))