
(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 14 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 (- t (* z a))) (t_2 (/ (- x (* y z)) t_1)) (t_3 (/ x t_1)))
(if (<= t_2 -2e+56)
(fma -1.0 (/ y (/ 1.0 (/ z t_1))) t_3)
(if (<= t_2 5e-163)
t_2
(if (<= t_2 INFINITY) (fma -1.0 (/ y (/ t_1 z)) t_3) (/ y a))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = t - (z * a);
double t_2 = (x - (y * z)) / t_1;
double t_3 = x / t_1;
double tmp;
if (t_2 <= -2e+56) {
tmp = fma(-1.0, (y / (1.0 / (z / t_1))), t_3);
} else if (t_2 <= 5e-163) {
tmp = t_2;
} else if (t_2 <= ((double) INFINITY)) {
tmp = fma(-1.0, (y / (t_1 / z)), t_3);
} else {
tmp = y / a;
}
return tmp;
}
function code(x, y, z, t, a) t_1 = Float64(t - Float64(z * a)) t_2 = Float64(Float64(x - Float64(y * z)) / t_1) t_3 = Float64(x / t_1) tmp = 0.0 if (t_2 <= -2e+56) tmp = fma(-1.0, Float64(y / Float64(1.0 / Float64(z / t_1))), t_3); elseif (t_2 <= 5e-163) tmp = t_2; elseif (t_2 <= Inf) tmp = fma(-1.0, Float64(y / Float64(t_1 / z)), t_3); 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[(N[(x - N[(y * z), $MachinePrecision]), $MachinePrecision] / t$95$1), $MachinePrecision]}, Block[{t$95$3 = N[(x / t$95$1), $MachinePrecision]}, If[LessEqual[t$95$2, -2e+56], N[(-1.0 * N[(y / N[(1.0 / N[(z / t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + t$95$3), $MachinePrecision], If[LessEqual[t$95$2, 5e-163], t$95$2, If[LessEqual[t$95$2, Infinity], N[(-1.0 * N[(y / N[(t$95$1 / z), $MachinePrecision]), $MachinePrecision] + t$95$3), $MachinePrecision], N[(y / a), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := t - z \cdot a\\
t_2 := \frac{x - y \cdot z}{t_1}\\
t_3 := \frac{x}{t_1}\\
\mathbf{if}\;t_2 \leq -2 \cdot 10^{+56}:\\
\;\;\;\;\mathsf{fma}\left(-1, \frac{y}{\frac{1}{\frac{z}{t_1}}}, t_3\right)\\
\mathbf{elif}\;t_2 \leq 5 \cdot 10^{-163}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;t_2 \leq \infty:\\
\;\;\;\;\mathsf{fma}\left(-1, \frac{y}{\frac{t_1}{z}}, t_3\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{y}{a}\\
\end{array}
\end{array}
if (/.f64 (-.f64 x (*.f64 y z)) (-.f64 t (*.f64 a z))) < -2.00000000000000018e56Initial program 90.9%
*-commutative90.9%
Simplified90.9%
Taylor expanded in x around 0 90.9%
fma-def90.9%
associate-/l*99.6%
*-commutative99.6%
*-commutative99.6%
Simplified99.6%
clear-num99.7%
inv-pow99.7%
Applied egg-rr99.7%
unpow-199.7%
*-commutative99.7%
Simplified99.7%
if -2.00000000000000018e56 < (/.f64 (-.f64 x (*.f64 y z)) (-.f64 t (*.f64 a z))) < 4.99999999999999977e-163Initial program 92.7%
if 4.99999999999999977e-163 < (/.f64 (-.f64 x (*.f64 y z)) (-.f64 t (*.f64 a z))) < +inf.0Initial program 92.1%
*-commutative92.1%
Simplified92.1%
Taylor expanded in x around 0 92.1%
fma-def92.1%
associate-/l*99.9%
*-commutative99.9%
*-commutative99.9%
Simplified99.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 simplification96.9%
(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 -1.6e+43)
t_2
(if (<= t_3 5e-163) t_3 (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 <= -1.6e+43) {
tmp = t_2;
} else if (t_3 <= 5e-163) {
tmp = t_3;
} 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 <= -1.6e+43) tmp = t_2; elseif (t_3 <= 5e-163) tmp = t_3; 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, -1.6e+43], t$95$2, If[LessEqual[t$95$3, 5e-163], t$95$3, 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 -1.6 \cdot 10^{+43}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;t_3 \leq 5 \cdot 10^{-163}:\\
\;\;\;\;t_3\\
\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))) < -1.60000000000000007e43 or 4.99999999999999977e-163 < (/.f64 (-.f64 x (*.f64 y z)) (-.f64 t (*.f64 a z))) < +inf.0Initial program 91.8%
*-commutative91.8%
Simplified91.8%
Taylor expanded in x around 0 91.8%
fma-def91.8%
associate-/l*99.8%
*-commutative99.8%
*-commutative99.8%
Simplified99.8%
if -1.60000000000000007e43 < (/.f64 (-.f64 x (*.f64 y z)) (-.f64 t (*.f64 a z))) < 4.99999999999999977e-163Initial program 92.6%
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 simplification96.9%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (- t (* z a))) (t_2 (/ (- x (* y z)) t_1)))
(if (<= t_2 4e+271)
(- (/ x t_1) (/ (* y z) t_1))
(if (<= t_2 INFINITY)
(fma -1.0 (/ y (/ 1.0 (/ z t_1))) (/ x t))
(/ y a)))))
double code(double x, double y, double z, double t, double a) {
double t_1 = t - (z * a);
double t_2 = (x - (y * z)) / t_1;
double tmp;
if (t_2 <= 4e+271) {
tmp = (x / t_1) - ((y * z) / t_1);
} else if (t_2 <= ((double) INFINITY)) {
tmp = fma(-1.0, (y / (1.0 / (z / t_1))), (x / t));
} else {
tmp = y / a;
}
return tmp;
}
function code(x, y, z, t, a) t_1 = Float64(t - Float64(z * a)) t_2 = Float64(Float64(x - Float64(y * z)) / t_1) tmp = 0.0 if (t_2 <= 4e+271) tmp = Float64(Float64(x / t_1) - Float64(Float64(y * z) / t_1)); elseif (t_2 <= Inf) tmp = fma(-1.0, Float64(y / Float64(1.0 / Float64(z / t_1))), Float64(x / t)); 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[(N[(x - N[(y * z), $MachinePrecision]), $MachinePrecision] / t$95$1), $MachinePrecision]}, If[LessEqual[t$95$2, 4e+271], N[(N[(x / t$95$1), $MachinePrecision] - N[(N[(y * z), $MachinePrecision] / t$95$1), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$2, Infinity], N[(-1.0 * N[(y / N[(1.0 / N[(z / t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(x / t), $MachinePrecision]), $MachinePrecision], N[(y / a), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := t - z \cdot a\\
t_2 := \frac{x - y \cdot z}{t_1}\\
\mathbf{if}\;t_2 \leq 4 \cdot 10^{+271}:\\
\;\;\;\;\frac{x}{t_1} - \frac{y \cdot z}{t_1}\\
\mathbf{elif}\;t_2 \leq \infty:\\
\;\;\;\;\mathsf{fma}\left(-1, \frac{y}{\frac{1}{\frac{z}{t_1}}}, \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))) < 3.99999999999999981e271Initial program 94.4%
*-commutative94.4%
Simplified94.4%
Taylor expanded in x around 0 94.4%
if 3.99999999999999981e271 < (/.f64 (-.f64 x (*.f64 y z)) (-.f64 t (*.f64 a z))) < +inf.0Initial program 63.9%
*-commutative63.9%
Simplified63.9%
Taylor expanded in x around 0 63.9%
fma-def63.9%
associate-/l*100.0%
*-commutative100.0%
*-commutative100.0%
Simplified100.0%
clear-num99.7%
inv-pow99.7%
Applied egg-rr99.7%
unpow-199.7%
*-commutative99.7%
Simplified99.7%
Taylor expanded in t around inf 89.0%
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 simplification94.3%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (/ (- y (/ x z)) a)))
(if (<= a -2.7e-15)
t_1
(if (<= a -1.3e-96)
(/ (- x (* y z)) t)
(if (<= a -1.2e-119)
t_1
(if (<= a 3.7e-8)
(- (/ x t) (/ z (/ t y)))
(if (<= a 1.85e+21)
(/ y a)
(if (<= a 2.15e+71) (/ x (- t (* z a))) t_1))))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = (y - (x / z)) / a;
double tmp;
if (a <= -2.7e-15) {
tmp = t_1;
} else if (a <= -1.3e-96) {
tmp = (x - (y * z)) / t;
} else if (a <= -1.2e-119) {
tmp = t_1;
} else if (a <= 3.7e-8) {
tmp = (x / t) - (z / (t / y));
} else if (a <= 1.85e+21) {
tmp = y / a;
} else if (a <= 2.15e+71) {
tmp = x / (t - (z * a));
} 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 (a <= (-2.7d-15)) then
tmp = t_1
else if (a <= (-1.3d-96)) then
tmp = (x - (y * z)) / t
else if (a <= (-1.2d-119)) then
tmp = t_1
else if (a <= 3.7d-8) then
tmp = (x / t) - (z / (t / y))
else if (a <= 1.85d+21) then
tmp = y / a
else if (a <= 2.15d+71) then
tmp = x / (t - (z * a))
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 (a <= -2.7e-15) {
tmp = t_1;
} else if (a <= -1.3e-96) {
tmp = (x - (y * z)) / t;
} else if (a <= -1.2e-119) {
tmp = t_1;
} else if (a <= 3.7e-8) {
tmp = (x / t) - (z / (t / y));
} else if (a <= 1.85e+21) {
tmp = y / a;
} else if (a <= 2.15e+71) {
tmp = x / (t - (z * a));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = (y - (x / z)) / a tmp = 0 if a <= -2.7e-15: tmp = t_1 elif a <= -1.3e-96: tmp = (x - (y * z)) / t elif a <= -1.2e-119: tmp = t_1 elif a <= 3.7e-8: tmp = (x / t) - (z / (t / y)) elif a <= 1.85e+21: tmp = y / a elif a <= 2.15e+71: tmp = x / (t - (z * a)) 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 (a <= -2.7e-15) tmp = t_1; elseif (a <= -1.3e-96) tmp = Float64(Float64(x - Float64(y * z)) / t); elseif (a <= -1.2e-119) tmp = t_1; elseif (a <= 3.7e-8) tmp = Float64(Float64(x / t) - Float64(z / Float64(t / y))); elseif (a <= 1.85e+21) tmp = Float64(y / a); elseif (a <= 2.15e+71) tmp = Float64(x / Float64(t - Float64(z * a))); 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 (a <= -2.7e-15) tmp = t_1; elseif (a <= -1.3e-96) tmp = (x - (y * z)) / t; elseif (a <= -1.2e-119) tmp = t_1; elseif (a <= 3.7e-8) tmp = (x / t) - (z / (t / y)); elseif (a <= 1.85e+21) tmp = y / a; elseif (a <= 2.15e+71) tmp = x / (t - (z * a)); 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[a, -2.7e-15], t$95$1, If[LessEqual[a, -1.3e-96], N[(N[(x - N[(y * z), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision], If[LessEqual[a, -1.2e-119], t$95$1, If[LessEqual[a, 3.7e-8], N[(N[(x / t), $MachinePrecision] - N[(z / N[(t / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 1.85e+21], N[(y / a), $MachinePrecision], If[LessEqual[a, 2.15e+71], N[(x / N[(t - N[(z * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{y - \frac{x}{z}}{a}\\
\mathbf{if}\;a \leq -2.7 \cdot 10^{-15}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;a \leq -1.3 \cdot 10^{-96}:\\
\;\;\;\;\frac{x - y \cdot z}{t}\\
\mathbf{elif}\;a \leq -1.2 \cdot 10^{-119}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;a \leq 3.7 \cdot 10^{-8}:\\
\;\;\;\;\frac{x}{t} - \frac{z}{\frac{t}{y}}\\
\mathbf{elif}\;a \leq 1.85 \cdot 10^{+21}:\\
\;\;\;\;\frac{y}{a}\\
\mathbf{elif}\;a \leq 2.15 \cdot 10^{+71}:\\
\;\;\;\;\frac{x}{t - z \cdot a}\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if a < -2.70000000000000009e-15 or -1.3000000000000001e-96 < a < -1.20000000000000004e-119 or 2.14999999999999992e71 < a Initial program 81.5%
*-commutative81.5%
Simplified81.5%
Taylor expanded in x around 0 81.5%
fma-def81.5%
associate-/l*81.9%
*-commutative81.9%
*-commutative81.9%
Simplified81.9%
Taylor expanded in a around inf 74.0%
mul-1-neg74.0%
sub-neg74.0%
Simplified74.0%
if -2.70000000000000009e-15 < a < -1.3000000000000001e-96Initial program 87.2%
*-commutative87.2%
Simplified87.2%
Taylor expanded in t around inf 68.0%
if -1.20000000000000004e-119 < a < 3.7e-8Initial program 94.5%
*-commutative94.5%
Simplified94.5%
Taylor expanded in x around 0 94.5%
fma-def94.5%
associate-/l*96.1%
*-commutative96.1%
*-commutative96.1%
Simplified96.1%
Taylor expanded in a around 0 77.4%
+-commutative77.4%
mul-1-neg77.4%
*-commutative77.4%
sub-neg77.4%
associate-/l*79.1%
Simplified79.1%
if 3.7e-8 < a < 1.85e21Initial program 69.1%
*-commutative69.1%
Simplified69.1%
Taylor expanded in z around inf 86.3%
if 1.85e21 < a < 2.14999999999999992e71Initial program 99.8%
*-commutative99.8%
Simplified99.8%
Taylor expanded in x around inf 88.1%
*-commutative88.1%
Simplified88.1%
Final simplification76.5%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (- t (* z a)))
(t_2 (* z (/ (- y) t_1)))
(t_3 (/ (- y (/ x z)) a)))
(if (<= a -4.3e+23)
t_3
(if (<= a -6e-36)
t_2
(if (<= a 1.7e-108)
(/ (- x (* y z)) t)
(if (<= a 5.4e+23) t_2 (if (<= a 7.4e+71) (/ x t_1) t_3)))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = t - (z * a);
double t_2 = z * (-y / t_1);
double t_3 = (y - (x / z)) / a;
double tmp;
if (a <= -4.3e+23) {
tmp = t_3;
} else if (a <= -6e-36) {
tmp = t_2;
} else if (a <= 1.7e-108) {
tmp = (x - (y * z)) / t;
} else if (a <= 5.4e+23) {
tmp = t_2;
} else if (a <= 7.4e+71) {
tmp = x / t_1;
} 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
real(8) :: t_1
real(8) :: t_2
real(8) :: t_3
real(8) :: tmp
t_1 = t - (z * a)
t_2 = z * (-y / t_1)
t_3 = (y - (x / z)) / a
if (a <= (-4.3d+23)) then
tmp = t_3
else if (a <= (-6d-36)) then
tmp = t_2
else if (a <= 1.7d-108) then
tmp = (x - (y * z)) / t
else if (a <= 5.4d+23) then
tmp = t_2
else if (a <= 7.4d+71) then
tmp = x / t_1
else
tmp = t_3
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double t_1 = t - (z * a);
double t_2 = z * (-y / t_1);
double t_3 = (y - (x / z)) / a;
double tmp;
if (a <= -4.3e+23) {
tmp = t_3;
} else if (a <= -6e-36) {
tmp = t_2;
} else if (a <= 1.7e-108) {
tmp = (x - (y * z)) / t;
} else if (a <= 5.4e+23) {
tmp = t_2;
} else if (a <= 7.4e+71) {
tmp = x / t_1;
} else {
tmp = t_3;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = t - (z * a) t_2 = z * (-y / t_1) t_3 = (y - (x / z)) / a tmp = 0 if a <= -4.3e+23: tmp = t_3 elif a <= -6e-36: tmp = t_2 elif a <= 1.7e-108: tmp = (x - (y * z)) / t elif a <= 5.4e+23: tmp = t_2 elif a <= 7.4e+71: tmp = x / t_1 else: tmp = t_3 return tmp
function code(x, y, z, t, a) t_1 = Float64(t - Float64(z * a)) t_2 = Float64(z * Float64(Float64(-y) / t_1)) t_3 = Float64(Float64(y - Float64(x / z)) / a) tmp = 0.0 if (a <= -4.3e+23) tmp = t_3; elseif (a <= -6e-36) tmp = t_2; elseif (a <= 1.7e-108) tmp = Float64(Float64(x - Float64(y * z)) / t); elseif (a <= 5.4e+23) tmp = t_2; elseif (a <= 7.4e+71) tmp = Float64(x / t_1); else tmp = t_3; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = t - (z * a); t_2 = z * (-y / t_1); t_3 = (y - (x / z)) / a; tmp = 0.0; if (a <= -4.3e+23) tmp = t_3; elseif (a <= -6e-36) tmp = t_2; elseif (a <= 1.7e-108) tmp = (x - (y * z)) / t; elseif (a <= 5.4e+23) tmp = t_2; elseif (a <= 7.4e+71) tmp = x / t_1; else tmp = t_3; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(t - N[(z * a), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(z * N[((-y) / t$95$1), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(N[(y - N[(x / z), $MachinePrecision]), $MachinePrecision] / a), $MachinePrecision]}, If[LessEqual[a, -4.3e+23], t$95$3, If[LessEqual[a, -6e-36], t$95$2, If[LessEqual[a, 1.7e-108], N[(N[(x - N[(y * z), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision], If[LessEqual[a, 5.4e+23], t$95$2, If[LessEqual[a, 7.4e+71], N[(x / t$95$1), $MachinePrecision], t$95$3]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := t - z \cdot a\\
t_2 := z \cdot \frac{-y}{t_1}\\
t_3 := \frac{y - \frac{x}{z}}{a}\\
\mathbf{if}\;a \leq -4.3 \cdot 10^{+23}:\\
\;\;\;\;t_3\\
\mathbf{elif}\;a \leq -6 \cdot 10^{-36}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;a \leq 1.7 \cdot 10^{-108}:\\
\;\;\;\;\frac{x - y \cdot z}{t}\\
\mathbf{elif}\;a \leq 5.4 \cdot 10^{+23}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;a \leq 7.4 \cdot 10^{+71}:\\
\;\;\;\;\frac{x}{t_1}\\
\mathbf{else}:\\
\;\;\;\;t_3\\
\end{array}
\end{array}
if a < -4.2999999999999999e23 or 7.4e71 < a Initial program 79.8%
*-commutative79.8%
Simplified79.8%
Taylor expanded in x around 0 79.8%
fma-def79.8%
associate-/l*79.4%
*-commutative79.4%
*-commutative79.4%
Simplified79.4%
Taylor expanded in a around inf 74.9%
mul-1-neg74.9%
sub-neg74.9%
Simplified74.9%
if -4.2999999999999999e23 < a < -6.0000000000000003e-36 or 1.70000000000000001e-108 < a < 5.3999999999999997e23Initial program 84.0%
*-commutative84.0%
Simplified84.0%
Taylor expanded in x around 0 75.6%
mul-1-neg75.6%
associate-/l*88.7%
associate-/r/86.3%
sub-neg86.3%
+-commutative86.3%
distribute-rgt-neg-in86.3%
fma-udef86.3%
distribute-rgt-neg-in86.3%
fma-udef86.3%
distribute-rgt-neg-in86.3%
+-commutative86.3%
sub-neg86.3%
*-commutative86.3%
Simplified86.3%
if -6.0000000000000003e-36 < a < 1.70000000000000001e-108Initial program 95.3%
*-commutative95.3%
Simplified95.3%
Taylor expanded in t around inf 77.9%
if 5.3999999999999997e23 < a < 7.4e71Initial program 99.8%
*-commutative99.8%
Simplified99.8%
Taylor expanded in x around inf 88.1%
*-commutative88.1%
Simplified88.1%
Final simplification78.1%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (- t (* z a))))
(if (<= (/ (- x (* y z)) t_1) INFINITY)
(- (/ x t_1) (/ (* y z) t_1))
(/ y a))))
double code(double x, double y, double z, double t, double a) {
double t_1 = t - (z * a);
double tmp;
if (((x - (y * z)) / t_1) <= ((double) INFINITY)) {
tmp = (x / t_1) - ((y * z) / 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 = t - (z * a);
double tmp;
if (((x - (y * z)) / t_1) <= Double.POSITIVE_INFINITY) {
tmp = (x / t_1) - ((y * z) / t_1);
} else {
tmp = y / a;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = t - (z * a) tmp = 0 if ((x - (y * z)) / t_1) <= math.inf: tmp = (x / t_1) - ((y * z) / t_1) else: tmp = y / a return tmp
function code(x, y, z, t, a) t_1 = Float64(t - Float64(z * a)) tmp = 0.0 if (Float64(Float64(x - Float64(y * z)) / t_1) <= Inf) tmp = Float64(Float64(x / t_1) - Float64(Float64(y * z) / t_1)); else tmp = Float64(y / a); end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = t - (z * a); tmp = 0.0; if (((x - (y * z)) / t_1) <= Inf) tmp = (x / t_1) - ((y * z) / t_1); else tmp = y / a; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(t - N[(z * a), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(N[(x - N[(y * z), $MachinePrecision]), $MachinePrecision] / t$95$1), $MachinePrecision], Infinity], N[(N[(x / t$95$1), $MachinePrecision] - N[(N[(y * z), $MachinePrecision] / t$95$1), $MachinePrecision]), $MachinePrecision], N[(y / a), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := t - z \cdot a\\
\mathbf{if}\;\frac{x - y \cdot z}{t_1} \leq \infty:\\
\;\;\;\;\frac{x}{t_1} - \frac{y \cdot z}{t_1}\\
\mathbf{else}:\\
\;\;\;\;\frac{y}{a}\\
\end{array}
\end{array}
if (/.f64 (-.f64 x (*.f64 y z)) (-.f64 t (*.f64 a z))) < +inf.0Initial program 92.1%
*-commutative92.1%
Simplified92.1%
Taylor expanded in x around 0 92.1%
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 simplification92.5%
(FPCore (x y z t a)
:precision binary64
(if (<= t -8.5e-101)
(/ (- x (* y z)) t)
(if (<= t 1.3e-191)
(/ (- (* y z) x) (* z a))
(if (<= t 1.05e-131)
(/ x (- t (* z a)))
(if (<= t 1.1e+116) (/ (- y (/ x z)) a) (- (/ x t) (/ z (/ t y))))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -8.5e-101) {
tmp = (x - (y * z)) / t;
} else if (t <= 1.3e-191) {
tmp = ((y * z) - x) / (z * a);
} else if (t <= 1.05e-131) {
tmp = x / (t - (z * a));
} else if (t <= 1.1e+116) {
tmp = (y - (x / z)) / a;
} else {
tmp = (x / t) - (z / (t / y));
}
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 (t <= (-8.5d-101)) then
tmp = (x - (y * z)) / t
else if (t <= 1.3d-191) then
tmp = ((y * z) - x) / (z * a)
else if (t <= 1.05d-131) then
tmp = x / (t - (z * a))
else if (t <= 1.1d+116) then
tmp = (y - (x / z)) / a
else
tmp = (x / t) - (z / (t / y))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -8.5e-101) {
tmp = (x - (y * z)) / t;
} else if (t <= 1.3e-191) {
tmp = ((y * z) - x) / (z * a);
} else if (t <= 1.05e-131) {
tmp = x / (t - (z * a));
} else if (t <= 1.1e+116) {
tmp = (y - (x / z)) / a;
} else {
tmp = (x / t) - (z / (t / y));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if t <= -8.5e-101: tmp = (x - (y * z)) / t elif t <= 1.3e-191: tmp = ((y * z) - x) / (z * a) elif t <= 1.05e-131: tmp = x / (t - (z * a)) elif t <= 1.1e+116: tmp = (y - (x / z)) / a else: tmp = (x / t) - (z / (t / y)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (t <= -8.5e-101) tmp = Float64(Float64(x - Float64(y * z)) / t); elseif (t <= 1.3e-191) tmp = Float64(Float64(Float64(y * z) - x) / Float64(z * a)); elseif (t <= 1.05e-131) tmp = Float64(x / Float64(t - Float64(z * a))); elseif (t <= 1.1e+116) tmp = Float64(Float64(y - Float64(x / z)) / a); else tmp = Float64(Float64(x / t) - Float64(z / Float64(t / y))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (t <= -8.5e-101) tmp = (x - (y * z)) / t; elseif (t <= 1.3e-191) tmp = ((y * z) - x) / (z * a); elseif (t <= 1.05e-131) tmp = x / (t - (z * a)); elseif (t <= 1.1e+116) tmp = (y - (x / z)) / a; else tmp = (x / t) - (z / (t / y)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, -8.5e-101], N[(N[(x - N[(y * z), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision], If[LessEqual[t, 1.3e-191], N[(N[(N[(y * z), $MachinePrecision] - x), $MachinePrecision] / N[(z * a), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 1.05e-131], N[(x / N[(t - N[(z * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 1.1e+116], N[(N[(y - N[(x / z), $MachinePrecision]), $MachinePrecision] / a), $MachinePrecision], N[(N[(x / t), $MachinePrecision] - N[(z / N[(t / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -8.5 \cdot 10^{-101}:\\
\;\;\;\;\frac{x - y \cdot z}{t}\\
\mathbf{elif}\;t \leq 1.3 \cdot 10^{-191}:\\
\;\;\;\;\frac{y \cdot z - x}{z \cdot a}\\
\mathbf{elif}\;t \leq 1.05 \cdot 10^{-131}:\\
\;\;\;\;\frac{x}{t - z \cdot a}\\
\mathbf{elif}\;t \leq 1.1 \cdot 10^{+116}:\\
\;\;\;\;\frac{y - \frac{x}{z}}{a}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{t} - \frac{z}{\frac{t}{y}}\\
\end{array}
\end{array}
if t < -8.49999999999999941e-101Initial program 83.2%
*-commutative83.2%
Simplified83.2%
Taylor expanded in t around inf 70.0%
if -8.49999999999999941e-101 < t < 1.29999999999999993e-191Initial program 99.6%
*-commutative99.6%
Simplified99.6%
Taylor expanded in t around 0 80.9%
associate-*r/80.9%
neg-mul-180.9%
sub-neg80.9%
distribute-rgt-neg-out80.9%
+-commutative80.9%
distribute-neg-in80.9%
distribute-rgt-neg-out80.9%
remove-double-neg80.9%
sub-neg80.9%
*-commutative80.9%
Simplified80.9%
if 1.29999999999999993e-191 < t < 1.04999999999999999e-131Initial program 92.6%
*-commutative92.6%
Simplified92.6%
Taylor expanded in x around inf 81.3%
*-commutative81.3%
Simplified81.3%
if 1.04999999999999999e-131 < t < 1.1e116Initial program 83.8%
*-commutative83.8%
Simplified83.8%
Taylor expanded in x around 0 83.8%
fma-def83.8%
associate-/l*89.2%
*-commutative89.2%
*-commutative89.2%
Simplified89.2%
Taylor expanded in a around inf 68.6%
mul-1-neg68.6%
sub-neg68.6%
Simplified68.6%
if 1.1e116 < t Initial program 81.1%
*-commutative81.1%
Simplified81.1%
Taylor expanded in x around 0 81.1%
fma-def81.1%
associate-/l*81.6%
*-commutative81.6%
*-commutative81.6%
Simplified81.6%
Taylor expanded in a around 0 68.4%
+-commutative68.4%
mul-1-neg68.4%
*-commutative68.4%
sub-neg68.4%
associate-/l*74.0%
Simplified74.0%
Final simplification73.8%
(FPCore (x y z t a)
:precision binary64
(if (<= a -1.25e-8)
(/ y a)
(if (<= a 5.7e-8)
(/ (- x (* y z)) t)
(if (or (<= a 2.85e+23) (not (<= a 2e+72)))
(/ y a)
(/ x (- t (* z a)))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= -1.25e-8) {
tmp = y / a;
} else if (a <= 5.7e-8) {
tmp = (x - (y * z)) / t;
} else if ((a <= 2.85e+23) || !(a <= 2e+72)) {
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 (a <= (-1.25d-8)) then
tmp = y / a
else if (a <= 5.7d-8) then
tmp = (x - (y * z)) / t
else if ((a <= 2.85d+23) .or. (.not. (a <= 2d+72))) 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 (a <= -1.25e-8) {
tmp = y / a;
} else if (a <= 5.7e-8) {
tmp = (x - (y * z)) / t;
} else if ((a <= 2.85e+23) || !(a <= 2e+72)) {
tmp = y / a;
} else {
tmp = x / (t - (z * a));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if a <= -1.25e-8: tmp = y / a elif a <= 5.7e-8: tmp = (x - (y * z)) / t elif (a <= 2.85e+23) or not (a <= 2e+72): tmp = y / a else: tmp = x / (t - (z * a)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (a <= -1.25e-8) tmp = Float64(y / a); elseif (a <= 5.7e-8) tmp = Float64(Float64(x - Float64(y * z)) / t); elseif ((a <= 2.85e+23) || !(a <= 2e+72)) 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 (a <= -1.25e-8) tmp = y / a; elseif (a <= 5.7e-8) tmp = (x - (y * z)) / t; elseif ((a <= 2.85e+23) || ~((a <= 2e+72))) tmp = y / a; else tmp = x / (t - (z * a)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[a, -1.25e-8], N[(y / a), $MachinePrecision], If[LessEqual[a, 5.7e-8], N[(N[(x - N[(y * z), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision], If[Or[LessEqual[a, 2.85e+23], N[Not[LessEqual[a, 2e+72]], $MachinePrecision]], N[(y / a), $MachinePrecision], N[(x / N[(t - N[(z * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -1.25 \cdot 10^{-8}:\\
\;\;\;\;\frac{y}{a}\\
\mathbf{elif}\;a \leq 5.7 \cdot 10^{-8}:\\
\;\;\;\;\frac{x - y \cdot z}{t}\\
\mathbf{elif}\;a \leq 2.85 \cdot 10^{+23} \lor \neg \left(a \leq 2 \cdot 10^{+72}\right):\\
\;\;\;\;\frac{y}{a}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{t - z \cdot a}\\
\end{array}
\end{array}
if a < -1.2499999999999999e-8 or 5.70000000000000009e-8 < a < 2.85e23 or 1.99999999999999989e72 < a Initial program 79.7%
*-commutative79.7%
Simplified79.7%
Taylor expanded in z around inf 59.5%
if -1.2499999999999999e-8 < a < 5.70000000000000009e-8Initial program 93.9%
*-commutative93.9%
Simplified93.9%
Taylor expanded in t around inf 74.0%
if 2.85e23 < a < 1.99999999999999989e72Initial program 99.8%
*-commutative99.8%
Simplified99.8%
Taylor expanded in x around inf 88.1%
*-commutative88.1%
Simplified88.1%
Final simplification67.7%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (/ x (- t (* z a)))))
(if (<= x -0.0026)
t_1
(if (<= x -4.2e-175)
(/ y a)
(if (<= x -3.35e-299)
(/ (* y (- z)) t)
(if (<= x 5.5e-44) (/ y a) t_1))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = x / (t - (z * a));
double tmp;
if (x <= -0.0026) {
tmp = t_1;
} else if (x <= -4.2e-175) {
tmp = y / a;
} else if (x <= -3.35e-299) {
tmp = (y * -z) / t;
} else if (x <= 5.5e-44) {
tmp = y / a;
} 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 = x / (t - (z * a))
if (x <= (-0.0026d0)) then
tmp = t_1
else if (x <= (-4.2d-175)) then
tmp = y / a
else if (x <= (-3.35d-299)) then
tmp = (y * -z) / t
else if (x <= 5.5d-44) then
tmp = y / a
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 = x / (t - (z * a));
double tmp;
if (x <= -0.0026) {
tmp = t_1;
} else if (x <= -4.2e-175) {
tmp = y / a;
} else if (x <= -3.35e-299) {
tmp = (y * -z) / t;
} else if (x <= 5.5e-44) {
tmp = y / a;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = x / (t - (z * a)) tmp = 0 if x <= -0.0026: tmp = t_1 elif x <= -4.2e-175: tmp = y / a elif x <= -3.35e-299: tmp = (y * -z) / t elif x <= 5.5e-44: tmp = y / a else: tmp = t_1 return tmp
function code(x, y, z, t, a) t_1 = Float64(x / Float64(t - Float64(z * a))) tmp = 0.0 if (x <= -0.0026) tmp = t_1; elseif (x <= -4.2e-175) tmp = Float64(y / a); elseif (x <= -3.35e-299) tmp = Float64(Float64(y * Float64(-z)) / t); elseif (x <= 5.5e-44) tmp = Float64(y / a); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = x / (t - (z * a)); tmp = 0.0; if (x <= -0.0026) tmp = t_1; elseif (x <= -4.2e-175) tmp = y / a; elseif (x <= -3.35e-299) tmp = (y * -z) / t; elseif (x <= 5.5e-44) tmp = y / a; else tmp = t_1; 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]}, If[LessEqual[x, -0.0026], t$95$1, If[LessEqual[x, -4.2e-175], N[(y / a), $MachinePrecision], If[LessEqual[x, -3.35e-299], N[(N[(y * (-z)), $MachinePrecision] / t), $MachinePrecision], If[LessEqual[x, 5.5e-44], N[(y / a), $MachinePrecision], t$95$1]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{x}{t - z \cdot a}\\
\mathbf{if}\;x \leq -0.0026:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \leq -4.2 \cdot 10^{-175}:\\
\;\;\;\;\frac{y}{a}\\
\mathbf{elif}\;x \leq -3.35 \cdot 10^{-299}:\\
\;\;\;\;\frac{y \cdot \left(-z\right)}{t}\\
\mathbf{elif}\;x \leq 5.5 \cdot 10^{-44}:\\
\;\;\;\;\frac{y}{a}\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if x < -0.0025999999999999999 or 5.49999999999999993e-44 < x Initial program 86.7%
*-commutative86.7%
Simplified86.7%
Taylor expanded in x around inf 67.1%
*-commutative67.1%
Simplified67.1%
if -0.0025999999999999999 < x < -4.2e-175 or -3.34999999999999999e-299 < x < 5.49999999999999993e-44Initial program 86.1%
*-commutative86.1%
Simplified86.1%
Taylor expanded in z around inf 57.3%
if -4.2e-175 < x < -3.34999999999999999e-299Initial program 95.9%
*-commutative95.9%
Simplified95.9%
Taylor expanded in t around inf 69.5%
Taylor expanded in x around 0 69.6%
mul-1-neg69.6%
*-commutative69.6%
distribute-rgt-neg-in69.6%
Simplified69.6%
Final simplification63.3%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (/ (- y (/ x z)) a)))
(if (<= a -3.3e-15)
t_1
(if (<= a 2.7e-8)
(/ (- x (* y z)) t)
(if (<= a 7.2e+20)
(/ y a)
(if (<= a 5.6e+72) (/ x (- t (* z a))) t_1))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = (y - (x / z)) / a;
double tmp;
if (a <= -3.3e-15) {
tmp = t_1;
} else if (a <= 2.7e-8) {
tmp = (x - (y * z)) / t;
} else if (a <= 7.2e+20) {
tmp = y / a;
} else if (a <= 5.6e+72) {
tmp = x / (t - (z * a));
} 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 (a <= (-3.3d-15)) then
tmp = t_1
else if (a <= 2.7d-8) then
tmp = (x - (y * z)) / t
else if (a <= 7.2d+20) then
tmp = y / a
else if (a <= 5.6d+72) then
tmp = x / (t - (z * a))
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 (a <= -3.3e-15) {
tmp = t_1;
} else if (a <= 2.7e-8) {
tmp = (x - (y * z)) / t;
} else if (a <= 7.2e+20) {
tmp = y / a;
} else if (a <= 5.6e+72) {
tmp = x / (t - (z * a));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = (y - (x / z)) / a tmp = 0 if a <= -3.3e-15: tmp = t_1 elif a <= 2.7e-8: tmp = (x - (y * z)) / t elif a <= 7.2e+20: tmp = y / a elif a <= 5.6e+72: tmp = x / (t - (z * a)) 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 (a <= -3.3e-15) tmp = t_1; elseif (a <= 2.7e-8) tmp = Float64(Float64(x - Float64(y * z)) / t); elseif (a <= 7.2e+20) tmp = Float64(y / a); elseif (a <= 5.6e+72) tmp = Float64(x / Float64(t - Float64(z * a))); 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 (a <= -3.3e-15) tmp = t_1; elseif (a <= 2.7e-8) tmp = (x - (y * z)) / t; elseif (a <= 7.2e+20) tmp = y / a; elseif (a <= 5.6e+72) tmp = x / (t - (z * a)); 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[a, -3.3e-15], t$95$1, If[LessEqual[a, 2.7e-8], N[(N[(x - N[(y * z), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision], If[LessEqual[a, 7.2e+20], N[(y / a), $MachinePrecision], If[LessEqual[a, 5.6e+72], N[(x / N[(t - N[(z * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{y - \frac{x}{z}}{a}\\
\mathbf{if}\;a \leq -3.3 \cdot 10^{-15}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;a \leq 2.7 \cdot 10^{-8}:\\
\;\;\;\;\frac{x - y \cdot z}{t}\\
\mathbf{elif}\;a \leq 7.2 \cdot 10^{+20}:\\
\;\;\;\;\frac{y}{a}\\
\mathbf{elif}\;a \leq 5.6 \cdot 10^{+72}:\\
\;\;\;\;\frac{x}{t - z \cdot a}\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if a < -3.3e-15 or 5.5999999999999998e72 < a Initial program 80.2%
*-commutative80.2%
Simplified80.2%
Taylor expanded in x around 0 80.2%
fma-def80.2%
associate-/l*80.7%
*-commutative80.7%
*-commutative80.7%
Simplified80.7%
Taylor expanded in a around inf 74.0%
mul-1-neg74.0%
sub-neg74.0%
Simplified74.0%
if -3.3e-15 < a < 2.70000000000000002e-8Initial program 93.9%
*-commutative93.9%
Simplified93.9%
Taylor expanded in t around inf 74.0%
if 2.70000000000000002e-8 < a < 7.2e20Initial program 69.1%
*-commutative69.1%
Simplified69.1%
Taylor expanded in z around inf 86.3%
if 7.2e20 < a < 5.5999999999999998e72Initial program 99.8%
*-commutative99.8%
Simplified99.8%
Taylor expanded in x around inf 88.1%
*-commutative88.1%
Simplified88.1%
Final simplification74.7%
(FPCore (x y z t a) :precision binary64 (let* ((t_1 (/ (- x (* y z)) (- t (* 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 <= ((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 <= 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 <= 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 <= 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 <= 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, 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 \infty:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;\frac{y}{a}\\
\end{array}
\end{array}
if (/.f64 (-.f64 x (*.f64 y z)) (-.f64 t (*.f64 a z))) < +inf.0Initial program 92.1%
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 simplification92.5%
(FPCore (x y z t a)
:precision binary64
(if (<= z -7.6e+73)
(/ y a)
(if (<= z -6.2e-9)
(* y (/ (- z) t))
(if (or (<= z -8.2e-50) (not (<= z 2.7e-68))) (/ y a) (/ x t)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -7.6e+73) {
tmp = y / a;
} else if (z <= -6.2e-9) {
tmp = y * (-z / t);
} else if ((z <= -8.2e-50) || !(z <= 2.7e-68)) {
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 <= (-7.6d+73)) then
tmp = y / a
else if (z <= (-6.2d-9)) then
tmp = y * (-z / t)
else if ((z <= (-8.2d-50)) .or. (.not. (z <= 2.7d-68))) 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 <= -7.6e+73) {
tmp = y / a;
} else if (z <= -6.2e-9) {
tmp = y * (-z / t);
} else if ((z <= -8.2e-50) || !(z <= 2.7e-68)) {
tmp = y / a;
} else {
tmp = x / t;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -7.6e+73: tmp = y / a elif z <= -6.2e-9: tmp = y * (-z / t) elif (z <= -8.2e-50) or not (z <= 2.7e-68): tmp = y / a else: tmp = x / t return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -7.6e+73) tmp = Float64(y / a); elseif (z <= -6.2e-9) tmp = Float64(y * Float64(Float64(-z) / t)); elseif ((z <= -8.2e-50) || !(z <= 2.7e-68)) 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 <= -7.6e+73) tmp = y / a; elseif (z <= -6.2e-9) tmp = y * (-z / t); elseif ((z <= -8.2e-50) || ~((z <= 2.7e-68))) tmp = y / a; else tmp = x / t; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -7.6e+73], N[(y / a), $MachinePrecision], If[LessEqual[z, -6.2e-9], N[(y * N[((-z) / t), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[z, -8.2e-50], N[Not[LessEqual[z, 2.7e-68]], $MachinePrecision]], N[(y / a), $MachinePrecision], N[(x / t), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -7.6 \cdot 10^{+73}:\\
\;\;\;\;\frac{y}{a}\\
\mathbf{elif}\;z \leq -6.2 \cdot 10^{-9}:\\
\;\;\;\;y \cdot \frac{-z}{t}\\
\mathbf{elif}\;z \leq -8.2 \cdot 10^{-50} \lor \neg \left(z \leq 2.7 \cdot 10^{-68}\right):\\
\;\;\;\;\frac{y}{a}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{t}\\
\end{array}
\end{array}
if z < -7.60000000000000044e73 or -6.2000000000000001e-9 < z < -8.19999999999999971e-50 or 2.7000000000000002e-68 < z Initial program 78.7%
*-commutative78.7%
Simplified78.7%
Taylor expanded in z around inf 56.4%
if -7.60000000000000044e73 < z < -6.2000000000000001e-9Initial program 79.6%
*-commutative79.6%
Simplified79.6%
Taylor expanded in t around inf 58.5%
Taylor expanded in x around 0 38.7%
mul-1-neg38.7%
associate-/l*56.2%
distribute-neg-frac56.2%
Simplified56.2%
Taylor expanded in y around 0 38.7%
mul-1-neg38.7%
associate-*r/56.3%
distribute-rgt-neg-in56.3%
distribute-neg-frac56.3%
Simplified56.3%
if -8.19999999999999971e-50 < z < 2.7000000000000002e-68Initial program 99.8%
*-commutative99.8%
Simplified99.8%
Taylor expanded in z around 0 57.9%
Final simplification57.0%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -1.4e-49) (not (<= z 1.6e-68))) (/ y a) (/ x t)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -1.4e-49) || !(z <= 1.6e-68)) {
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 <= (-1.4d-49)) .or. (.not. (z <= 1.6d-68))) 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 <= -1.4e-49) || !(z <= 1.6e-68)) {
tmp = y / a;
} else {
tmp = x / t;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -1.4e-49) or not (z <= 1.6e-68): tmp = y / a else: tmp = x / t return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -1.4e-49) || !(z <= 1.6e-68)) 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 <= -1.4e-49) || ~((z <= 1.6e-68))) tmp = y / a; else tmp = x / t; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -1.4e-49], N[Not[LessEqual[z, 1.6e-68]], $MachinePrecision]], N[(y / a), $MachinePrecision], N[(x / t), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.4 \cdot 10^{-49} \lor \neg \left(z \leq 1.6 \cdot 10^{-68}\right):\\
\;\;\;\;\frac{y}{a}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{t}\\
\end{array}
\end{array}
if z < -1.39999999999999999e-49 or 1.5999999999999999e-68 < z Initial program 78.8%
*-commutative78.8%
Simplified78.8%
Taylor expanded in z around inf 52.7%
if -1.39999999999999999e-49 < z < 1.5999999999999999e-68Initial program 99.8%
*-commutative99.8%
Simplified99.8%
Taylor expanded in z around 0 57.9%
Final simplification54.8%
(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.4%
*-commutative87.4%
Simplified87.4%
Taylor expanded in z around 0 30.8%
Final simplification30.8%
(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 2024021
(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))))