
(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 (- (pow (/ (cbrt x) (cbrt t_2)) 3.0) (* y (/ z t_2))))
(t_4 (/ t_1 t_2)))
(if (<= t_4 -2e+170)
t_3
(if (<= t_4 4e+219)
(pow (- (/ t t_1) (/ a (/ t_1 z))) -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 = pow((cbrt(x) / cbrt(t_2)), 3.0) - (y * (z / t_2));
double t_4 = t_1 / t_2;
double tmp;
if (t_4 <= -2e+170) {
tmp = t_3;
} else if (t_4 <= 4e+219) {
tmp = pow(((t / t_1) - (a / (t_1 / z))), -1.0);
} else if (t_4 <= ((double) INFINITY)) {
tmp = t_3;
} 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);
double t_2 = t - (z * a);
double t_3 = Math.pow((Math.cbrt(x) / Math.cbrt(t_2)), 3.0) - (y * (z / t_2));
double t_4 = t_1 / t_2;
double tmp;
if (t_4 <= -2e+170) {
tmp = t_3;
} else if (t_4 <= 4e+219) {
tmp = Math.pow(((t / t_1) - (a / (t_1 / z))), -1.0);
} else if (t_4 <= Double.POSITIVE_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 = Float64((Float64(cbrt(x) / cbrt(t_2)) ^ 3.0) - Float64(y * Float64(z / t_2))) t_4 = Float64(t_1 / t_2) tmp = 0.0 if (t_4 <= -2e+170) tmp = t_3; elseif (t_4 <= 4e+219) tmp = Float64(Float64(t / t_1) - Float64(a / Float64(t_1 / z))) ^ -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[(N[Power[N[(N[Power[x, 1/3], $MachinePrecision] / N[Power[t$95$2, 1/3], $MachinePrecision]), $MachinePrecision], 3.0], $MachinePrecision] - N[(y * N[(z / t$95$2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$4 = N[(t$95$1 / t$95$2), $MachinePrecision]}, If[LessEqual[t$95$4, -2e+170], t$95$3, If[LessEqual[t$95$4, 4e+219], N[Power[N[(N[(t / t$95$1), $MachinePrecision] - N[(a / N[(t$95$1 / z), $MachinePrecision]), $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 := {\left(\frac{\sqrt[3]{x}}{\sqrt[3]{t_2}}\right)}^{3} - y \cdot \frac{z}{t_2}\\
t_4 := \frac{t_1}{t_2}\\
\mathbf{if}\;t_4 \leq -2 \cdot 10^{+170}:\\
\;\;\;\;t_3\\
\mathbf{elif}\;t_4 \leq 4 \cdot 10^{+219}:\\
\;\;\;\;{\left(\frac{t}{t_1} - \frac{a}{\frac{t_1}{z}}\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))) < -2.00000000000000007e170 or 3.99999999999999986e219 < (/.f64 (-.f64 x (*.f64 y z)) (-.f64 t (*.f64 a z))) < +inf.0Initial program 74.9%
*-commutative74.9%
Simplified74.9%
div-sub74.9%
sub-neg74.9%
add-cube-cbrt74.3%
add-cube-cbrt74.3%
times-frac74.3%
fma-def74.3%
Applied egg-rr99.2%
fma-neg99.2%
*-commutative99.2%
Simplified99.1%
if -2.00000000000000007e170 < (/.f64 (-.f64 x (*.f64 y z)) (-.f64 t (*.f64 a z))) < 3.99999999999999986e219Initial program 89.3%
*-commutative89.3%
Simplified89.3%
clear-num89.2%
inv-pow89.2%
sub-neg89.2%
+-commutative89.2%
*-commutative89.2%
distribute-rgt-neg-in89.2%
fma-def89.2%
Applied egg-rr89.2%
Taylor expanded in a around 0 89.2%
+-commutative89.2%
mul-1-neg89.2%
unsub-neg89.2%
associate-/l*99.6%
Simplified99.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 simplification99.5%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (- t (* z a))) (t_2 (/ (- x (* y z)) t_1)))
(if (<= t_2 (- INFINITY))
(/ (- y) (/ t_1 z))
(if (<= t_2 -2e-304)
t_2
(if (<= t_2 0.0)
(+ (/ y a) (/ (- (* y (/ t (pow a 2.0))) (/ x a)) z))
(if (<= t_2 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 = (x - (y * z)) / t_1;
double tmp;
if (t_2 <= -((double) INFINITY)) {
tmp = -y / (t_1 / z);
} else if (t_2 <= -2e-304) {
tmp = t_2;
} else if (t_2 <= 0.0) {
tmp = (y / a) + (((y * (t / pow(a, 2.0))) - (x / a)) / z);
} else if (t_2 <= ((double) INFINITY)) {
tmp = t_2;
} 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 t_2 = (x - (y * z)) / t_1;
double tmp;
if (t_2 <= -Double.POSITIVE_INFINITY) {
tmp = -y / (t_1 / z);
} else if (t_2 <= -2e-304) {
tmp = t_2;
} else if (t_2 <= 0.0) {
tmp = (y / a) + (((y * (t / Math.pow(a, 2.0))) - (x / a)) / z);
} else if (t_2 <= Double.POSITIVE_INFINITY) {
tmp = t_2;
} else {
tmp = y / a;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = t - (z * a) t_2 = (x - (y * z)) / t_1 tmp = 0 if t_2 <= -math.inf: tmp = -y / (t_1 / z) elif t_2 <= -2e-304: tmp = t_2 elif t_2 <= 0.0: tmp = (y / a) + (((y * (t / math.pow(a, 2.0))) - (x / a)) / z) elif t_2 <= math.inf: 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 = Float64(Float64(x - Float64(y * z)) / t_1) tmp = 0.0 if (t_2 <= Float64(-Inf)) tmp = Float64(Float64(-y) / Float64(t_1 / z)); elseif (t_2 <= -2e-304) tmp = t_2; elseif (t_2 <= 0.0) tmp = Float64(Float64(y / a) + Float64(Float64(Float64(y * Float64(t / (a ^ 2.0))) - Float64(x / a)) / z)); elseif (t_2 <= Inf) tmp = t_2; else tmp = Float64(y / a); end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = t - (z * a); t_2 = (x - (y * z)) / t_1; tmp = 0.0; if (t_2 <= -Inf) tmp = -y / (t_1 / z); elseif (t_2 <= -2e-304) tmp = t_2; elseif (t_2 <= 0.0) tmp = (y / a) + (((y * (t / (a ^ 2.0))) - (x / a)) / z); elseif (t_2 <= Inf) tmp = t_2; 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]}, Block[{t$95$2 = N[(N[(x - N[(y * z), $MachinePrecision]), $MachinePrecision] / t$95$1), $MachinePrecision]}, If[LessEqual[t$95$2, (-Infinity)], N[((-y) / N[(t$95$1 / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$2, -2e-304], t$95$2, If[LessEqual[t$95$2, 0.0], N[(N[(y / a), $MachinePrecision] + N[(N[(N[(y * N[(t / N[Power[a, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(x / a), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$2, Infinity], t$95$2, 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 -\infty:\\
\;\;\;\;\frac{-y}{\frac{t_1}{z}}\\
\mathbf{elif}\;t_2 \leq -2 \cdot 10^{-304}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;t_2 \leq 0:\\
\;\;\;\;\frac{y}{a} + \frac{y \cdot \frac{t}{{a}^{2}} - \frac{x}{a}}{z}\\
\mathbf{elif}\;t_2 \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))) < -inf.0Initial program 46.3%
*-commutative46.3%
Simplified46.3%
Taylor expanded in x around 0 23.2%
mul-1-neg23.2%
associate-/l*76.8%
*-commutative76.8%
Simplified76.8%
if -inf.0 < (/.f64 (-.f64 x (*.f64 y z)) (-.f64 t (*.f64 a z))) < -1.99999999999999994e-304 or 0.0 < (/.f64 (-.f64 x (*.f64 y z)) (-.f64 t (*.f64 a z))) < +inf.0Initial program 97.7%
if -1.99999999999999994e-304 < (/.f64 (-.f64 x (*.f64 y z)) (-.f64 t (*.f64 a z))) < 0.0Initial program 41.4%
*-commutative41.4%
Simplified41.4%
Taylor expanded in z around inf 51.3%
+-commutative51.3%
associate--l+51.3%
associate-/r*87.8%
associate-*r/87.8%
associate-/r*87.8%
associate-*r/87.8%
div-sub87.8%
distribute-lft-out--87.8%
associate-*r/87.8%
mul-1-neg87.8%
unsub-neg87.8%
Simplified90.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 simplification95.3%
(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 (- INFINITY))
(/ (- y) (/ t_2 z))
(if (<= t_3 INFINITY) (pow (- (/ t t_1) (/ a (/ t_1 z))) -1.0) (/ 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 <= -((double) INFINITY)) {
tmp = -y / (t_2 / z);
} else if (t_3 <= ((double) INFINITY)) {
tmp = pow(((t / t_1) - (a / (t_1 / z))), -1.0);
} 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);
double t_2 = t - (z * a);
double t_3 = t_1 / t_2;
double tmp;
if (t_3 <= -Double.POSITIVE_INFINITY) {
tmp = -y / (t_2 / z);
} else if (t_3 <= Double.POSITIVE_INFINITY) {
tmp = Math.pow(((t / t_1) - (a / (t_1 / z))), -1.0);
} else {
tmp = y / a;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = x - (y * z) t_2 = t - (z * a) t_3 = t_1 / t_2 tmp = 0 if t_3 <= -math.inf: tmp = -y / (t_2 / z) elif t_3 <= math.inf: tmp = math.pow(((t / t_1) - (a / (t_1 / z))), -1.0) 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 <= Float64(-Inf)) tmp = Float64(Float64(-y) / Float64(t_2 / z)); elseif (t_3 <= Inf) tmp = Float64(Float64(t / t_1) - Float64(a / Float64(t_1 / z))) ^ -1.0; else tmp = Float64(y / a); end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = x - (y * z); t_2 = t - (z * a); t_3 = t_1 / t_2; tmp = 0.0; if (t_3 <= -Inf) tmp = -y / (t_2 / z); elseif (t_3 <= Inf) tmp = ((t / t_1) - (a / (t_1 / z))) ^ -1.0; else tmp = y / a; end tmp_2 = 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, (-Infinity)], N[((-y) / N[(t$95$2 / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$3, Infinity], N[Power[N[(N[(t / t$95$1), $MachinePrecision] - N[(a / N[(t$95$1 / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], -1.0], $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 -\infty:\\
\;\;\;\;\frac{-y}{\frac{t_2}{z}}\\
\mathbf{elif}\;t_3 \leq \infty:\\
\;\;\;\;{\left(\frac{t}{t_1} - \frac{a}{\frac{t_1}{z}}\right)}^{-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 46.3%
*-commutative46.3%
Simplified46.3%
Taylor expanded in x around 0 23.2%
mul-1-neg23.2%
associate-/l*76.8%
*-commutative76.8%
Simplified76.8%
if -inf.0 < (/.f64 (-.f64 x (*.f64 y z)) (-.f64 t (*.f64 a z))) < +inf.0Initial program 89.5%
*-commutative89.5%
Simplified89.5%
clear-num89.3%
inv-pow89.3%
sub-neg89.3%
+-commutative89.3%
*-commutative89.3%
distribute-rgt-neg-in89.3%
fma-def89.3%
Applied egg-rr89.3%
Taylor expanded in a around 0 89.3%
+-commutative89.3%
mul-1-neg89.3%
unsub-neg89.3%
associate-/l*96.6%
Simplified96.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 simplification95.2%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (- t (* z a))) (t_2 (/ (- x (* y z)) t_1)))
(if (<= t_2 (- INFINITY))
(/ (- y) (/ t_1 z))
(if (<= t_2 -2e-304)
t_2
(if (<= t_2 0.0)
(/ (- y (/ x z)) a)
(if (<= t_2 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 = (x - (y * z)) / t_1;
double tmp;
if (t_2 <= -((double) INFINITY)) {
tmp = -y / (t_1 / z);
} else if (t_2 <= -2e-304) {
tmp = t_2;
} else if (t_2 <= 0.0) {
tmp = (y - (x / z)) / a;
} else if (t_2 <= ((double) INFINITY)) {
tmp = t_2;
} 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 t_2 = (x - (y * z)) / t_1;
double tmp;
if (t_2 <= -Double.POSITIVE_INFINITY) {
tmp = -y / (t_1 / z);
} else if (t_2 <= -2e-304) {
tmp = t_2;
} else if (t_2 <= 0.0) {
tmp = (y - (x / z)) / a;
} else if (t_2 <= Double.POSITIVE_INFINITY) {
tmp = t_2;
} else {
tmp = y / a;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = t - (z * a) t_2 = (x - (y * z)) / t_1 tmp = 0 if t_2 <= -math.inf: tmp = -y / (t_1 / z) elif t_2 <= -2e-304: tmp = t_2 elif t_2 <= 0.0: tmp = (y - (x / z)) / a elif t_2 <= math.inf: 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 = Float64(Float64(x - Float64(y * z)) / t_1) tmp = 0.0 if (t_2 <= Float64(-Inf)) tmp = Float64(Float64(-y) / Float64(t_1 / z)); elseif (t_2 <= -2e-304) tmp = t_2; elseif (t_2 <= 0.0) tmp = Float64(Float64(y - Float64(x / z)) / a); elseif (t_2 <= Inf) tmp = t_2; else tmp = Float64(y / a); end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = t - (z * a); t_2 = (x - (y * z)) / t_1; tmp = 0.0; if (t_2 <= -Inf) tmp = -y / (t_1 / z); elseif (t_2 <= -2e-304) tmp = t_2; elseif (t_2 <= 0.0) tmp = (y - (x / z)) / a; elseif (t_2 <= Inf) tmp = t_2; 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]}, Block[{t$95$2 = N[(N[(x - N[(y * z), $MachinePrecision]), $MachinePrecision] / t$95$1), $MachinePrecision]}, If[LessEqual[t$95$2, (-Infinity)], N[((-y) / N[(t$95$1 / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$2, -2e-304], t$95$2, If[LessEqual[t$95$2, 0.0], N[(N[(y - N[(x / z), $MachinePrecision]), $MachinePrecision] / a), $MachinePrecision], If[LessEqual[t$95$2, Infinity], t$95$2, 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 -\infty:\\
\;\;\;\;\frac{-y}{\frac{t_1}{z}}\\
\mathbf{elif}\;t_2 \leq -2 \cdot 10^{-304}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;t_2 \leq 0:\\
\;\;\;\;\frac{y - \frac{x}{z}}{a}\\
\mathbf{elif}\;t_2 \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))) < -inf.0Initial program 46.3%
*-commutative46.3%
Simplified46.3%
Taylor expanded in x around 0 23.2%
mul-1-neg23.2%
associate-/l*76.8%
*-commutative76.8%
Simplified76.8%
if -inf.0 < (/.f64 (-.f64 x (*.f64 y z)) (-.f64 t (*.f64 a z))) < -1.99999999999999994e-304 or 0.0 < (/.f64 (-.f64 x (*.f64 y z)) (-.f64 t (*.f64 a z))) < +inf.0Initial program 97.7%
if -1.99999999999999994e-304 < (/.f64 (-.f64 x (*.f64 y z)) (-.f64 t (*.f64 a z))) < 0.0Initial program 41.4%
*-commutative41.4%
Simplified41.4%
clear-num41.4%
associate-/r/41.4%
sub-neg41.4%
+-commutative41.4%
*-commutative41.4%
distribute-rgt-neg-in41.4%
fma-def41.4%
Applied egg-rr41.4%
Taylor expanded in z around -inf 87.8%
+-commutative87.8%
mul-1-neg87.8%
unsub-neg87.8%
associate-/l*90.9%
Simplified90.9%
Taylor expanded in a around inf 88.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.9%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (/ (- y (/ x z)) a)) (t_2 (- t (* z a))))
(if (<= z -1.6e-53)
t_1
(if (<= z 2.1e-124)
(/ (- x (* y z)) t)
(if (<= z 246000.0)
(/ x t_2)
(if (<= z 1.1e+40) (/ (- y) (/ t_2 z)) t_1))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = (y - (x / z)) / a;
double t_2 = t - (z * a);
double tmp;
if (z <= -1.6e-53) {
tmp = t_1;
} else if (z <= 2.1e-124) {
tmp = (x - (y * z)) / t;
} else if (z <= 246000.0) {
tmp = x / t_2;
} else if (z <= 1.1e+40) {
tmp = -y / (t_2 / z);
} 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) :: t_2
real(8) :: tmp
t_1 = (y - (x / z)) / a
t_2 = t - (z * a)
if (z <= (-1.6d-53)) then
tmp = t_1
else if (z <= 2.1d-124) then
tmp = (x - (y * z)) / t
else if (z <= 246000.0d0) then
tmp = x / t_2
else if (z <= 1.1d+40) then
tmp = -y / (t_2 / z)
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 t_2 = t - (z * a);
double tmp;
if (z <= -1.6e-53) {
tmp = t_1;
} else if (z <= 2.1e-124) {
tmp = (x - (y * z)) / t;
} else if (z <= 246000.0) {
tmp = x / t_2;
} else if (z <= 1.1e+40) {
tmp = -y / (t_2 / z);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = (y - (x / z)) / a t_2 = t - (z * a) tmp = 0 if z <= -1.6e-53: tmp = t_1 elif z <= 2.1e-124: tmp = (x - (y * z)) / t elif z <= 246000.0: tmp = x / t_2 elif z <= 1.1e+40: tmp = -y / (t_2 / z) else: tmp = t_1 return tmp
function code(x, y, z, t, a) t_1 = Float64(Float64(y - Float64(x / z)) / a) t_2 = Float64(t - Float64(z * a)) tmp = 0.0 if (z <= -1.6e-53) tmp = t_1; elseif (z <= 2.1e-124) tmp = Float64(Float64(x - Float64(y * z)) / t); elseif (z <= 246000.0) tmp = Float64(x / t_2); elseif (z <= 1.1e+40) tmp = Float64(Float64(-y) / Float64(t_2 / z)); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = (y - (x / z)) / a; t_2 = t - (z * a); tmp = 0.0; if (z <= -1.6e-53) tmp = t_1; elseif (z <= 2.1e-124) tmp = (x - (y * z)) / t; elseif (z <= 246000.0) tmp = x / t_2; elseif (z <= 1.1e+40) tmp = -y / (t_2 / z); 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]}, Block[{t$95$2 = N[(t - N[(z * a), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -1.6e-53], t$95$1, If[LessEqual[z, 2.1e-124], N[(N[(x - N[(y * z), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision], If[LessEqual[z, 246000.0], N[(x / t$95$2), $MachinePrecision], If[LessEqual[z, 1.1e+40], N[((-y) / N[(t$95$2 / z), $MachinePrecision]), $MachinePrecision], t$95$1]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{y - \frac{x}{z}}{a}\\
t_2 := t - z \cdot a\\
\mathbf{if}\;z \leq -1.6 \cdot 10^{-53}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq 2.1 \cdot 10^{-124}:\\
\;\;\;\;\frac{x - y \cdot z}{t}\\
\mathbf{elif}\;z \leq 246000:\\
\;\;\;\;\frac{x}{t_2}\\
\mathbf{elif}\;z \leq 1.1 \cdot 10^{+40}:\\
\;\;\;\;\frac{-y}{\frac{t_2}{z}}\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if z < -1.6e-53 or 1.0999999999999999e40 < z Initial program 66.4%
*-commutative66.4%
Simplified66.4%
clear-num66.3%
associate-/r/66.3%
sub-neg66.3%
+-commutative66.3%
*-commutative66.3%
distribute-rgt-neg-in66.3%
fma-def66.3%
Applied egg-rr66.3%
Taylor expanded in z around -inf 60.6%
+-commutative60.6%
mul-1-neg60.6%
unsub-neg60.6%
associate-/l*65.4%
Simplified65.4%
Taylor expanded in a around inf 75.9%
if -1.6e-53 < z < 2.1000000000000001e-124Initial program 99.8%
*-commutative99.8%
Simplified99.8%
Taylor expanded in t around inf 84.2%
if 2.1000000000000001e-124 < z < 246000Initial program 99.6%
*-commutative99.6%
Simplified99.6%
Taylor expanded in x around inf 69.9%
*-commutative69.9%
Simplified69.9%
if 246000 < z < 1.0999999999999999e40Initial program 100.0%
*-commutative100.0%
Simplified100.0%
Taylor expanded in x around 0 100.0%
mul-1-neg100.0%
associate-/l*99.5%
*-commutative99.5%
Simplified99.5%
Final simplification78.2%
(FPCore (x y z t a)
:precision binary64
(if (or (<= y -3.5e+183)
(not
(or (<= y -1.18e+141) (and (not (<= y -9.6e-5)) (<= y 9.6e+41)))))
(/ y a)
(/ x (- t (* z a)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((y <= -3.5e+183) || !((y <= -1.18e+141) || (!(y <= -9.6e-5) && (y <= 9.6e+41)))) {
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 ((y <= (-3.5d+183)) .or. (.not. (y <= (-1.18d+141)) .or. (.not. (y <= (-9.6d-5))) .and. (y <= 9.6d+41))) 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 ((y <= -3.5e+183) || !((y <= -1.18e+141) || (!(y <= -9.6e-5) && (y <= 9.6e+41)))) {
tmp = y / a;
} else {
tmp = x / (t - (z * a));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (y <= -3.5e+183) or not ((y <= -1.18e+141) or (not (y <= -9.6e-5) and (y <= 9.6e+41))): tmp = y / a else: tmp = x / (t - (z * a)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((y <= -3.5e+183) || !((y <= -1.18e+141) || (!(y <= -9.6e-5) && (y <= 9.6e+41)))) 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 ((y <= -3.5e+183) || ~(((y <= -1.18e+141) || (~((y <= -9.6e-5)) && (y <= 9.6e+41))))) tmp = y / a; else tmp = x / (t - (z * a)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[y, -3.5e+183], N[Not[Or[LessEqual[y, -1.18e+141], And[N[Not[LessEqual[y, -9.6e-5]], $MachinePrecision], LessEqual[y, 9.6e+41]]]], $MachinePrecision]], N[(y / a), $MachinePrecision], N[(x / N[(t - N[(z * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -3.5 \cdot 10^{+183} \lor \neg \left(y \leq -1.18 \cdot 10^{+141} \lor \neg \left(y \leq -9.6 \cdot 10^{-5}\right) \land y \leq 9.6 \cdot 10^{+41}\right):\\
\;\;\;\;\frac{y}{a}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{t - z \cdot a}\\
\end{array}
\end{array}
if y < -3.49999999999999987e183 or -1.1800000000000001e141 < y < -9.6000000000000002e-5 or 9.6000000000000007e41 < y Initial program 69.4%
*-commutative69.4%
Simplified69.4%
Taylor expanded in z around inf 62.0%
if -3.49999999999999987e183 < y < -1.1800000000000001e141 or -9.6000000000000002e-5 < y < 9.6000000000000007e41Initial program 88.2%
*-commutative88.2%
Simplified88.2%
Taylor expanded in x around inf 69.2%
*-commutative69.2%
Simplified69.2%
Final simplification66.3%
(FPCore (x y z t a)
:precision binary64
(if (<= y -2.2e+227)
(/ y a)
(if (<= y -4e+140)
(/ (- x (* y z)) t)
(if (or (<= y -2.05e-8) (not (<= y 2.05e+41)))
(/ y a)
(/ x (- t (* z a)))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (y <= -2.2e+227) {
tmp = y / a;
} else if (y <= -4e+140) {
tmp = (x - (y * z)) / t;
} else if ((y <= -2.05e-8) || !(y <= 2.05e+41)) {
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 (y <= (-2.2d+227)) then
tmp = y / a
else if (y <= (-4d+140)) then
tmp = (x - (y * z)) / t
else if ((y <= (-2.05d-8)) .or. (.not. (y <= 2.05d+41))) 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 (y <= -2.2e+227) {
tmp = y / a;
} else if (y <= -4e+140) {
tmp = (x - (y * z)) / t;
} else if ((y <= -2.05e-8) || !(y <= 2.05e+41)) {
tmp = y / a;
} else {
tmp = x / (t - (z * a));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if y <= -2.2e+227: tmp = y / a elif y <= -4e+140: tmp = (x - (y * z)) / t elif (y <= -2.05e-8) or not (y <= 2.05e+41): tmp = y / a else: tmp = x / (t - (z * a)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (y <= -2.2e+227) tmp = Float64(y / a); elseif (y <= -4e+140) tmp = Float64(Float64(x - Float64(y * z)) / t); elseif ((y <= -2.05e-8) || !(y <= 2.05e+41)) 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 (y <= -2.2e+227) tmp = y / a; elseif (y <= -4e+140) tmp = (x - (y * z)) / t; elseif ((y <= -2.05e-8) || ~((y <= 2.05e+41))) tmp = y / a; else tmp = x / (t - (z * a)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[y, -2.2e+227], N[(y / a), $MachinePrecision], If[LessEqual[y, -4e+140], N[(N[(x - N[(y * z), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision], If[Or[LessEqual[y, -2.05e-8], N[Not[LessEqual[y, 2.05e+41]], $MachinePrecision]], N[(y / a), $MachinePrecision], N[(x / N[(t - N[(z * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -2.2 \cdot 10^{+227}:\\
\;\;\;\;\frac{y}{a}\\
\mathbf{elif}\;y \leq -4 \cdot 10^{+140}:\\
\;\;\;\;\frac{x - y \cdot z}{t}\\
\mathbf{elif}\;y \leq -2.05 \cdot 10^{-8} \lor \neg \left(y \leq 2.05 \cdot 10^{+41}\right):\\
\;\;\;\;\frac{y}{a}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{t - z \cdot a}\\
\end{array}
\end{array}
if y < -2.2000000000000002e227 or -4.00000000000000024e140 < y < -2.05000000000000016e-8 or 2.0500000000000002e41 < y Initial program 67.9%
*-commutative67.9%
Simplified67.9%
Taylor expanded in z around inf 62.9%
if -2.2000000000000002e227 < y < -4.00000000000000024e140Initial program 84.8%
*-commutative84.8%
Simplified84.8%
Taylor expanded in t around inf 59.1%
if -2.05000000000000016e-8 < y < 2.0500000000000002e41Initial program 88.6%
*-commutative88.6%
Simplified88.6%
Taylor expanded in x around inf 69.5%
*-commutative69.5%
Simplified69.5%
Final simplification66.3%
(FPCore (x y z t a)
:precision binary64
(if (<= z -6e+20)
(/ y a)
(if (<= z -2.2e-54)
(/ (- x) (* z a))
(if (<= z 14500.0)
(/ x t)
(if (<= z 2.7e+136) (/ (/ (- x) a) z) (/ y a))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -6e+20) {
tmp = y / a;
} else if (z <= -2.2e-54) {
tmp = -x / (z * a);
} else if (z <= 14500.0) {
tmp = x / t;
} else if (z <= 2.7e+136) {
tmp = (-x / a) / z;
} 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 <= (-6d+20)) then
tmp = y / a
else if (z <= (-2.2d-54)) then
tmp = -x / (z * a)
else if (z <= 14500.0d0) then
tmp = x / t
else if (z <= 2.7d+136) then
tmp = (-x / a) / z
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 <= -6e+20) {
tmp = y / a;
} else if (z <= -2.2e-54) {
tmp = -x / (z * a);
} else if (z <= 14500.0) {
tmp = x / t;
} else if (z <= 2.7e+136) {
tmp = (-x / a) / z;
} else {
tmp = y / a;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -6e+20: tmp = y / a elif z <= -2.2e-54: tmp = -x / (z * a) elif z <= 14500.0: tmp = x / t elif z <= 2.7e+136: tmp = (-x / a) / z else: tmp = y / a return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -6e+20) tmp = Float64(y / a); elseif (z <= -2.2e-54) tmp = Float64(Float64(-x) / Float64(z * a)); elseif (z <= 14500.0) tmp = Float64(x / t); elseif (z <= 2.7e+136) tmp = Float64(Float64(Float64(-x) / a) / z); else tmp = Float64(y / a); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (z <= -6e+20) tmp = y / a; elseif (z <= -2.2e-54) tmp = -x / (z * a); elseif (z <= 14500.0) tmp = x / t; elseif (z <= 2.7e+136) tmp = (-x / a) / z; else tmp = y / a; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -6e+20], N[(y / a), $MachinePrecision], If[LessEqual[z, -2.2e-54], N[((-x) / N[(z * a), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 14500.0], N[(x / t), $MachinePrecision], If[LessEqual[z, 2.7e+136], N[(N[((-x) / a), $MachinePrecision] / z), $MachinePrecision], N[(y / a), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -6 \cdot 10^{+20}:\\
\;\;\;\;\frac{y}{a}\\
\mathbf{elif}\;z \leq -2.2 \cdot 10^{-54}:\\
\;\;\;\;\frac{-x}{z \cdot a}\\
\mathbf{elif}\;z \leq 14500:\\
\;\;\;\;\frac{x}{t}\\
\mathbf{elif}\;z \leq 2.7 \cdot 10^{+136}:\\
\;\;\;\;\frac{\frac{-x}{a}}{z}\\
\mathbf{else}:\\
\;\;\;\;\frac{y}{a}\\
\end{array}
\end{array}
if z < -6e20 or 2.7000000000000002e136 < z Initial program 58.8%
*-commutative58.8%
Simplified58.8%
Taylor expanded in z around inf 60.5%
if -6e20 < z < -2.2e-54Initial program 99.7%
*-commutative99.7%
Simplified99.7%
clear-num99.6%
associate-/r/99.6%
sub-neg99.6%
+-commutative99.6%
*-commutative99.6%
distribute-rgt-neg-in99.6%
fma-def99.7%
Applied egg-rr99.7%
Taylor expanded in a around inf 82.3%
associate-/r*82.4%
Simplified82.4%
Taylor expanded in z around 0 66.4%
mul-1-neg66.4%
*-commutative66.4%
Simplified66.4%
if -2.2e-54 < z < 14500Initial program 99.8%
*-commutative99.8%
Simplified99.8%
Taylor expanded in z around 0 61.1%
if 14500 < z < 2.7000000000000002e136Initial program 85.2%
*-commutative85.2%
Simplified85.2%
clear-num85.2%
associate-/r/85.2%
sub-neg85.2%
+-commutative85.2%
*-commutative85.2%
distribute-rgt-neg-in85.2%
fma-def85.2%
Applied egg-rr85.2%
Taylor expanded in a around inf 55.9%
associate-/r*58.6%
Simplified58.6%
Taylor expanded in z around 0 36.8%
mul-1-neg36.8%
associate-/r*51.1%
distribute-neg-frac51.1%
distribute-neg-frac51.1%
Simplified51.1%
Final simplification60.4%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -8e-58) (not (<= z 3.1e-10))) (/ (- y (/ x z)) a) (/ (- x (* y z)) t)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -8e-58) || !(z <= 3.1e-10)) {
tmp = (y - (x / z)) / a;
} else {
tmp = (x - (y * z)) / 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 <= (-8d-58)) .or. (.not. (z <= 3.1d-10))) then
tmp = (y - (x / z)) / a
else
tmp = (x - (y * z)) / 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 <= -8e-58) || !(z <= 3.1e-10)) {
tmp = (y - (x / z)) / a;
} else {
tmp = (x - (y * z)) / t;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -8e-58) or not (z <= 3.1e-10): tmp = (y - (x / z)) / a else: tmp = (x - (y * z)) / t return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -8e-58) || !(z <= 3.1e-10)) tmp = Float64(Float64(y - Float64(x / z)) / a); else tmp = Float64(Float64(x - Float64(y * z)) / t); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((z <= -8e-58) || ~((z <= 3.1e-10))) tmp = (y - (x / z)) / a; else tmp = (x - (y * z)) / t; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -8e-58], N[Not[LessEqual[z, 3.1e-10]], $MachinePrecision]], N[(N[(y - N[(x / z), $MachinePrecision]), $MachinePrecision] / a), $MachinePrecision], N[(N[(x - N[(y * z), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -8 \cdot 10^{-58} \lor \neg \left(z \leq 3.1 \cdot 10^{-10}\right):\\
\;\;\;\;\frac{y - \frac{x}{z}}{a}\\
\mathbf{else}:\\
\;\;\;\;\frac{x - y \cdot z}{t}\\
\end{array}
\end{array}
if z < -8.0000000000000002e-58 or 3.10000000000000015e-10 < z Initial program 67.7%
*-commutative67.7%
Simplified67.7%
clear-num67.6%
associate-/r/67.6%
sub-neg67.6%
+-commutative67.6%
*-commutative67.6%
distribute-rgt-neg-in67.6%
fma-def67.6%
Applied egg-rr67.6%
Taylor expanded in z around -inf 60.2%
+-commutative60.2%
mul-1-neg60.2%
unsub-neg60.2%
associate-/l*65.5%
Simplified65.5%
Taylor expanded in a around inf 75.6%
if -8.0000000000000002e-58 < z < 3.10000000000000015e-10Initial program 99.8%
*-commutative99.8%
Simplified99.8%
Taylor expanded in t around inf 77.5%
Final simplification76.4%
(FPCore (x y z t a) :precision binary64 (if (<= z -1.25e+21) (/ y a) (if (<= z -5.2e-58) (/ (- x) (* z a)) (if (<= z 6.6e-8) (/ x t) (/ y a)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -1.25e+21) {
tmp = y / a;
} else if (z <= -5.2e-58) {
tmp = -x / (z * a);
} else if (z <= 6.6e-8) {
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+21)) then
tmp = y / a
else if (z <= (-5.2d-58)) then
tmp = -x / (z * a)
else if (z <= 6.6d-8) 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+21) {
tmp = y / a;
} else if (z <= -5.2e-58) {
tmp = -x / (z * a);
} else if (z <= 6.6e-8) {
tmp = x / t;
} else {
tmp = y / a;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -1.25e+21: tmp = y / a elif z <= -5.2e-58: tmp = -x / (z * a) elif z <= 6.6e-8: tmp = x / t else: tmp = y / a return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -1.25e+21) tmp = Float64(y / a); elseif (z <= -5.2e-58) tmp = Float64(Float64(-x) / Float64(z * a)); elseif (z <= 6.6e-8) 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+21) tmp = y / a; elseif (z <= -5.2e-58) tmp = -x / (z * a); elseif (z <= 6.6e-8) tmp = x / t; else tmp = y / a; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -1.25e+21], N[(y / a), $MachinePrecision], If[LessEqual[z, -5.2e-58], N[((-x) / N[(z * a), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 6.6e-8], N[(x / t), $MachinePrecision], N[(y / a), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.25 \cdot 10^{+21}:\\
\;\;\;\;\frac{y}{a}\\
\mathbf{elif}\;z \leq -5.2 \cdot 10^{-58}:\\
\;\;\;\;\frac{-x}{z \cdot a}\\
\mathbf{elif}\;z \leq 6.6 \cdot 10^{-8}:\\
\;\;\;\;\frac{x}{t}\\
\mathbf{else}:\\
\;\;\;\;\frac{y}{a}\\
\end{array}
\end{array}
if z < -1.25e21 or 6.59999999999999954e-8 < z Initial program 63.1%
*-commutative63.1%
Simplified63.1%
Taylor expanded in z around inf 55.1%
if -1.25e21 < z < -5.20000000000000013e-58Initial program 99.7%
*-commutative99.7%
Simplified99.7%
clear-num99.6%
associate-/r/99.6%
sub-neg99.6%
+-commutative99.6%
*-commutative99.6%
distribute-rgt-neg-in99.6%
fma-def99.7%
Applied egg-rr99.7%
Taylor expanded in a around inf 82.3%
associate-/r*82.4%
Simplified82.4%
Taylor expanded in z around 0 66.4%
mul-1-neg66.4%
*-commutative66.4%
Simplified66.4%
if -5.20000000000000013e-58 < z < 6.59999999999999954e-8Initial program 99.8%
*-commutative99.8%
Simplified99.8%
Taylor expanded in z around 0 61.6%
Final simplification58.6%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -4.2e-15) (not (<= z 0.212))) (/ y a) (/ x t)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -4.2e-15) || !(z <= 0.212)) {
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 <= (-4.2d-15)) .or. (.not. (z <= 0.212d0))) 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 <= -4.2e-15) || !(z <= 0.212)) {
tmp = y / a;
} else {
tmp = x / t;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -4.2e-15) or not (z <= 0.212): tmp = y / a else: tmp = x / t return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -4.2e-15) || !(z <= 0.212)) 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 <= -4.2e-15) || ~((z <= 0.212))) tmp = y / a; else tmp = x / t; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -4.2e-15], N[Not[LessEqual[z, 0.212]], $MachinePrecision]], N[(y / a), $MachinePrecision], N[(x / t), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -4.2 \cdot 10^{-15} \lor \neg \left(z \leq 0.212\right):\\
\;\;\;\;\frac{y}{a}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{t}\\
\end{array}
\end{array}
if z < -4.19999999999999962e-15 or 0.211999999999999994 < z Initial program 65.7%
*-commutative65.7%
Simplified65.7%
Taylor expanded in z around inf 55.0%
if -4.19999999999999962e-15 < z < 0.211999999999999994Initial program 99.8%
*-commutative99.8%
Simplified99.8%
Taylor expanded in z around 0 59.2%
Final simplification56.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 80.7%
*-commutative80.7%
Simplified80.7%
Taylor expanded in z around 0 32.7%
Final simplification32.7%
(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 2023331
(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))))