
(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 10 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 (* z a)))))
(if (<= t_1 (- INFINITY))
(/ z (/ (- (* z a) t) y))
(if (<= t_1 -5e-312)
t_1
(if (<= t_1 0.0)
(- (/ y a) (/ (/ x a) z))
(if (<= t_1 1e+299) t_1 (/ (- y (/ x z)) 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 = z / (((z * a) - t) / y);
} else if (t_1 <= -5e-312) {
tmp = t_1;
} else if (t_1 <= 0.0) {
tmp = (y / a) - ((x / a) / z);
} else if (t_1 <= 1e+299) {
tmp = t_1;
} else {
tmp = (y - (x / z)) / 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 = z / (((z * a) - t) / y);
} else if (t_1 <= -5e-312) {
tmp = t_1;
} else if (t_1 <= 0.0) {
tmp = (y / a) - ((x / a) / z);
} else if (t_1 <= 1e+299) {
tmp = t_1;
} else {
tmp = (y - (x / z)) / 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 = z / (((z * a) - t) / y) elif t_1 <= -5e-312: tmp = t_1 elif t_1 <= 0.0: tmp = (y / a) - ((x / a) / z) elif t_1 <= 1e+299: tmp = t_1 else: tmp = (y - (x / z)) / 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 <= Float64(-Inf)) tmp = Float64(z / Float64(Float64(Float64(z * a) - t) / y)); elseif (t_1 <= -5e-312) tmp = t_1; elseif (t_1 <= 0.0) tmp = Float64(Float64(y / a) - Float64(Float64(x / a) / z)); elseif (t_1 <= 1e+299) tmp = t_1; else tmp = Float64(Float64(y - Float64(x / z)) / 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 = z / (((z * a) - t) / y); elseif (t_1 <= -5e-312) tmp = t_1; elseif (t_1 <= 0.0) tmp = (y / a) - ((x / a) / z); elseif (t_1 <= 1e+299) tmp = t_1; else tmp = (y - (x / z)) / 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)], N[(z / N[(N[(N[(z * a), $MachinePrecision] - t), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, -5e-312], t$95$1, If[LessEqual[t$95$1, 0.0], N[(N[(y / a), $MachinePrecision] - N[(N[(x / a), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 1e+299], t$95$1, N[(N[(y - N[(x / z), $MachinePrecision]), $MachinePrecision] / 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:\\
\;\;\;\;\frac{z}{\frac{z \cdot a - t}{y}}\\
\mathbf{elif}\;t_1 \leq -5 \cdot 10^{-312}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;t_1 \leq 0:\\
\;\;\;\;\frac{y}{a} - \frac{\frac{x}{a}}{z}\\
\mathbf{elif}\;t_1 \leq 10^{+299}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;\frac{y - \frac{x}{z}}{a}\\
\end{array}
\end{array}
if (/.f64 (-.f64 x (*.f64 y z)) (-.f64 t (*.f64 a z))) < -inf.0Initial program 42.2%
sub-neg42.2%
+-commutative42.2%
neg-sub042.2%
associate-+l-42.2%
sub0-neg42.2%
neg-mul-142.2%
sub-neg42.2%
+-commutative42.2%
neg-sub042.2%
associate-+l-42.2%
sub0-neg42.2%
neg-mul-142.2%
times-frac42.2%
metadata-eval42.2%
*-lft-identity42.2%
*-commutative42.2%
Simplified42.2%
div-sub42.2%
*-commutative42.2%
add-cube-cbrt42.2%
times-frac94.1%
fma-neg94.1%
pow294.1%
Applied egg-rr94.1%
Taylor expanded in y around inf 23.8%
pow-base-123.8%
associate-*r/23.8%
*-commutative23.8%
*-lft-identity23.8%
*-commutative23.8%
associate-/l*85.8%
*-commutative85.8%
Simplified85.8%
if -inf.0 < (/.f64 (-.f64 x (*.f64 y z)) (-.f64 t (*.f64 a z))) < -5.0000000000022e-312 or 0.0 < (/.f64 (-.f64 x (*.f64 y z)) (-.f64 t (*.f64 a z))) < 1.0000000000000001e299Initial program 99.7%
if -5.0000000000022e-312 < (/.f64 (-.f64 x (*.f64 y z)) (-.f64 t (*.f64 a z))) < 0.0Initial program 54.4%
sub-neg54.4%
+-commutative54.4%
neg-sub054.4%
associate-+l-54.4%
sub0-neg54.4%
neg-mul-154.4%
sub-neg54.4%
+-commutative54.4%
neg-sub054.4%
associate-+l-54.4%
sub0-neg54.4%
neg-mul-154.4%
times-frac54.4%
metadata-eval54.4%
*-lft-identity54.4%
*-commutative54.4%
Simplified54.4%
Taylor expanded in z around inf 60.5%
mul-1-neg60.5%
+-commutative60.5%
associate--l+60.5%
associate-/r*77.3%
distribute-neg-frac77.3%
mul-1-neg77.3%
associate-/r*77.3%
associate-*r/77.3%
div-sub77.3%
distribute-lft-out--77.3%
associate-*r/77.3%
Simplified81.2%
Taylor expanded in x around inf 81.4%
if 1.0000000000000001e299 < (/.f64 (-.f64 x (*.f64 y z)) (-.f64 t (*.f64 a z))) Initial program 41.7%
sub-neg41.7%
+-commutative41.7%
neg-sub041.7%
associate-+l-41.7%
sub0-neg41.7%
neg-mul-141.7%
sub-neg41.7%
+-commutative41.7%
neg-sub041.7%
associate-+l-41.7%
sub0-neg41.7%
neg-mul-141.7%
times-frac41.7%
metadata-eval41.7%
*-lft-identity41.7%
*-commutative41.7%
Simplified41.7%
Taylor expanded in z around inf 59.4%
mul-1-neg59.4%
+-commutative59.4%
associate--l+59.4%
associate-/r*56.4%
distribute-neg-frac56.4%
mul-1-neg56.4%
associate-/r*50.3%
associate-*r/50.3%
div-sub50.3%
distribute-lft-out--50.3%
associate-*r/50.3%
Simplified65.8%
Taylor expanded in a around inf 90.9%
Final simplification95.6%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (/ (- x (* y z)) (- t (* z a))))
(t_2 (- (* z a) t))
(t_3 (/ (- x) t_2))
(t_4 (cbrt t_2)))
(if (<= t_1 -5e-312)
(fma z (/ y t_2) t_3)
(if (<= t_1 0.0)
(- (/ y a) (/ (/ x a) z))
(if (<= t_1 INFINITY)
(fma (/ z (pow t_4 2.0)) (/ y t_4) t_3)
(/ y a))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = (x - (y * z)) / (t - (z * a));
double t_2 = (z * a) - t;
double t_3 = -x / t_2;
double t_4 = cbrt(t_2);
double tmp;
if (t_1 <= -5e-312) {
tmp = fma(z, (y / t_2), t_3);
} else if (t_1 <= 0.0) {
tmp = (y / a) - ((x / a) / z);
} else if (t_1 <= ((double) INFINITY)) {
tmp = fma((z / pow(t_4, 2.0)), (y / t_4), t_3);
} 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))) t_2 = Float64(Float64(z * a) - t) t_3 = Float64(Float64(-x) / t_2) t_4 = cbrt(t_2) tmp = 0.0 if (t_1 <= -5e-312) tmp = fma(z, Float64(y / t_2), t_3); elseif (t_1 <= 0.0) tmp = Float64(Float64(y / a) - Float64(Float64(x / a) / z)); elseif (t_1 <= Inf) tmp = fma(Float64(z / (t_4 ^ 2.0)), Float64(y / t_4), t_3); 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]}, Block[{t$95$2 = N[(N[(z * a), $MachinePrecision] - t), $MachinePrecision]}, Block[{t$95$3 = N[((-x) / t$95$2), $MachinePrecision]}, Block[{t$95$4 = N[Power[t$95$2, 1/3], $MachinePrecision]}, If[LessEqual[t$95$1, -5e-312], N[(z * N[(y / t$95$2), $MachinePrecision] + t$95$3), $MachinePrecision], If[LessEqual[t$95$1, 0.0], N[(N[(y / a), $MachinePrecision] - N[(N[(x / a), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, Infinity], N[(N[(z / N[Power[t$95$4, 2.0], $MachinePrecision]), $MachinePrecision] * N[(y / t$95$4), $MachinePrecision] + t$95$3), $MachinePrecision], N[(y / a), $MachinePrecision]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{x - y \cdot z}{t - z \cdot a}\\
t_2 := z \cdot a - t\\
t_3 := \frac{-x}{t_2}\\
t_4 := \sqrt[3]{t_2}\\
\mathbf{if}\;t_1 \leq -5 \cdot 10^{-312}:\\
\;\;\;\;\mathsf{fma}\left(z, \frac{y}{t_2}, t_3\right)\\
\mathbf{elif}\;t_1 \leq 0:\\
\;\;\;\;\frac{y}{a} - \frac{\frac{x}{a}}{z}\\
\mathbf{elif}\;t_1 \leq \infty:\\
\;\;\;\;\mathsf{fma}\left(\frac{z}{{t_4}^{2}}, \frac{y}{t_4}, t_3\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{y}{a}\\
\end{array}
\end{array}
if (/.f64 (-.f64 x (*.f64 y z)) (-.f64 t (*.f64 a z))) < -5.0000000000022e-312Initial program 89.5%
sub-neg89.5%
+-commutative89.5%
neg-sub089.5%
associate-+l-89.5%
sub0-neg89.5%
neg-mul-189.5%
sub-neg89.5%
+-commutative89.5%
neg-sub089.5%
associate-+l-89.5%
sub0-neg89.5%
neg-mul-189.5%
times-frac89.5%
metadata-eval89.5%
*-lft-identity89.5%
*-commutative89.5%
Simplified89.5%
div-sub89.5%
*-commutative89.5%
*-un-lft-identity89.5%
times-frac95.8%
fma-neg95.8%
Applied egg-rr95.8%
if -5.0000000000022e-312 < (/.f64 (-.f64 x (*.f64 y z)) (-.f64 t (*.f64 a z))) < 0.0Initial program 54.4%
sub-neg54.4%
+-commutative54.4%
neg-sub054.4%
associate-+l-54.4%
sub0-neg54.4%
neg-mul-154.4%
sub-neg54.4%
+-commutative54.4%
neg-sub054.4%
associate-+l-54.4%
sub0-neg54.4%
neg-mul-154.4%
times-frac54.4%
metadata-eval54.4%
*-lft-identity54.4%
*-commutative54.4%
Simplified54.4%
Taylor expanded in z around inf 60.5%
mul-1-neg60.5%
+-commutative60.5%
associate--l+60.5%
associate-/r*77.3%
distribute-neg-frac77.3%
mul-1-neg77.3%
associate-/r*77.3%
associate-*r/77.3%
div-sub77.3%
distribute-lft-out--77.3%
associate-*r/77.3%
Simplified81.2%
Taylor expanded in x around inf 81.4%
if 0.0 < (/.f64 (-.f64 x (*.f64 y z)) (-.f64 t (*.f64 a z))) < +inf.0Initial program 93.0%
sub-neg93.0%
+-commutative93.0%
neg-sub093.0%
associate-+l-93.0%
sub0-neg93.0%
neg-mul-193.0%
sub-neg93.0%
+-commutative93.0%
neg-sub093.0%
associate-+l-93.0%
sub0-neg93.0%
neg-mul-193.0%
times-frac93.0%
metadata-eval93.0%
*-lft-identity93.0%
*-commutative93.0%
Simplified93.0%
div-sub93.0%
*-commutative93.0%
add-cube-cbrt92.4%
times-frac98.1%
fma-neg98.1%
pow298.1%
Applied egg-rr98.1%
if +inf.0 < (/.f64 (-.f64 x (*.f64 y z)) (-.f64 t (*.f64 a z))) Initial program 0.0%
sub-neg0.0%
+-commutative0.0%
neg-sub00.0%
associate-+l-0.0%
sub0-neg0.0%
neg-mul-10.0%
sub-neg0.0%
+-commutative0.0%
neg-sub00.0%
associate-+l-0.0%
sub0-neg0.0%
neg-mul-10.0%
times-frac0.0%
metadata-eval0.0%
*-lft-identity0.0%
*-commutative0.0%
Simplified0.0%
Taylor expanded in z around inf 100.0%
Final simplification95.4%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (- (* z a) t)) (t_2 (/ (- x (* y z)) (- t (* z a)))))
(if (<= t_2 (- INFINITY))
(fma z (/ y t_1) (/ (- x) t_1))
(if (<= t_2 1e+299) t_2 (/ (- y (/ x z)) a)))))
double code(double x, double y, double z, double t, double a) {
double t_1 = (z * a) - t;
double t_2 = (x - (y * z)) / (t - (z * a));
double tmp;
if (t_2 <= -((double) INFINITY)) {
tmp = fma(z, (y / t_1), (-x / t_1));
} else if (t_2 <= 1e+299) {
tmp = t_2;
} else {
tmp = (y - (x / z)) / a;
}
return tmp;
}
function code(x, y, z, t, a) t_1 = Float64(Float64(z * a) - t) t_2 = Float64(Float64(x - Float64(y * z)) / Float64(t - Float64(z * a))) tmp = 0.0 if (t_2 <= Float64(-Inf)) tmp = fma(z, Float64(y / t_1), Float64(Float64(-x) / t_1)); elseif (t_2 <= 1e+299) tmp = t_2; else tmp = Float64(Float64(y - Float64(x / z)) / a); end return tmp end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(z * a), $MachinePrecision] - t), $MachinePrecision]}, Block[{t$95$2 = N[(N[(x - N[(y * z), $MachinePrecision]), $MachinePrecision] / N[(t - N[(z * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$2, (-Infinity)], N[(z * N[(y / t$95$1), $MachinePrecision] + N[((-x) / t$95$1), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$2, 1e+299], t$95$2, N[(N[(y - N[(x / z), $MachinePrecision]), $MachinePrecision] / a), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := z \cdot a - t\\
t_2 := \frac{x - y \cdot z}{t - z \cdot a}\\
\mathbf{if}\;t_2 \leq -\infty:\\
\;\;\;\;\mathsf{fma}\left(z, \frac{y}{t_1}, \frac{-x}{t_1}\right)\\
\mathbf{elif}\;t_2 \leq 10^{+299}:\\
\;\;\;\;t_2\\
\mathbf{else}:\\
\;\;\;\;\frac{y - \frac{x}{z}}{a}\\
\end{array}
\end{array}
if (/.f64 (-.f64 x (*.f64 y z)) (-.f64 t (*.f64 a z))) < -inf.0Initial program 42.2%
sub-neg42.2%
+-commutative42.2%
neg-sub042.2%
associate-+l-42.2%
sub0-neg42.2%
neg-mul-142.2%
sub-neg42.2%
+-commutative42.2%
neg-sub042.2%
associate-+l-42.2%
sub0-neg42.2%
neg-mul-142.2%
times-frac42.2%
metadata-eval42.2%
*-lft-identity42.2%
*-commutative42.2%
Simplified42.2%
div-sub42.2%
*-commutative42.2%
*-un-lft-identity42.2%
times-frac94.9%
fma-neg94.9%
Applied egg-rr94.9%
if -inf.0 < (/.f64 (-.f64 x (*.f64 y z)) (-.f64 t (*.f64 a z))) < 1.0000000000000001e299Initial program 93.9%
if 1.0000000000000001e299 < (/.f64 (-.f64 x (*.f64 y z)) (-.f64 t (*.f64 a z))) Initial program 41.7%
sub-neg41.7%
+-commutative41.7%
neg-sub041.7%
associate-+l-41.7%
sub0-neg41.7%
neg-mul-141.7%
sub-neg41.7%
+-commutative41.7%
neg-sub041.7%
associate-+l-41.7%
sub0-neg41.7%
neg-mul-141.7%
times-frac41.7%
metadata-eval41.7%
*-lft-identity41.7%
*-commutative41.7%
Simplified41.7%
Taylor expanded in z around inf 59.4%
mul-1-neg59.4%
+-commutative59.4%
associate--l+59.4%
associate-/r*56.4%
distribute-neg-frac56.4%
mul-1-neg56.4%
associate-/r*50.3%
associate-*r/50.3%
div-sub50.3%
distribute-lft-out--50.3%
associate-*r/50.3%
Simplified65.8%
Taylor expanded in a around inf 90.9%
Final simplification93.6%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (/ (- y (/ x z)) a)) (t_2 (- (* z a) t)))
(if (<= z -1.46e+23)
t_1
(if (<= z -1.8e-90)
(/ (- x (* y z)) t)
(if (<= z 22000000000.0)
(/ (- x) t_2)
(if (or (<= z 7.8e+211) (not (<= z 7.5e+267)))
(* y (/ z t_2))
t_1))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = (y - (x / z)) / a;
double t_2 = (z * a) - t;
double tmp;
if (z <= -1.46e+23) {
tmp = t_1;
} else if (z <= -1.8e-90) {
tmp = (x - (y * z)) / t;
} else if (z <= 22000000000.0) {
tmp = -x / t_2;
} else if ((z <= 7.8e+211) || !(z <= 7.5e+267)) {
tmp = y * (z / t_2);
} 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 = (z * a) - t
if (z <= (-1.46d+23)) then
tmp = t_1
else if (z <= (-1.8d-90)) then
tmp = (x - (y * z)) / t
else if (z <= 22000000000.0d0) then
tmp = -x / t_2
else if ((z <= 7.8d+211) .or. (.not. (z <= 7.5d+267))) then
tmp = y * (z / t_2)
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 = (z * a) - t;
double tmp;
if (z <= -1.46e+23) {
tmp = t_1;
} else if (z <= -1.8e-90) {
tmp = (x - (y * z)) / t;
} else if (z <= 22000000000.0) {
tmp = -x / t_2;
} else if ((z <= 7.8e+211) || !(z <= 7.5e+267)) {
tmp = y * (z / t_2);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = (y - (x / z)) / a t_2 = (z * a) - t tmp = 0 if z <= -1.46e+23: tmp = t_1 elif z <= -1.8e-90: tmp = (x - (y * z)) / t elif z <= 22000000000.0: tmp = -x / t_2 elif (z <= 7.8e+211) or not (z <= 7.5e+267): tmp = y * (z / t_2) 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(Float64(z * a) - t) tmp = 0.0 if (z <= -1.46e+23) tmp = t_1; elseif (z <= -1.8e-90) tmp = Float64(Float64(x - Float64(y * z)) / t); elseif (z <= 22000000000.0) tmp = Float64(Float64(-x) / t_2); elseif ((z <= 7.8e+211) || !(z <= 7.5e+267)) tmp = Float64(y * Float64(z / t_2)); 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 = (z * a) - t; tmp = 0.0; if (z <= -1.46e+23) tmp = t_1; elseif (z <= -1.8e-90) tmp = (x - (y * z)) / t; elseif (z <= 22000000000.0) tmp = -x / t_2; elseif ((z <= 7.8e+211) || ~((z <= 7.5e+267))) tmp = y * (z / t_2); 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[(N[(z * a), $MachinePrecision] - t), $MachinePrecision]}, If[LessEqual[z, -1.46e+23], t$95$1, If[LessEqual[z, -1.8e-90], N[(N[(x - N[(y * z), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision], If[LessEqual[z, 22000000000.0], N[((-x) / t$95$2), $MachinePrecision], If[Or[LessEqual[z, 7.8e+211], N[Not[LessEqual[z, 7.5e+267]], $MachinePrecision]], N[(y * N[(z / t$95$2), $MachinePrecision]), $MachinePrecision], t$95$1]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{y - \frac{x}{z}}{a}\\
t_2 := z \cdot a - t\\
\mathbf{if}\;z \leq -1.46 \cdot 10^{+23}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq -1.8 \cdot 10^{-90}:\\
\;\;\;\;\frac{x - y \cdot z}{t}\\
\mathbf{elif}\;z \leq 22000000000:\\
\;\;\;\;\frac{-x}{t_2}\\
\mathbf{elif}\;z \leq 7.8 \cdot 10^{+211} \lor \neg \left(z \leq 7.5 \cdot 10^{+267}\right):\\
\;\;\;\;y \cdot \frac{z}{t_2}\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if z < -1.45999999999999996e23 or 7.80000000000000045e211 < z < 7.4999999999999998e267Initial program 66.7%
sub-neg66.7%
+-commutative66.7%
neg-sub066.7%
associate-+l-66.7%
sub0-neg66.7%
neg-mul-166.7%
sub-neg66.7%
+-commutative66.7%
neg-sub066.7%
associate-+l-66.7%
sub0-neg66.7%
neg-mul-166.7%
times-frac66.7%
metadata-eval66.7%
*-lft-identity66.7%
*-commutative66.7%
Simplified66.7%
Taylor expanded in z around inf 65.4%
mul-1-neg65.4%
+-commutative65.4%
associate--l+65.4%
associate-/r*64.9%
distribute-neg-frac64.9%
mul-1-neg64.9%
associate-/r*62.0%
associate-*r/62.0%
div-sub62.0%
distribute-lft-out--62.0%
associate-*r/62.0%
Simplified70.3%
Taylor expanded in a around inf 86.1%
if -1.45999999999999996e23 < z < -1.7999999999999999e-90Initial program 99.7%
sub-neg99.7%
+-commutative99.7%
neg-sub099.7%
associate-+l-99.7%
sub0-neg99.7%
neg-mul-199.7%
sub-neg99.7%
+-commutative99.7%
neg-sub099.7%
associate-+l-99.7%
sub0-neg99.7%
neg-mul-199.7%
times-frac99.7%
metadata-eval99.7%
*-lft-identity99.7%
*-commutative99.7%
Simplified99.7%
Taylor expanded in a around 0 78.4%
associate-*r/78.4%
neg-mul-178.4%
neg-sub078.4%
sub-neg78.4%
+-commutative78.4%
associate--r+78.4%
neg-sub078.4%
remove-double-neg78.4%
*-commutative78.4%
Simplified78.4%
if -1.7999999999999999e-90 < z < 2.2e10Initial program 99.9%
sub-neg99.9%
+-commutative99.9%
neg-sub099.9%
associate-+l-99.9%
sub0-neg99.9%
neg-mul-199.9%
sub-neg99.9%
+-commutative99.9%
neg-sub099.9%
associate-+l-99.9%
sub0-neg99.9%
neg-mul-199.9%
times-frac99.9%
metadata-eval99.9%
*-lft-identity99.9%
*-commutative99.9%
Simplified99.9%
Taylor expanded in y around 0 80.5%
neg-mul-180.5%
Simplified80.5%
if 2.2e10 < z < 7.80000000000000045e211 or 7.4999999999999998e267 < z Initial program 63.4%
sub-neg63.4%
+-commutative63.4%
neg-sub063.4%
associate-+l-63.4%
sub0-neg63.4%
neg-mul-163.4%
sub-neg63.4%
+-commutative63.4%
neg-sub063.4%
associate-+l-63.4%
sub0-neg63.4%
neg-mul-163.4%
times-frac63.4%
metadata-eval63.4%
*-lft-identity63.4%
*-commutative63.4%
Simplified63.4%
Taylor expanded in y around inf 51.8%
*-commutative51.8%
associate-*r/74.5%
*-commutative74.5%
Simplified74.5%
Final simplification81.1%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (/ (- y (/ x z)) a)) (t_2 (- (* z a) t)))
(if (<= z -6.9e+25)
t_1
(if (<= z -3.05e-90)
(/ (- x (* y z)) t)
(if (<= z 450000000.0)
(/ (- x) t_2)
(if (<= z 5.2e+212)
(/ y (/ t_2 z))
(if (<= z 4.1e+268) t_1 (* y (/ z t_2)))))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = (y - (x / z)) / a;
double t_2 = (z * a) - t;
double tmp;
if (z <= -6.9e+25) {
tmp = t_1;
} else if (z <= -3.05e-90) {
tmp = (x - (y * z)) / t;
} else if (z <= 450000000.0) {
tmp = -x / t_2;
} else if (z <= 5.2e+212) {
tmp = y / (t_2 / z);
} else if (z <= 4.1e+268) {
tmp = t_1;
} else {
tmp = y * (z / 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 = (y - (x / z)) / a
t_2 = (z * a) - t
if (z <= (-6.9d+25)) then
tmp = t_1
else if (z <= (-3.05d-90)) then
tmp = (x - (y * z)) / t
else if (z <= 450000000.0d0) then
tmp = -x / t_2
else if (z <= 5.2d+212) then
tmp = y / (t_2 / z)
else if (z <= 4.1d+268) then
tmp = t_1
else
tmp = y * (z / 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 = (y - (x / z)) / a;
double t_2 = (z * a) - t;
double tmp;
if (z <= -6.9e+25) {
tmp = t_1;
} else if (z <= -3.05e-90) {
tmp = (x - (y * z)) / t;
} else if (z <= 450000000.0) {
tmp = -x / t_2;
} else if (z <= 5.2e+212) {
tmp = y / (t_2 / z);
} else if (z <= 4.1e+268) {
tmp = t_1;
} else {
tmp = y * (z / t_2);
}
return tmp;
}
def code(x, y, z, t, a): t_1 = (y - (x / z)) / a t_2 = (z * a) - t tmp = 0 if z <= -6.9e+25: tmp = t_1 elif z <= -3.05e-90: tmp = (x - (y * z)) / t elif z <= 450000000.0: tmp = -x / t_2 elif z <= 5.2e+212: tmp = y / (t_2 / z) elif z <= 4.1e+268: tmp = t_1 else: tmp = y * (z / t_2) return tmp
function code(x, y, z, t, a) t_1 = Float64(Float64(y - Float64(x / z)) / a) t_2 = Float64(Float64(z * a) - t) tmp = 0.0 if (z <= -6.9e+25) tmp = t_1; elseif (z <= -3.05e-90) tmp = Float64(Float64(x - Float64(y * z)) / t); elseif (z <= 450000000.0) tmp = Float64(Float64(-x) / t_2); elseif (z <= 5.2e+212) tmp = Float64(y / Float64(t_2 / z)); elseif (z <= 4.1e+268) tmp = t_1; else tmp = Float64(y * Float64(z / t_2)); end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = (y - (x / z)) / a; t_2 = (z * a) - t; tmp = 0.0; if (z <= -6.9e+25) tmp = t_1; elseif (z <= -3.05e-90) tmp = (x - (y * z)) / t; elseif (z <= 450000000.0) tmp = -x / t_2; elseif (z <= 5.2e+212) tmp = y / (t_2 / z); elseif (z <= 4.1e+268) tmp = t_1; else tmp = y * (z / t_2); 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[(N[(z * a), $MachinePrecision] - t), $MachinePrecision]}, If[LessEqual[z, -6.9e+25], t$95$1, If[LessEqual[z, -3.05e-90], N[(N[(x - N[(y * z), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision], If[LessEqual[z, 450000000.0], N[((-x) / t$95$2), $MachinePrecision], If[LessEqual[z, 5.2e+212], N[(y / N[(t$95$2 / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 4.1e+268], t$95$1, N[(y * N[(z / t$95$2), $MachinePrecision]), $MachinePrecision]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{y - \frac{x}{z}}{a}\\
t_2 := z \cdot a - t\\
\mathbf{if}\;z \leq -6.9 \cdot 10^{+25}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq -3.05 \cdot 10^{-90}:\\
\;\;\;\;\frac{x - y \cdot z}{t}\\
\mathbf{elif}\;z \leq 450000000:\\
\;\;\;\;\frac{-x}{t_2}\\
\mathbf{elif}\;z \leq 5.2 \cdot 10^{+212}:\\
\;\;\;\;\frac{y}{\frac{t_2}{z}}\\
\mathbf{elif}\;z \leq 4.1 \cdot 10^{+268}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;y \cdot \frac{z}{t_2}\\
\end{array}
\end{array}
if z < -6.8999999999999998e25 or 5.1999999999999997e212 < z < 4.1000000000000001e268Initial program 66.7%
sub-neg66.7%
+-commutative66.7%
neg-sub066.7%
associate-+l-66.7%
sub0-neg66.7%
neg-mul-166.7%
sub-neg66.7%
+-commutative66.7%
neg-sub066.7%
associate-+l-66.7%
sub0-neg66.7%
neg-mul-166.7%
times-frac66.7%
metadata-eval66.7%
*-lft-identity66.7%
*-commutative66.7%
Simplified66.7%
Taylor expanded in z around inf 65.4%
mul-1-neg65.4%
+-commutative65.4%
associate--l+65.4%
associate-/r*64.9%
distribute-neg-frac64.9%
mul-1-neg64.9%
associate-/r*62.0%
associate-*r/62.0%
div-sub62.0%
distribute-lft-out--62.0%
associate-*r/62.0%
Simplified70.3%
Taylor expanded in a around inf 86.1%
if -6.8999999999999998e25 < z < -3.05e-90Initial program 99.7%
sub-neg99.7%
+-commutative99.7%
neg-sub099.7%
associate-+l-99.7%
sub0-neg99.7%
neg-mul-199.7%
sub-neg99.7%
+-commutative99.7%
neg-sub099.7%
associate-+l-99.7%
sub0-neg99.7%
neg-mul-199.7%
times-frac99.7%
metadata-eval99.7%
*-lft-identity99.7%
*-commutative99.7%
Simplified99.7%
Taylor expanded in a around 0 78.4%
associate-*r/78.4%
neg-mul-178.4%
neg-sub078.4%
sub-neg78.4%
+-commutative78.4%
associate--r+78.4%
neg-sub078.4%
remove-double-neg78.4%
*-commutative78.4%
Simplified78.4%
if -3.05e-90 < z < 4.5e8Initial program 99.9%
sub-neg99.9%
+-commutative99.9%
neg-sub099.9%
associate-+l-99.9%
sub0-neg99.9%
neg-mul-199.9%
sub-neg99.9%
+-commutative99.9%
neg-sub099.9%
associate-+l-99.9%
sub0-neg99.9%
neg-mul-199.9%
times-frac99.9%
metadata-eval99.9%
*-lft-identity99.9%
*-commutative99.9%
Simplified99.9%
Taylor expanded in y around 0 80.5%
neg-mul-180.5%
Simplified80.5%
if 4.5e8 < z < 5.1999999999999997e212Initial program 79.4%
sub-neg79.4%
+-commutative79.4%
neg-sub079.4%
associate-+l-79.4%
sub0-neg79.4%
neg-mul-179.4%
sub-neg79.4%
+-commutative79.4%
neg-sub079.4%
associate-+l-79.4%
sub0-neg79.4%
neg-mul-179.4%
times-frac79.4%
metadata-eval79.4%
*-lft-identity79.4%
*-commutative79.4%
Simplified79.4%
Taylor expanded in y around inf 64.6%
associate-/l*76.3%
Simplified76.3%
if 4.1000000000000001e268 < z Initial program 5.0%
sub-neg5.0%
+-commutative5.0%
neg-sub05.0%
associate-+l-5.0%
sub0-neg5.0%
neg-mul-15.0%
sub-neg5.0%
+-commutative5.0%
neg-sub05.0%
associate-+l-5.0%
sub0-neg5.0%
neg-mul-15.0%
times-frac5.0%
metadata-eval5.0%
*-lft-identity5.0%
*-commutative5.0%
Simplified5.0%
Taylor expanded in y around inf 5.0%
*-commutative5.0%
associate-*r/68.0%
*-commutative68.0%
Simplified68.0%
Final simplification81.1%
(FPCore (x y z t a)
:precision binary64
(if (or (<= z -2.3e+23)
(and (not (<= z 3.5e-30))
(or (<= z 580000000000.0) (not (<= z 1.15e+118)))))
(/ (- y (/ x z)) a)
(/ (- x (* y z)) t)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -2.3e+23) || (!(z <= 3.5e-30) && ((z <= 580000000000.0) || !(z <= 1.15e+118)))) {
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 <= (-2.3d+23)) .or. (.not. (z <= 3.5d-30)) .and. (z <= 580000000000.0d0) .or. (.not. (z <= 1.15d+118))) 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 <= -2.3e+23) || (!(z <= 3.5e-30) && ((z <= 580000000000.0) || !(z <= 1.15e+118)))) {
tmp = (y - (x / z)) / a;
} else {
tmp = (x - (y * z)) / t;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -2.3e+23) or (not (z <= 3.5e-30) and ((z <= 580000000000.0) or not (z <= 1.15e+118))): 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 <= -2.3e+23) || (!(z <= 3.5e-30) && ((z <= 580000000000.0) || !(z <= 1.15e+118)))) 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 <= -2.3e+23) || (~((z <= 3.5e-30)) && ((z <= 580000000000.0) || ~((z <= 1.15e+118))))) 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, -2.3e+23], And[N[Not[LessEqual[z, 3.5e-30]], $MachinePrecision], Or[LessEqual[z, 580000000000.0], N[Not[LessEqual[z, 1.15e+118]], $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 -2.3 \cdot 10^{+23} \lor \neg \left(z \leq 3.5 \cdot 10^{-30}\right) \land \left(z \leq 580000000000 \lor \neg \left(z \leq 1.15 \cdot 10^{+118}\right)\right):\\
\;\;\;\;\frac{y - \frac{x}{z}}{a}\\
\mathbf{else}:\\
\;\;\;\;\frac{x - y \cdot z}{t}\\
\end{array}
\end{array}
if z < -2.3e23 or 3.5000000000000003e-30 < z < 5.8e11 or 1.15000000000000008e118 < z Initial program 65.0%
sub-neg65.0%
+-commutative65.0%
neg-sub065.0%
associate-+l-65.0%
sub0-neg65.0%
neg-mul-165.0%
sub-neg65.0%
+-commutative65.0%
neg-sub065.0%
associate-+l-65.0%
sub0-neg65.0%
neg-mul-165.0%
times-frac65.0%
metadata-eval65.0%
*-lft-identity65.0%
*-commutative65.0%
Simplified65.0%
Taylor expanded in z around inf 65.3%
mul-1-neg65.3%
+-commutative65.3%
associate--l+65.3%
associate-/r*65.0%
distribute-neg-frac65.0%
mul-1-neg65.0%
associate-/r*62.9%
associate-*r/62.9%
div-sub62.9%
distribute-lft-out--62.9%
associate-*r/62.9%
Simplified68.7%
Taylor expanded in a around inf 81.4%
if -2.3e23 < z < 3.5000000000000003e-30 or 5.8e11 < z < 1.15000000000000008e118Initial program 99.1%
sub-neg99.1%
+-commutative99.1%
neg-sub099.1%
associate-+l-99.1%
sub0-neg99.1%
neg-mul-199.1%
sub-neg99.1%
+-commutative99.1%
neg-sub099.1%
associate-+l-99.1%
sub0-neg99.1%
neg-mul-199.1%
times-frac99.1%
metadata-eval99.1%
*-lft-identity99.1%
*-commutative99.1%
Simplified99.1%
Taylor expanded in a around 0 75.4%
associate-*r/75.4%
neg-mul-175.4%
neg-sub075.4%
sub-neg75.4%
+-commutative75.4%
associate--r+75.4%
neg-sub075.4%
remove-double-neg75.4%
*-commutative75.4%
Simplified75.4%
Final simplification78.2%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (/ (- y (/ x z)) a)))
(if (<= z -1.4e+26)
t_1
(if (<= z -7.2e-90)
(/ (- x (* y z)) t)
(if (<= z 1.52e-24) (/ (- x) (- (* 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 <= -1.4e+26) {
tmp = t_1;
} else if (z <= -7.2e-90) {
tmp = (x - (y * z)) / t;
} else if (z <= 1.52e-24) {
tmp = -x / ((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 <= (-1.4d+26)) then
tmp = t_1
else if (z <= (-7.2d-90)) then
tmp = (x - (y * z)) / t
else if (z <= 1.52d-24) then
tmp = -x / ((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 <= -1.4e+26) {
tmp = t_1;
} else if (z <= -7.2e-90) {
tmp = (x - (y * z)) / t;
} else if (z <= 1.52e-24) {
tmp = -x / ((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 <= -1.4e+26: tmp = t_1 elif z <= -7.2e-90: tmp = (x - (y * z)) / t elif z <= 1.52e-24: tmp = -x / ((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 <= -1.4e+26) tmp = t_1; elseif (z <= -7.2e-90) tmp = Float64(Float64(x - Float64(y * z)) / t); elseif (z <= 1.52e-24) tmp = Float64(Float64(-x) / 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 <= -1.4e+26) tmp = t_1; elseif (z <= -7.2e-90) tmp = (x - (y * z)) / t; elseif (z <= 1.52e-24) tmp = -x / ((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, -1.4e+26], t$95$1, If[LessEqual[z, -7.2e-90], N[(N[(x - N[(y * z), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision], If[LessEqual[z, 1.52e-24], N[((-x) / N[(N[(z * a), $MachinePrecision] - t), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{y - \frac{x}{z}}{a}\\
\mathbf{if}\;z \leq -1.4 \cdot 10^{+26}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq -7.2 \cdot 10^{-90}:\\
\;\;\;\;\frac{x - y \cdot z}{t}\\
\mathbf{elif}\;z \leq 1.52 \cdot 10^{-24}:\\
\;\;\;\;\frac{-x}{z \cdot a - t}\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if z < -1.4e26 or 1.51999999999999992e-24 < z Initial program 67.4%
sub-neg67.4%
+-commutative67.4%
neg-sub067.4%
associate-+l-67.4%
sub0-neg67.4%
neg-mul-167.4%
sub-neg67.4%
+-commutative67.4%
neg-sub067.4%
associate-+l-67.4%
sub0-neg67.4%
neg-mul-167.4%
times-frac67.4%
metadata-eval67.4%
*-lft-identity67.4%
*-commutative67.4%
Simplified67.4%
Taylor expanded in z around inf 60.3%
mul-1-neg60.3%
+-commutative60.3%
associate--l+60.3%
associate-/r*60.0%
distribute-neg-frac60.0%
mul-1-neg60.0%
associate-/r*58.1%
associate-*r/58.1%
div-sub58.1%
distribute-lft-out--58.1%
associate-*r/58.1%
Simplified64.8%
Taylor expanded in a around inf 76.8%
if -1.4e26 < z < -7.19999999999999961e-90Initial program 99.7%
sub-neg99.7%
+-commutative99.7%
neg-sub099.7%
associate-+l-99.7%
sub0-neg99.7%
neg-mul-199.7%
sub-neg99.7%
+-commutative99.7%
neg-sub099.7%
associate-+l-99.7%
sub0-neg99.7%
neg-mul-199.7%
times-frac99.7%
metadata-eval99.7%
*-lft-identity99.7%
*-commutative99.7%
Simplified99.7%
Taylor expanded in a around 0 78.4%
associate-*r/78.4%
neg-mul-178.4%
neg-sub078.4%
sub-neg78.4%
+-commutative78.4%
associate--r+78.4%
neg-sub078.4%
remove-double-neg78.4%
*-commutative78.4%
Simplified78.4%
if -7.19999999999999961e-90 < z < 1.51999999999999992e-24Initial program 99.9%
sub-neg99.9%
+-commutative99.9%
neg-sub099.9%
associate-+l-99.9%
sub0-neg99.9%
neg-mul-199.9%
sub-neg99.9%
+-commutative99.9%
neg-sub099.9%
associate-+l-99.9%
sub0-neg99.9%
neg-mul-199.9%
times-frac99.9%
metadata-eval99.9%
*-lft-identity99.9%
*-commutative99.9%
Simplified99.9%
Taylor expanded in y around 0 82.1%
neg-mul-182.1%
Simplified82.1%
Final simplification79.0%
(FPCore (x y z t a) :precision binary64 (if (<= z -3.8e+38) (/ y a) (if (<= z 1.4e+118) (/ (- x (* y z)) t) (/ y a))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -3.8e+38) {
tmp = y / a;
} else if (z <= 1.4e+118) {
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 <= (-3.8d+38)) then
tmp = y / a
else if (z <= 1.4d+118) 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 <= -3.8e+38) {
tmp = y / a;
} else if (z <= 1.4e+118) {
tmp = (x - (y * z)) / t;
} else {
tmp = y / a;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -3.8e+38: tmp = y / a elif z <= 1.4e+118: tmp = (x - (y * z)) / t else: tmp = y / a return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -3.8e+38) tmp = Float64(y / a); elseif (z <= 1.4e+118) 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 <= -3.8e+38) tmp = y / a; elseif (z <= 1.4e+118) tmp = (x - (y * z)) / t; else tmp = y / a; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -3.8e+38], N[(y / a), $MachinePrecision], If[LessEqual[z, 1.4e+118], N[(N[(x - N[(y * z), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision], N[(y / a), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -3.8 \cdot 10^{+38}:\\
\;\;\;\;\frac{y}{a}\\
\mathbf{elif}\;z \leq 1.4 \cdot 10^{+118}:\\
\;\;\;\;\frac{x - y \cdot z}{t}\\
\mathbf{else}:\\
\;\;\;\;\frac{y}{a}\\
\end{array}
\end{array}
if z < -3.7999999999999998e38 or 1.39999999999999993e118 < z Initial program 61.5%
sub-neg61.5%
+-commutative61.5%
neg-sub061.5%
associate-+l-61.5%
sub0-neg61.5%
neg-mul-161.5%
sub-neg61.5%
+-commutative61.5%
neg-sub061.5%
associate-+l-61.5%
sub0-neg61.5%
neg-mul-161.5%
times-frac61.5%
metadata-eval61.5%
*-lft-identity61.5%
*-commutative61.5%
Simplified61.5%
Taylor expanded in z around inf 64.2%
if -3.7999999999999998e38 < z < 1.39999999999999993e118Initial program 99.2%
sub-neg99.2%
+-commutative99.2%
neg-sub099.2%
associate-+l-99.2%
sub0-neg99.2%
neg-mul-199.2%
sub-neg99.2%
+-commutative99.2%
neg-sub099.2%
associate-+l-99.2%
sub0-neg99.2%
neg-mul-199.2%
times-frac99.2%
metadata-eval99.2%
*-lft-identity99.2%
*-commutative99.2%
Simplified99.2%
Taylor expanded in a around 0 71.4%
associate-*r/71.4%
neg-mul-171.4%
neg-sub071.4%
sub-neg71.4%
+-commutative71.4%
associate--r+71.4%
neg-sub071.4%
remove-double-neg71.4%
*-commutative71.4%
Simplified71.4%
Final simplification68.3%
(FPCore (x y z t a) :precision binary64 (if (<= z -1.1e+25) (/ y a) (if (<= z 3.9e-25) (/ x t) (/ y a))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -1.1e+25) {
tmp = y / a;
} else if (z <= 3.9e-25) {
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.1d+25)) then
tmp = y / a
else if (z <= 3.9d-25) 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.1e+25) {
tmp = y / a;
} else if (z <= 3.9e-25) {
tmp = x / t;
} else {
tmp = y / a;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -1.1e+25: tmp = y / a elif z <= 3.9e-25: tmp = x / t else: tmp = y / a return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -1.1e+25) tmp = Float64(y / a); elseif (z <= 3.9e-25) 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.1e+25) tmp = y / a; elseif (z <= 3.9e-25) tmp = x / t; else tmp = y / a; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -1.1e+25], N[(y / a), $MachinePrecision], If[LessEqual[z, 3.9e-25], N[(x / t), $MachinePrecision], N[(y / a), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.1 \cdot 10^{+25}:\\
\;\;\;\;\frac{y}{a}\\
\mathbf{elif}\;z \leq 3.9 \cdot 10^{-25}:\\
\;\;\;\;\frac{x}{t}\\
\mathbf{else}:\\
\;\;\;\;\frac{y}{a}\\
\end{array}
\end{array}
if z < -1.1e25 or 3.9e-25 < z Initial program 67.4%
sub-neg67.4%
+-commutative67.4%
neg-sub067.4%
associate-+l-67.4%
sub0-neg67.4%
neg-mul-167.4%
sub-neg67.4%
+-commutative67.4%
neg-sub067.4%
associate-+l-67.4%
sub0-neg67.4%
neg-mul-167.4%
times-frac67.4%
metadata-eval67.4%
*-lft-identity67.4%
*-commutative67.4%
Simplified67.4%
Taylor expanded in z around inf 59.8%
if -1.1e25 < z < 3.9e-25Initial program 99.9%
sub-neg99.9%
+-commutative99.9%
neg-sub099.9%
associate-+l-99.9%
sub0-neg99.9%
neg-mul-199.9%
sub-neg99.9%
+-commutative99.9%
neg-sub099.9%
associate-+l-99.9%
sub0-neg99.9%
neg-mul-199.9%
times-frac99.9%
metadata-eval99.9%
*-lft-identity99.9%
*-commutative99.9%
Simplified99.9%
Taylor expanded in z around 0 57.3%
Final simplification58.6%
(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 83.1%
sub-neg83.1%
+-commutative83.1%
neg-sub083.1%
associate-+l-83.1%
sub0-neg83.1%
neg-mul-183.1%
sub-neg83.1%
+-commutative83.1%
neg-sub083.1%
associate-+l-83.1%
sub0-neg83.1%
neg-mul-183.1%
times-frac83.1%
metadata-eval83.1%
*-lft-identity83.1%
*-commutative83.1%
Simplified83.1%
Taylor expanded in z around 0 31.7%
Final simplification31.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 2023252
(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))))