
(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 (- (* z a) t))
(t_2 (- (/ y (/ t_1 z)) (/ x t_1)))
(t_3 (/ (- x (* y z)) (- t (* z a)))))
(if (<= t_3 -5e-297)
t_2
(if (<= t_3 0.0)
(- (/ y a) (/ (/ x a) z))
(if (<= t_3 INFINITY) t_2 (/ y a))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = (z * a) - t;
double t_2 = (y / (t_1 / z)) - (x / t_1);
double t_3 = (x - (y * z)) / (t - (z * a));
double tmp;
if (t_3 <= -5e-297) {
tmp = t_2;
} else if (t_3 <= 0.0) {
tmp = (y / a) - ((x / a) / z);
} else if (t_3 <= ((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 = (z * a) - t;
double t_2 = (y / (t_1 / z)) - (x / t_1);
double t_3 = (x - (y * z)) / (t - (z * a));
double tmp;
if (t_3 <= -5e-297) {
tmp = t_2;
} else if (t_3 <= 0.0) {
tmp = (y / a) - ((x / a) / z);
} else if (t_3 <= Double.POSITIVE_INFINITY) {
tmp = t_2;
} else {
tmp = y / a;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = (z * a) - t t_2 = (y / (t_1 / z)) - (x / t_1) t_3 = (x - (y * z)) / (t - (z * a)) tmp = 0 if t_3 <= -5e-297: tmp = t_2 elif t_3 <= 0.0: tmp = (y / a) - ((x / a) / z) elif t_3 <= math.inf: tmp = t_2 else: tmp = y / a return tmp
function code(x, y, z, t, a) t_1 = Float64(Float64(z * a) - t) t_2 = Float64(Float64(y / Float64(t_1 / z)) - Float64(x / t_1)) t_3 = Float64(Float64(x - Float64(y * z)) / Float64(t - Float64(z * a))) tmp = 0.0 if (t_3 <= -5e-297) tmp = t_2; elseif (t_3 <= 0.0) tmp = Float64(Float64(y / a) - Float64(Float64(x / a) / z)); elseif (t_3 <= Inf) tmp = t_2; else tmp = Float64(y / a); end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = (z * a) - t; t_2 = (y / (t_1 / z)) - (x / t_1); t_3 = (x - (y * z)) / (t - (z * a)); tmp = 0.0; if (t_3 <= -5e-297) tmp = t_2; elseif (t_3 <= 0.0) tmp = (y / a) - ((x / a) / z); elseif (t_3 <= Inf) tmp = t_2; else tmp = y / a; end tmp_2 = 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[(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] / N[(t - N[(z * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$3, -5e-297], t$95$2, If[LessEqual[t$95$3, 0.0], N[(N[(y / a), $MachinePrecision] - N[(N[(x / a), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$3, Infinity], t$95$2, N[(y / a), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := z \cdot a - t\\
t_2 := \frac{y}{\frac{t_1}{z}} - \frac{x}{t_1}\\
t_3 := \frac{x - y \cdot z}{t - z \cdot a}\\
\mathbf{if}\;t_3 \leq -5 \cdot 10^{-297}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;t_3 \leq 0:\\
\;\;\;\;\frac{y}{a} - \frac{\frac{x}{a}}{z}\\
\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))) < -5e-297 or 0.0 < (/.f64 (-.f64 x (*.f64 y z)) (-.f64 t (*.f64 a z))) < +inf.0Initial program 89.8%
sub-neg89.8%
+-commutative89.8%
neg-sub089.8%
associate-+l-89.8%
sub0-neg89.8%
neg-mul-189.8%
sub-neg89.8%
+-commutative89.8%
neg-sub089.8%
associate-+l-89.8%
sub0-neg89.8%
neg-mul-189.8%
times-frac89.8%
metadata-eval89.8%
*-lft-identity89.8%
*-commutative89.8%
Simplified89.8%
div-sub89.4%
associate-/l*96.9%
Applied egg-rr96.9%
if -5e-297 < (/.f64 (-.f64 x (*.f64 y z)) (-.f64 t (*.f64 a z))) < 0.0Initial program 57.9%
sub-neg57.9%
+-commutative57.9%
neg-sub057.9%
associate-+l-57.9%
sub0-neg57.9%
neg-mul-157.9%
sub-neg57.9%
+-commutative57.9%
neg-sub057.9%
associate-+l-57.9%
sub0-neg57.9%
neg-mul-157.9%
times-frac57.9%
metadata-eval57.9%
*-lft-identity57.9%
*-commutative57.9%
Simplified57.9%
Taylor expanded in z around inf 51.8%
mul-1-neg51.8%
+-commutative51.8%
associate--l+51.8%
associate-/r*75.4%
distribute-neg-frac75.4%
mul-1-neg75.4%
associate-/r*75.4%
associate-*r/75.4%
div-sub75.4%
distribute-lft-out--75.4%
associate-*r/75.4%
Simplified78.1%
Taylor expanded in x around inf 78.5%
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 simplification94.5%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (/ (- x (* y z)) (- t (* z a)))))
(if (<= t_1 (- INFINITY))
(/ y (/ (- (* z a) t) z))
(if (<= t_1 -2e-298)
t_1
(if (<= t_1 0.0)
(- (/ y a) (/ (/ x a) z))
(if (<= t_1 5e+288) 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 = y / (((z * a) - t) / z);
} else if (t_1 <= -2e-298) {
tmp = t_1;
} else if (t_1 <= 0.0) {
tmp = (y / a) - ((x / a) / z);
} else if (t_1 <= 5e+288) {
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 = y / (((z * a) - t) / z);
} else if (t_1 <= -2e-298) {
tmp = t_1;
} else if (t_1 <= 0.0) {
tmp = (y / a) - ((x / a) / z);
} else if (t_1 <= 5e+288) {
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 = y / (((z * a) - t) / z) elif t_1 <= -2e-298: tmp = t_1 elif t_1 <= 0.0: tmp = (y / a) - ((x / a) / z) elif t_1 <= 5e+288: 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(y / Float64(Float64(Float64(z * a) - t) / z)); elseif (t_1 <= -2e-298) tmp = t_1; elseif (t_1 <= 0.0) tmp = Float64(Float64(y / a) - Float64(Float64(x / a) / z)); elseif (t_1 <= 5e+288) 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 = y / (((z * a) - t) / z); elseif (t_1 <= -2e-298) tmp = t_1; elseif (t_1 <= 0.0) tmp = (y / a) - ((x / a) / z); elseif (t_1 <= 5e+288) 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[(y / N[(N[(N[(z * a), $MachinePrecision] - t), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, -2e-298], 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, 5e+288], 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{y}{\frac{z \cdot a - t}{z}}\\
\mathbf{elif}\;t_1 \leq -2 \cdot 10^{-298}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;t_1 \leq 0:\\
\;\;\;\;\frac{y}{a} - \frac{\frac{x}{a}}{z}\\
\mathbf{elif}\;t_1 \leq 5 \cdot 10^{+288}:\\
\;\;\;\;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 40.4%
sub-neg40.4%
+-commutative40.4%
neg-sub040.4%
associate-+l-40.4%
sub0-neg40.4%
neg-mul-140.4%
sub-neg40.4%
+-commutative40.4%
neg-sub040.4%
associate-+l-40.4%
sub0-neg40.4%
neg-mul-140.4%
times-frac40.4%
metadata-eval40.4%
*-lft-identity40.4%
*-commutative40.4%
Simplified40.4%
Taylor expanded in y around inf 19.7%
associate-/l*79.2%
Simplified79.2%
if -inf.0 < (/.f64 (-.f64 x (*.f64 y z)) (-.f64 t (*.f64 a z))) < -1.99999999999999982e-298 or 0.0 < (/.f64 (-.f64 x (*.f64 y z)) (-.f64 t (*.f64 a z))) < 5.0000000000000003e288Initial program 99.7%
if -1.99999999999999982e-298 < (/.f64 (-.f64 x (*.f64 y z)) (-.f64 t (*.f64 a z))) < 0.0Initial program 56.7%
sub-neg56.7%
+-commutative56.7%
neg-sub056.7%
associate-+l-56.7%
sub0-neg56.7%
neg-mul-156.7%
sub-neg56.7%
+-commutative56.7%
neg-sub056.7%
associate-+l-56.7%
sub0-neg56.7%
neg-mul-156.7%
times-frac56.7%
metadata-eval56.7%
*-lft-identity56.7%
*-commutative56.7%
Simplified56.7%
Taylor expanded in z around inf 50.5%
mul-1-neg50.5%
+-commutative50.5%
associate--l+50.5%
associate-/r*74.8%
distribute-neg-frac74.8%
mul-1-neg74.8%
associate-/r*74.8%
associate-*r/74.8%
div-sub74.8%
distribute-lft-out--74.8%
associate-*r/74.8%
Simplified77.5%
Taylor expanded in x around inf 77.9%
if 5.0000000000000003e288 < (/.f64 (-.f64 x (*.f64 y z)) (-.f64 t (*.f64 a z))) Initial program 34.1%
sub-neg34.1%
+-commutative34.1%
neg-sub034.1%
associate-+l-34.1%
sub0-neg34.1%
neg-mul-134.1%
sub-neg34.1%
+-commutative34.1%
neg-sub034.1%
associate-+l-34.1%
sub0-neg34.1%
neg-mul-134.1%
times-frac34.1%
metadata-eval34.1%
*-lft-identity34.1%
*-commutative34.1%
Simplified34.1%
div-sub34.1%
associate-/l*65.4%
Applied egg-rr65.4%
Taylor expanded in a around inf 74.9%
Final simplification92.2%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (- (* z a) t)) (t_2 (/ y (/ t_1 z))) (t_3 (/ (- y (/ x z)) a)))
(if (<= z -4.5e+219)
t_3
(if (<= z -7.5e+137)
t_2
(if (<= z -7000000000.0)
t_3
(if (<= z 1.55e-148)
(/ (- x) t_1)
(if (<= z 6.6e-89)
(/ (- x (* y z)) t)
(if (or (<= z 26500000000000.0) (not (<= z 1.4e+123)))
t_3
t_2))))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = (z * a) - t;
double t_2 = y / (t_1 / z);
double t_3 = (y - (x / z)) / a;
double tmp;
if (z <= -4.5e+219) {
tmp = t_3;
} else if (z <= -7.5e+137) {
tmp = t_2;
} else if (z <= -7000000000.0) {
tmp = t_3;
} else if (z <= 1.55e-148) {
tmp = -x / t_1;
} else if (z <= 6.6e-89) {
tmp = (x - (y * z)) / t;
} else if ((z <= 26500000000000.0) || !(z <= 1.4e+123)) {
tmp = t_3;
} 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) :: t_3
real(8) :: tmp
t_1 = (z * a) - t
t_2 = y / (t_1 / z)
t_3 = (y - (x / z)) / a
if (z <= (-4.5d+219)) then
tmp = t_3
else if (z <= (-7.5d+137)) then
tmp = t_2
else if (z <= (-7000000000.0d0)) then
tmp = t_3
else if (z <= 1.55d-148) then
tmp = -x / t_1
else if (z <= 6.6d-89) then
tmp = (x - (y * z)) / t
else if ((z <= 26500000000000.0d0) .or. (.not. (z <= 1.4d+123))) then
tmp = t_3
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 = (z * a) - t;
double t_2 = y / (t_1 / z);
double t_3 = (y - (x / z)) / a;
double tmp;
if (z <= -4.5e+219) {
tmp = t_3;
} else if (z <= -7.5e+137) {
tmp = t_2;
} else if (z <= -7000000000.0) {
tmp = t_3;
} else if (z <= 1.55e-148) {
tmp = -x / t_1;
} else if (z <= 6.6e-89) {
tmp = (x - (y * z)) / t;
} else if ((z <= 26500000000000.0) || !(z <= 1.4e+123)) {
tmp = t_3;
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = (z * a) - t t_2 = y / (t_1 / z) t_3 = (y - (x / z)) / a tmp = 0 if z <= -4.5e+219: tmp = t_3 elif z <= -7.5e+137: tmp = t_2 elif z <= -7000000000.0: tmp = t_3 elif z <= 1.55e-148: tmp = -x / t_1 elif z <= 6.6e-89: tmp = (x - (y * z)) / t elif (z <= 26500000000000.0) or not (z <= 1.4e+123): tmp = t_3 else: tmp = t_2 return tmp
function code(x, y, z, t, a) t_1 = Float64(Float64(z * a) - t) t_2 = Float64(y / Float64(t_1 / z)) t_3 = Float64(Float64(y - Float64(x / z)) / a) tmp = 0.0 if (z <= -4.5e+219) tmp = t_3; elseif (z <= -7.5e+137) tmp = t_2; elseif (z <= -7000000000.0) tmp = t_3; elseif (z <= 1.55e-148) tmp = Float64(Float64(-x) / t_1); elseif (z <= 6.6e-89) tmp = Float64(Float64(x - Float64(y * z)) / t); elseif ((z <= 26500000000000.0) || !(z <= 1.4e+123)) tmp = t_3; else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = (z * a) - t; t_2 = y / (t_1 / z); t_3 = (y - (x / z)) / a; tmp = 0.0; if (z <= -4.5e+219) tmp = t_3; elseif (z <= -7.5e+137) tmp = t_2; elseif (z <= -7000000000.0) tmp = t_3; elseif (z <= 1.55e-148) tmp = -x / t_1; elseif (z <= 6.6e-89) tmp = (x - (y * z)) / t; elseif ((z <= 26500000000000.0) || ~((z <= 1.4e+123))) tmp = t_3; else tmp = t_2; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(z * a), $MachinePrecision] - t), $MachinePrecision]}, Block[{t$95$2 = N[(y / N[(t$95$1 / z), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(N[(y - N[(x / z), $MachinePrecision]), $MachinePrecision] / a), $MachinePrecision]}, If[LessEqual[z, -4.5e+219], t$95$3, If[LessEqual[z, -7.5e+137], t$95$2, If[LessEqual[z, -7000000000.0], t$95$3, If[LessEqual[z, 1.55e-148], N[((-x) / t$95$1), $MachinePrecision], If[LessEqual[z, 6.6e-89], N[(N[(x - N[(y * z), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision], If[Or[LessEqual[z, 26500000000000.0], N[Not[LessEqual[z, 1.4e+123]], $MachinePrecision]], t$95$3, t$95$2]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := z \cdot a - t\\
t_2 := \frac{y}{\frac{t_1}{z}}\\
t_3 := \frac{y - \frac{x}{z}}{a}\\
\mathbf{if}\;z \leq -4.5 \cdot 10^{+219}:\\
\;\;\;\;t_3\\
\mathbf{elif}\;z \leq -7.5 \cdot 10^{+137}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;z \leq -7000000000:\\
\;\;\;\;t_3\\
\mathbf{elif}\;z \leq 1.55 \cdot 10^{-148}:\\
\;\;\;\;\frac{-x}{t_1}\\
\mathbf{elif}\;z \leq 6.6 \cdot 10^{-89}:\\
\;\;\;\;\frac{x - y \cdot z}{t}\\
\mathbf{elif}\;z \leq 26500000000000 \lor \neg \left(z \leq 1.4 \cdot 10^{+123}\right):\\
\;\;\;\;t_3\\
\mathbf{else}:\\
\;\;\;\;t_2\\
\end{array}
\end{array}
if z < -4.50000000000000023e219 or -7.50000000000000025e137 < z < -7e9 or 6.5999999999999993e-89 < z < 2.65e13 or 1.40000000000000006e123 < z Initial program 70.5%
sub-neg70.5%
+-commutative70.5%
neg-sub070.5%
associate-+l-70.5%
sub0-neg70.5%
neg-mul-170.5%
sub-neg70.5%
+-commutative70.5%
neg-sub070.5%
associate-+l-70.5%
sub0-neg70.5%
neg-mul-170.5%
times-frac70.5%
metadata-eval70.5%
*-lft-identity70.5%
*-commutative70.5%
Simplified70.5%
div-sub69.7%
associate-/l*77.3%
Applied egg-rr77.3%
Taylor expanded in a around inf 76.3%
if -4.50000000000000023e219 < z < -7.50000000000000025e137 or 2.65e13 < z < 1.40000000000000006e123Initial program 59.5%
sub-neg59.5%
+-commutative59.5%
neg-sub059.5%
associate-+l-59.5%
sub0-neg59.5%
neg-mul-159.5%
sub-neg59.5%
+-commutative59.5%
neg-sub059.5%
associate-+l-59.5%
sub0-neg59.5%
neg-mul-159.5%
times-frac59.5%
metadata-eval59.5%
*-lft-identity59.5%
*-commutative59.5%
Simplified59.5%
Taylor expanded in y around inf 51.0%
associate-/l*82.6%
Simplified82.6%
if -7e9 < z < 1.5500000000000001e-148Initial program 99.8%
sub-neg99.8%
+-commutative99.8%
neg-sub099.8%
associate-+l-99.8%
sub0-neg99.8%
neg-mul-199.8%
sub-neg99.8%
+-commutative99.8%
neg-sub099.8%
associate-+l-99.8%
sub0-neg99.8%
neg-mul-199.8%
times-frac99.8%
metadata-eval99.8%
*-lft-identity99.8%
*-commutative99.8%
Simplified99.8%
Taylor expanded in y around 0 83.4%
neg-mul-183.4%
Simplified83.4%
if 1.5500000000000001e-148 < z < 6.5999999999999993e-89Initial program 100.0%
sub-neg100.0%
+-commutative100.0%
neg-sub0100.0%
associate-+l-100.0%
sub0-neg100.0%
neg-mul-1100.0%
sub-neg100.0%
+-commutative100.0%
neg-sub0100.0%
associate-+l-100.0%
sub0-neg100.0%
neg-mul-1100.0%
times-frac100.0%
metadata-eval100.0%
*-lft-identity100.0%
*-commutative100.0%
Simplified100.0%
Taylor expanded in a around 0 80.9%
associate-*r/80.9%
neg-mul-180.9%
neg-sub080.9%
sub-neg80.9%
+-commutative80.9%
associate--r+80.9%
neg-sub080.9%
remove-double-neg80.9%
*-commutative80.9%
Simplified80.9%
Final simplification80.0%
(FPCore (x y z t a)
:precision binary64
(if (<= z -6.5e+71)
(/ y a)
(if (or (<= z 6.6e-89) (and (not (<= z 1.05e-61)) (<= z 3.1e+123)))
(/ (- x (* y z)) t)
(/ y a))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -6.5e+71) {
tmp = y / a;
} else if ((z <= 6.6e-89) || (!(z <= 1.05e-61) && (z <= 3.1e+123))) {
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 <= (-6.5d+71)) then
tmp = y / a
else if ((z <= 6.6d-89) .or. (.not. (z <= 1.05d-61)) .and. (z <= 3.1d+123)) 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 <= -6.5e+71) {
tmp = y / a;
} else if ((z <= 6.6e-89) || (!(z <= 1.05e-61) && (z <= 3.1e+123))) {
tmp = (x - (y * z)) / t;
} else {
tmp = y / a;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -6.5e+71: tmp = y / a elif (z <= 6.6e-89) or (not (z <= 1.05e-61) and (z <= 3.1e+123)): tmp = (x - (y * z)) / t else: tmp = y / a return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -6.5e+71) tmp = Float64(y / a); elseif ((z <= 6.6e-89) || (!(z <= 1.05e-61) && (z <= 3.1e+123))) 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 <= -6.5e+71) tmp = y / a; elseif ((z <= 6.6e-89) || (~((z <= 1.05e-61)) && (z <= 3.1e+123))) tmp = (x - (y * z)) / t; else tmp = y / a; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -6.5e+71], N[(y / a), $MachinePrecision], If[Or[LessEqual[z, 6.6e-89], And[N[Not[LessEqual[z, 1.05e-61]], $MachinePrecision], LessEqual[z, 3.1e+123]]], N[(N[(x - N[(y * z), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision], N[(y / a), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -6.5 \cdot 10^{+71}:\\
\;\;\;\;\frac{y}{a}\\
\mathbf{elif}\;z \leq 6.6 \cdot 10^{-89} \lor \neg \left(z \leq 1.05 \cdot 10^{-61}\right) \land z \leq 3.1 \cdot 10^{+123}:\\
\;\;\;\;\frac{x - y \cdot z}{t}\\
\mathbf{else}:\\
\;\;\;\;\frac{y}{a}\\
\end{array}
\end{array}
if z < -6.49999999999999954e71 or 6.5999999999999993e-89 < z < 1.05e-61 or 3.10000000000000006e123 < z Initial program 59.4%
sub-neg59.4%
+-commutative59.4%
neg-sub059.4%
associate-+l-59.4%
sub0-neg59.4%
neg-mul-159.4%
sub-neg59.4%
+-commutative59.4%
neg-sub059.4%
associate-+l-59.4%
sub0-neg59.4%
neg-mul-159.4%
times-frac59.4%
metadata-eval59.4%
*-lft-identity59.4%
*-commutative59.4%
Simplified59.4%
Taylor expanded in z around inf 64.1%
if -6.49999999999999954e71 < z < 6.5999999999999993e-89 or 1.05e-61 < z < 3.10000000000000006e123Initial program 95.0%
sub-neg95.0%
+-commutative95.0%
neg-sub095.0%
associate-+l-95.0%
sub0-neg95.0%
neg-mul-195.0%
sub-neg95.0%
+-commutative95.0%
neg-sub095.0%
associate-+l-95.0%
sub0-neg95.0%
neg-mul-195.0%
times-frac95.0%
metadata-eval95.0%
*-lft-identity95.0%
*-commutative95.0%
Simplified95.0%
Taylor expanded in a around 0 67.0%
associate-*r/67.0%
neg-mul-167.0%
neg-sub067.0%
sub-neg67.0%
+-commutative67.0%
associate--r+67.0%
neg-sub067.0%
remove-double-neg67.0%
*-commutative67.0%
Simplified67.0%
Final simplification65.9%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (/ (- x (* y z)) t)) (t_2 (/ (- y (/ x z)) a)))
(if (<= a -9.5e+18)
t_2
(if (<= a -4.35e-103)
t_1
(if (<= a -2.3e-145)
(* y (/ z (- (* z a) t)))
(if (<= a 4.6e+111) t_1 t_2))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = (x - (y * z)) / t;
double t_2 = (y - (x / z)) / a;
double tmp;
if (a <= -9.5e+18) {
tmp = t_2;
} else if (a <= -4.35e-103) {
tmp = t_1;
} else if (a <= -2.3e-145) {
tmp = y * (z / ((z * a) - t));
} else if (a <= 4.6e+111) {
tmp = 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 = (x - (y * z)) / t
t_2 = (y - (x / z)) / a
if (a <= (-9.5d+18)) then
tmp = t_2
else if (a <= (-4.35d-103)) then
tmp = t_1
else if (a <= (-2.3d-145)) then
tmp = y * (z / ((z * a) - t))
else if (a <= 4.6d+111) then
tmp = 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 = (x - (y * z)) / t;
double t_2 = (y - (x / z)) / a;
double tmp;
if (a <= -9.5e+18) {
tmp = t_2;
} else if (a <= -4.35e-103) {
tmp = t_1;
} else if (a <= -2.3e-145) {
tmp = y * (z / ((z * a) - t));
} else if (a <= 4.6e+111) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = (x - (y * z)) / t t_2 = (y - (x / z)) / a tmp = 0 if a <= -9.5e+18: tmp = t_2 elif a <= -4.35e-103: tmp = t_1 elif a <= -2.3e-145: tmp = y * (z / ((z * a) - t)) elif a <= 4.6e+111: tmp = t_1 else: tmp = t_2 return tmp
function code(x, y, z, t, a) t_1 = Float64(Float64(x - Float64(y * z)) / t) t_2 = Float64(Float64(y - Float64(x / z)) / a) tmp = 0.0 if (a <= -9.5e+18) tmp = t_2; elseif (a <= -4.35e-103) tmp = t_1; elseif (a <= -2.3e-145) tmp = Float64(y * Float64(z / Float64(Float64(z * a) - t))); elseif (a <= 4.6e+111) tmp = t_1; else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = (x - (y * z)) / t; t_2 = (y - (x / z)) / a; tmp = 0.0; if (a <= -9.5e+18) tmp = t_2; elseif (a <= -4.35e-103) tmp = t_1; elseif (a <= -2.3e-145) tmp = y * (z / ((z * a) - t)); elseif (a <= 4.6e+111) tmp = t_1; else tmp = t_2; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(x - N[(y * z), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision]}, Block[{t$95$2 = N[(N[(y - N[(x / z), $MachinePrecision]), $MachinePrecision] / a), $MachinePrecision]}, If[LessEqual[a, -9.5e+18], t$95$2, If[LessEqual[a, -4.35e-103], t$95$1, If[LessEqual[a, -2.3e-145], N[(y * N[(z / N[(N[(z * a), $MachinePrecision] - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 4.6e+111], t$95$1, t$95$2]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{x - y \cdot z}{t}\\
t_2 := \frac{y - \frac{x}{z}}{a}\\
\mathbf{if}\;a \leq -9.5 \cdot 10^{+18}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;a \leq -4.35 \cdot 10^{-103}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;a \leq -2.3 \cdot 10^{-145}:\\
\;\;\;\;y \cdot \frac{z}{z \cdot a - t}\\
\mathbf{elif}\;a \leq 4.6 \cdot 10^{+111}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;t_2\\
\end{array}
\end{array}
if a < -9.5e18 or 4.60000000000000004e111 < a Initial program 70.2%
sub-neg70.2%
+-commutative70.2%
neg-sub070.2%
associate-+l-70.2%
sub0-neg70.2%
neg-mul-170.2%
sub-neg70.2%
+-commutative70.2%
neg-sub070.2%
associate-+l-70.2%
sub0-neg70.2%
neg-mul-170.2%
times-frac70.2%
metadata-eval70.2%
*-lft-identity70.2%
*-commutative70.2%
Simplified70.2%
div-sub70.2%
associate-/l*73.9%
Applied egg-rr73.9%
Taylor expanded in a around inf 77.1%
if -9.5e18 < a < -4.3499999999999998e-103 or -2.30000000000000007e-145 < a < 4.60000000000000004e111Initial program 91.4%
sub-neg91.4%
+-commutative91.4%
neg-sub091.4%
associate-+l-91.4%
sub0-neg91.4%
neg-mul-191.4%
sub-neg91.4%
+-commutative91.4%
neg-sub091.4%
associate-+l-91.4%
sub0-neg91.4%
neg-mul-191.4%
times-frac91.4%
metadata-eval91.4%
*-lft-identity91.4%
*-commutative91.4%
Simplified91.4%
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%
if -4.3499999999999998e-103 < a < -2.30000000000000007e-145Initial program 76.4%
sub-neg76.4%
+-commutative76.4%
neg-sub076.4%
associate-+l-76.4%
sub0-neg76.4%
neg-mul-176.4%
sub-neg76.4%
+-commutative76.4%
neg-sub076.4%
associate-+l-76.4%
sub0-neg76.4%
neg-mul-176.4%
times-frac76.4%
metadata-eval76.4%
*-lft-identity76.4%
*-commutative76.4%
Simplified76.4%
Taylor expanded in y around inf 52.7%
*-commutative52.7%
associate-*r/75.9%
*-commutative75.9%
Simplified75.9%
Final simplification74.1%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (/ (- x (* y z)) t)))
(if (<= a -2.9e+19)
(- (/ y a) (/ (/ x a) z))
(if (<= a -2.7e-103)
t_1
(if (<= a -2.35e-145)
(* y (/ z (- (* z a) t)))
(if (<= a 4.6e+111) 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;
double tmp;
if (a <= -2.9e+19) {
tmp = (y / a) - ((x / a) / z);
} else if (a <= -2.7e-103) {
tmp = t_1;
} else if (a <= -2.35e-145) {
tmp = y * (z / ((z * a) - t));
} else if (a <= 4.6e+111) {
tmp = t_1;
} else {
tmp = (y - (x / z)) / a;
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: t_1
real(8) :: tmp
t_1 = (x - (y * z)) / t
if (a <= (-2.9d+19)) then
tmp = (y / a) - ((x / a) / z)
else if (a <= (-2.7d-103)) then
tmp = t_1
else if (a <= (-2.35d-145)) then
tmp = y * (z / ((z * a) - t))
else if (a <= 4.6d+111) then
tmp = t_1
else
tmp = (y - (x / z)) / a
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double t_1 = (x - (y * z)) / t;
double tmp;
if (a <= -2.9e+19) {
tmp = (y / a) - ((x / a) / z);
} else if (a <= -2.7e-103) {
tmp = t_1;
} else if (a <= -2.35e-145) {
tmp = y * (z / ((z * a) - t));
} else if (a <= 4.6e+111) {
tmp = t_1;
} else {
tmp = (y - (x / z)) / a;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = (x - (y * z)) / t tmp = 0 if a <= -2.9e+19: tmp = (y / a) - ((x / a) / z) elif a <= -2.7e-103: tmp = t_1 elif a <= -2.35e-145: tmp = y * (z / ((z * a) - t)) elif a <= 4.6e+111: 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)) / t) tmp = 0.0 if (a <= -2.9e+19) tmp = Float64(Float64(y / a) - Float64(Float64(x / a) / z)); elseif (a <= -2.7e-103) tmp = t_1; elseif (a <= -2.35e-145) tmp = Float64(y * Float64(z / Float64(Float64(z * a) - t))); elseif (a <= 4.6e+111) 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; tmp = 0.0; if (a <= -2.9e+19) tmp = (y / a) - ((x / a) / z); elseif (a <= -2.7e-103) tmp = t_1; elseif (a <= -2.35e-145) tmp = y * (z / ((z * a) - t)); elseif (a <= 4.6e+111) 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] / t), $MachinePrecision]}, If[LessEqual[a, -2.9e+19], N[(N[(y / a), $MachinePrecision] - N[(N[(x / a), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, -2.7e-103], t$95$1, If[LessEqual[a, -2.35e-145], N[(y * N[(z / N[(N[(z * a), $MachinePrecision] - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 4.6e+111], 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}\\
\mathbf{if}\;a \leq -2.9 \cdot 10^{+19}:\\
\;\;\;\;\frac{y}{a} - \frac{\frac{x}{a}}{z}\\
\mathbf{elif}\;a \leq -2.7 \cdot 10^{-103}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;a \leq -2.35 \cdot 10^{-145}:\\
\;\;\;\;y \cdot \frac{z}{z \cdot a - t}\\
\mathbf{elif}\;a \leq 4.6 \cdot 10^{+111}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;\frac{y - \frac{x}{z}}{a}\\
\end{array}
\end{array}
if a < -2.9e19Initial program 71.7%
sub-neg71.7%
+-commutative71.7%
neg-sub071.7%
associate-+l-71.7%
sub0-neg71.7%
neg-mul-171.7%
sub-neg71.7%
+-commutative71.7%
neg-sub071.7%
associate-+l-71.7%
sub0-neg71.7%
neg-mul-171.7%
times-frac71.7%
metadata-eval71.7%
*-lft-identity71.7%
*-commutative71.7%
Simplified71.7%
Taylor expanded in z around inf 64.8%
mul-1-neg64.8%
+-commutative64.8%
associate--l+64.8%
associate-/r*67.9%
distribute-neg-frac67.9%
mul-1-neg67.9%
associate-/r*68.2%
associate-*r/68.2%
div-sub68.2%
distribute-lft-out--68.2%
associate-*r/68.2%
Simplified77.6%
Taylor expanded in x around inf 78.7%
if -2.9e19 < a < -2.7000000000000001e-103 or -2.3500000000000001e-145 < a < 4.60000000000000004e111Initial program 91.4%
sub-neg91.4%
+-commutative91.4%
neg-sub091.4%
associate-+l-91.4%
sub0-neg91.4%
neg-mul-191.4%
sub-neg91.4%
+-commutative91.4%
neg-sub091.4%
associate-+l-91.4%
sub0-neg91.4%
neg-mul-191.4%
times-frac91.4%
metadata-eval91.4%
*-lft-identity91.4%
*-commutative91.4%
Simplified91.4%
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%
if -2.7000000000000001e-103 < a < -2.3500000000000001e-145Initial program 76.4%
sub-neg76.4%
+-commutative76.4%
neg-sub076.4%
associate-+l-76.4%
sub0-neg76.4%
neg-mul-176.4%
sub-neg76.4%
+-commutative76.4%
neg-sub076.4%
associate-+l-76.4%
sub0-neg76.4%
neg-mul-176.4%
times-frac76.4%
metadata-eval76.4%
*-lft-identity76.4%
*-commutative76.4%
Simplified76.4%
Taylor expanded in y around inf 52.7%
*-commutative52.7%
associate-*r/75.9%
*-commutative75.9%
Simplified75.9%
if 4.60000000000000004e111 < a Initial program 65.8%
sub-neg65.8%
+-commutative65.8%
neg-sub065.8%
associate-+l-65.8%
sub0-neg65.8%
neg-mul-165.8%
sub-neg65.8%
+-commutative65.8%
neg-sub065.8%
associate-+l-65.8%
sub0-neg65.8%
neg-mul-165.8%
times-frac65.8%
metadata-eval65.8%
*-lft-identity65.8%
*-commutative65.8%
Simplified65.8%
div-sub65.9%
associate-/l*66.0%
Applied egg-rr66.0%
Taylor expanded in a around inf 78.4%
Final simplification74.7%
(FPCore (x y z t a) :precision binary64 (if (<= z -6.2e-12) (/ y a) (if (<= z 1.65e-112) (/ x t) (if (<= z 8e+106) (* y (- (/ z t))) (/ y a)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -6.2e-12) {
tmp = y / a;
} else if (z <= 1.65e-112) {
tmp = x / t;
} else if (z <= 8e+106) {
tmp = 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 <= (-6.2d-12)) then
tmp = y / a
else if (z <= 1.65d-112) then
tmp = x / t
else if (z <= 8d+106) then
tmp = 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 <= -6.2e-12) {
tmp = y / a;
} else if (z <= 1.65e-112) {
tmp = x / t;
} else if (z <= 8e+106) {
tmp = y * -(z / t);
} else {
tmp = y / a;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -6.2e-12: tmp = y / a elif z <= 1.65e-112: tmp = x / t elif z <= 8e+106: tmp = y * -(z / t) else: tmp = y / a return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -6.2e-12) tmp = Float64(y / a); elseif (z <= 1.65e-112) tmp = Float64(x / t); elseif (z <= 8e+106) tmp = Float64(y * Float64(-Float64(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 <= -6.2e-12) tmp = y / a; elseif (z <= 1.65e-112) tmp = x / t; elseif (z <= 8e+106) tmp = y * -(z / t); else tmp = y / a; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -6.2e-12], N[(y / a), $MachinePrecision], If[LessEqual[z, 1.65e-112], N[(x / t), $MachinePrecision], If[LessEqual[z, 8e+106], N[(y * (-N[(z / t), $MachinePrecision])), $MachinePrecision], N[(y / a), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -6.2 \cdot 10^{-12}:\\
\;\;\;\;\frac{y}{a}\\
\mathbf{elif}\;z \leq 1.65 \cdot 10^{-112}:\\
\;\;\;\;\frac{x}{t}\\
\mathbf{elif}\;z \leq 8 \cdot 10^{+106}:\\
\;\;\;\;y \cdot \left(-\frac{z}{t}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{y}{a}\\
\end{array}
\end{array}
if z < -6.2000000000000002e-12 or 8.00000000000000073e106 < z Initial program 61.0%
sub-neg61.0%
+-commutative61.0%
neg-sub061.0%
associate-+l-61.0%
sub0-neg61.0%
neg-mul-161.0%
sub-neg61.0%
+-commutative61.0%
neg-sub061.0%
associate-+l-61.0%
sub0-neg61.0%
neg-mul-161.0%
times-frac61.0%
metadata-eval61.0%
*-lft-identity61.0%
*-commutative61.0%
Simplified61.0%
Taylor expanded in z around inf 60.0%
if -6.2000000000000002e-12 < z < 1.65e-112Initial 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 62.2%
if 1.65e-112 < z < 8.00000000000000073e106Initial program 88.3%
sub-neg88.3%
+-commutative88.3%
neg-sub088.3%
associate-+l-88.3%
sub0-neg88.3%
neg-mul-188.3%
sub-neg88.3%
+-commutative88.3%
neg-sub088.3%
associate-+l-88.3%
sub0-neg88.3%
neg-mul-188.3%
times-frac88.3%
metadata-eval88.3%
*-lft-identity88.3%
*-commutative88.3%
Simplified88.3%
Taylor expanded in y around inf 52.8%
*-commutative52.8%
associate-*r/59.6%
*-commutative59.6%
Simplified59.6%
Taylor expanded in z around 0 40.2%
associate-*r/40.2%
neg-mul-140.2%
Simplified40.2%
Final simplification57.0%
(FPCore (x y z t a) :precision binary64 (if (or (<= a -6e+21) (not (<= a 4.2e+111))) (/ (- y (/ x z)) a) (/ (- x (* y z)) t)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((a <= -6e+21) || !(a <= 4.2e+111)) {
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 ((a <= (-6d+21)) .or. (.not. (a <= 4.2d+111))) 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 ((a <= -6e+21) || !(a <= 4.2e+111)) {
tmp = (y - (x / z)) / a;
} else {
tmp = (x - (y * z)) / t;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (a <= -6e+21) or not (a <= 4.2e+111): tmp = (y - (x / z)) / a else: tmp = (x - (y * z)) / t return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((a <= -6e+21) || !(a <= 4.2e+111)) 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 ((a <= -6e+21) || ~((a <= 4.2e+111))) 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[a, -6e+21], N[Not[LessEqual[a, 4.2e+111]], $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}\;a \leq -6 \cdot 10^{+21} \lor \neg \left(a \leq 4.2 \cdot 10^{+111}\right):\\
\;\;\;\;\frac{y - \frac{x}{z}}{a}\\
\mathbf{else}:\\
\;\;\;\;\frac{x - y \cdot z}{t}\\
\end{array}
\end{array}
if a < -6e21 or 4.1999999999999999e111 < a Initial program 70.2%
sub-neg70.2%
+-commutative70.2%
neg-sub070.2%
associate-+l-70.2%
sub0-neg70.2%
neg-mul-170.2%
sub-neg70.2%
+-commutative70.2%
neg-sub070.2%
associate-+l-70.2%
sub0-neg70.2%
neg-mul-170.2%
times-frac70.2%
metadata-eval70.2%
*-lft-identity70.2%
*-commutative70.2%
Simplified70.2%
div-sub70.2%
associate-/l*73.9%
Applied egg-rr73.9%
Taylor expanded in a around inf 77.1%
if -6e21 < a < 4.1999999999999999e111Initial program 90.1%
sub-neg90.1%
+-commutative90.1%
neg-sub090.1%
associate-+l-90.1%
sub0-neg90.1%
neg-mul-190.1%
sub-neg90.1%
+-commutative90.1%
neg-sub090.1%
associate-+l-90.1%
sub0-neg90.1%
neg-mul-190.1%
times-frac90.1%
metadata-eval90.1%
*-lft-identity90.1%
*-commutative90.1%
Simplified90.1%
Taylor expanded in a around 0 67.8%
associate-*r/67.8%
neg-mul-167.8%
neg-sub067.8%
sub-neg67.8%
+-commutative67.8%
associate--r+67.8%
neg-sub067.8%
remove-double-neg67.8%
*-commutative67.8%
Simplified67.8%
Final simplification71.9%
(FPCore (x y z t a) :precision binary64 (if (<= z -2.2e-12) (/ y a) (if (<= z 2.6e-110) (/ x t) (/ y a))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -2.2e-12) {
tmp = y / a;
} else if (z <= 2.6e-110) {
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 <= (-2.2d-12)) then
tmp = y / a
else if (z <= 2.6d-110) 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 <= -2.2e-12) {
tmp = y / a;
} else if (z <= 2.6e-110) {
tmp = x / t;
} else {
tmp = y / a;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -2.2e-12: tmp = y / a elif z <= 2.6e-110: tmp = x / t else: tmp = y / a return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -2.2e-12) tmp = Float64(y / a); elseif (z <= 2.6e-110) 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 <= -2.2e-12) tmp = y / a; elseif (z <= 2.6e-110) tmp = x / t; else tmp = y / a; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -2.2e-12], N[(y / a), $MachinePrecision], If[LessEqual[z, 2.6e-110], N[(x / t), $MachinePrecision], N[(y / a), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.2 \cdot 10^{-12}:\\
\;\;\;\;\frac{y}{a}\\
\mathbf{elif}\;z \leq 2.6 \cdot 10^{-110}:\\
\;\;\;\;\frac{x}{t}\\
\mathbf{else}:\\
\;\;\;\;\frac{y}{a}\\
\end{array}
\end{array}
if z < -2.19999999999999992e-12 or 2.5999999999999999e-110 < z Initial program 69.3%
sub-neg69.3%
+-commutative69.3%
neg-sub069.3%
associate-+l-69.3%
sub0-neg69.3%
neg-mul-169.3%
sub-neg69.3%
+-commutative69.3%
neg-sub069.3%
associate-+l-69.3%
sub0-neg69.3%
neg-mul-169.3%
times-frac69.3%
metadata-eval69.3%
*-lft-identity69.3%
*-commutative69.3%
Simplified69.3%
Taylor expanded in z around inf 50.6%
if -2.19999999999999992e-12 < z < 2.5999999999999999e-110Initial 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 61.9%
Final simplification55.1%
(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 81.5%
sub-neg81.5%
+-commutative81.5%
neg-sub081.5%
associate-+l-81.5%
sub0-neg81.5%
neg-mul-181.5%
sub-neg81.5%
+-commutative81.5%
neg-sub081.5%
associate-+l-81.5%
sub0-neg81.5%
neg-mul-181.5%
times-frac81.5%
metadata-eval81.5%
*-lft-identity81.5%
*-commutative81.5%
Simplified81.5%
Taylor expanded in z around 0 31.5%
Final simplification31.5%
(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 2023199
(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))))