
(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 11 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t a) :precision binary64 (/ (- x (* y z)) (- t (* a z))))
double code(double x, double y, double z, double t, double a) {
return (x - (y * z)) / (t - (a * z));
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
code = (x - (y * z)) / (t - (a * z))
end function
public static double code(double x, double y, double z, double t, double a) {
return (x - (y * z)) / (t - (a * z));
}
def code(x, y, z, t, a): return (x - (y * z)) / (t - (a * z))
function code(x, y, z, t, a) return Float64(Float64(x - Float64(y * z)) / Float64(t - Float64(a * z))) end
function tmp = code(x, y, z, t, a) tmp = (x - (y * z)) / (t - (a * z)); end
code[x_, y_, z_, t_, a_] := N[(N[(x - N[(y * z), $MachinePrecision]), $MachinePrecision] / N[(t - N[(a * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{x - y \cdot z}{t - a \cdot z}
\end{array}
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (- t (* z a))) (t_2 (/ (- x (* y z)) t_1)))
(if (<= t_2 (- INFINITY))
(- (pow (/ (cbrt x) (cbrt t_1)) 3.0) (* y (/ z t_1)))
(if (<= t_2 5e+280) (- (/ x t_1) (/ (* y z) t_1)) (/ (- y (/ x z)) 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 = pow((cbrt(x) / cbrt(t_1)), 3.0) - (y * (z / t_1));
} else if (t_2 <= 5e+280) {
tmp = (x / t_1) - ((y * z) / 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 = t - (z * a);
double t_2 = (x - (y * z)) / t_1;
double tmp;
if (t_2 <= -Double.POSITIVE_INFINITY) {
tmp = Math.pow((Math.cbrt(x) / Math.cbrt(t_1)), 3.0) - (y * (z / t_1));
} else if (t_2 <= 5e+280) {
tmp = (x / t_1) - ((y * z) / t_1);
} else {
tmp = (y - (x / z)) / 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(cbrt(x) / cbrt(t_1)) ^ 3.0) - Float64(y * Float64(z / t_1))); elseif (t_2 <= 5e+280) tmp = Float64(Float64(x / t_1) - Float64(Float64(y * z) / t_1)); else tmp = Float64(Float64(y - Float64(x / z)) / a); end return tmp end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(t - N[(z * a), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(x - N[(y * z), $MachinePrecision]), $MachinePrecision] / t$95$1), $MachinePrecision]}, If[LessEqual[t$95$2, (-Infinity)], N[(N[Power[N[(N[Power[x, 1/3], $MachinePrecision] / N[Power[t$95$1, 1/3], $MachinePrecision]), $MachinePrecision], 3.0], $MachinePrecision] - N[(y * N[(z / t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$2, 5e+280], N[(N[(x / t$95$1), $MachinePrecision] - N[(N[(y * z), $MachinePrecision] / t$95$1), $MachinePrecision]), $MachinePrecision], N[(N[(y - N[(x / z), $MachinePrecision]), $MachinePrecision] / 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:\\
\;\;\;\;{\left(\frac{\sqrt[3]{x}}{\sqrt[3]{t_1}}\right)}^{3} - y \cdot \frac{z}{t_1}\\
\mathbf{elif}\;t_2 \leq 5 \cdot 10^{+280}:\\
\;\;\;\;\frac{x}{t_1} - \frac{y \cdot z}{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 68.2%
*-commutative68.2%
Simplified68.2%
div-sub68.2%
sub-neg68.2%
add-cube-cbrt68.2%
add-cube-cbrt68.2%
times-frac68.2%
fma-def68.2%
Applied egg-rr100.0%
fma-neg100.0%
*-commutative100.0%
Simplified99.9%
if -inf.0 < (/.f64 (-.f64 x (*.f64 y z)) (-.f64 t (*.f64 a z))) < 5.0000000000000002e280Initial program 94.0%
*-commutative94.0%
Simplified94.0%
Taylor expanded in x around 0 94.0%
if 5.0000000000000002e280 < (/.f64 (-.f64 x (*.f64 y z)) (-.f64 t (*.f64 a z))) Initial program 32.1%
*-commutative32.1%
Simplified32.1%
Taylor expanded in t around 0 25.0%
associate-*r/25.0%
neg-mul-125.0%
*-commutative25.0%
associate-/r*26.4%
sub-neg26.4%
distribute-neg-in26.4%
remove-double-neg26.4%
Simplified26.4%
Taylor expanded in x around 0 89.7%
mul-1-neg89.7%
unsub-neg89.7%
Simplified89.7%
Final simplification93.8%
(FPCore (x y z t a)
:precision binary64
(if (<= z -1.95e+127)
(/ y a)
(if (<= z -3.85e-22)
(* y (/ (- z) t))
(if (<= z -1.95e-56)
(/ (- x) (* z a))
(if (<= z 19.5)
(/ x t)
(if (or (<= z 2.1e+94) (and (not (<= z 2.3e+130)) (<= z 4.2e+185)))
(/ (/ (- x) z) a)
(/ y a)))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -1.95e+127) {
tmp = y / a;
} else if (z <= -3.85e-22) {
tmp = y * (-z / t);
} else if (z <= -1.95e-56) {
tmp = -x / (z * a);
} else if (z <= 19.5) {
tmp = x / t;
} else if ((z <= 2.1e+94) || (!(z <= 2.3e+130) && (z <= 4.2e+185))) {
tmp = (-x / z) / a;
} 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.95d+127)) then
tmp = y / a
else if (z <= (-3.85d-22)) then
tmp = y * (-z / t)
else if (z <= (-1.95d-56)) then
tmp = -x / (z * a)
else if (z <= 19.5d0) then
tmp = x / t
else if ((z <= 2.1d+94) .or. (.not. (z <= 2.3d+130)) .and. (z <= 4.2d+185)) then
tmp = (-x / z) / a
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.95e+127) {
tmp = y / a;
} else if (z <= -3.85e-22) {
tmp = y * (-z / t);
} else if (z <= -1.95e-56) {
tmp = -x / (z * a);
} else if (z <= 19.5) {
tmp = x / t;
} else if ((z <= 2.1e+94) || (!(z <= 2.3e+130) && (z <= 4.2e+185))) {
tmp = (-x / z) / a;
} else {
tmp = y / a;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -1.95e+127: tmp = y / a elif z <= -3.85e-22: tmp = y * (-z / t) elif z <= -1.95e-56: tmp = -x / (z * a) elif z <= 19.5: tmp = x / t elif (z <= 2.1e+94) or (not (z <= 2.3e+130) and (z <= 4.2e+185)): tmp = (-x / z) / a else: tmp = y / a return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -1.95e+127) tmp = Float64(y / a); elseif (z <= -3.85e-22) tmp = Float64(y * Float64(Float64(-z) / t)); elseif (z <= -1.95e-56) tmp = Float64(Float64(-x) / Float64(z * a)); elseif (z <= 19.5) tmp = Float64(x / t); elseif ((z <= 2.1e+94) || (!(z <= 2.3e+130) && (z <= 4.2e+185))) tmp = Float64(Float64(Float64(-x) / z) / a); else tmp = Float64(y / a); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (z <= -1.95e+127) tmp = y / a; elseif (z <= -3.85e-22) tmp = y * (-z / t); elseif (z <= -1.95e-56) tmp = -x / (z * a); elseif (z <= 19.5) tmp = x / t; elseif ((z <= 2.1e+94) || (~((z <= 2.3e+130)) && (z <= 4.2e+185))) tmp = (-x / z) / a; else tmp = y / a; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -1.95e+127], N[(y / a), $MachinePrecision], If[LessEqual[z, -3.85e-22], N[(y * N[((-z) / t), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -1.95e-56], N[((-x) / N[(z * a), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 19.5], N[(x / t), $MachinePrecision], If[Or[LessEqual[z, 2.1e+94], And[N[Not[LessEqual[z, 2.3e+130]], $MachinePrecision], LessEqual[z, 4.2e+185]]], N[(N[((-x) / z), $MachinePrecision] / a), $MachinePrecision], N[(y / a), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.95 \cdot 10^{+127}:\\
\;\;\;\;\frac{y}{a}\\
\mathbf{elif}\;z \leq -3.85 \cdot 10^{-22}:\\
\;\;\;\;y \cdot \frac{-z}{t}\\
\mathbf{elif}\;z \leq -1.95 \cdot 10^{-56}:\\
\;\;\;\;\frac{-x}{z \cdot a}\\
\mathbf{elif}\;z \leq 19.5:\\
\;\;\;\;\frac{x}{t}\\
\mathbf{elif}\;z \leq 2.1 \cdot 10^{+94} \lor \neg \left(z \leq 2.3 \cdot 10^{+130}\right) \land z \leq 4.2 \cdot 10^{+185}:\\
\;\;\;\;\frac{\frac{-x}{z}}{a}\\
\mathbf{else}:\\
\;\;\;\;\frac{y}{a}\\
\end{array}
\end{array}
if z < -1.94999999999999991e127 or 2.09999999999999989e94 < z < 2.30000000000000021e130 or 4.2e185 < z Initial program 57.6%
*-commutative57.6%
Simplified57.6%
Taylor expanded in z around inf 67.1%
if -1.94999999999999991e127 < z < -3.8500000000000001e-22Initial program 93.7%
*-commutative93.7%
Simplified93.7%
Taylor expanded in t around inf 70.0%
Taylor expanded in x around 0 46.4%
mul-1-neg46.4%
*-commutative46.4%
associate-*l/52.4%
distribute-rgt-neg-in52.4%
Simplified52.4%
if -3.8500000000000001e-22 < z < -1.95e-56Initial program 100.0%
*-commutative100.0%
Simplified100.0%
Taylor expanded in t around 0 67.7%
associate-*r*67.7%
neg-mul-167.7%
*-commutative67.7%
Simplified67.7%
Taylor expanded in x around inf 54.1%
associate-*r/54.1%
neg-mul-154.1%
Simplified54.1%
if -1.95e-56 < z < 19.5Initial program 99.8%
*-commutative99.8%
Simplified99.8%
Taylor expanded in z around 0 64.9%
if 19.5 < z < 2.09999999999999989e94 or 2.30000000000000021e130 < z < 4.2e185Initial program 86.6%
*-commutative86.6%
Simplified86.6%
Taylor expanded in t around 0 66.3%
associate-*r/66.3%
neg-mul-166.3%
*-commutative66.3%
associate-/r*70.6%
sub-neg70.6%
distribute-neg-in70.6%
remove-double-neg70.6%
Simplified70.6%
Taylor expanded in x around inf 52.1%
mul-1-neg52.1%
distribute-neg-frac52.1%
Simplified52.1%
Final simplification62.3%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (/ (- x) (* z a))))
(if (<= z -2.1e+127)
(/ y a)
(if (<= z -8.8e-17)
(* y (/ (- z) t))
(if (<= z -3.1e-56)
t_1
(if (<= z 0.00036) (/ x t) (if (<= z 6e+93) t_1 (/ y a))))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = -x / (z * a);
double tmp;
if (z <= -2.1e+127) {
tmp = y / a;
} else if (z <= -8.8e-17) {
tmp = y * (-z / t);
} else if (z <= -3.1e-56) {
tmp = t_1;
} else if (z <= 0.00036) {
tmp = x / t;
} else if (z <= 6e+93) {
tmp = t_1;
} else {
tmp = y / a;
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: t_1
real(8) :: tmp
t_1 = -x / (z * a)
if (z <= (-2.1d+127)) then
tmp = y / a
else if (z <= (-8.8d-17)) then
tmp = y * (-z / t)
else if (z <= (-3.1d-56)) then
tmp = t_1
else if (z <= 0.00036d0) then
tmp = x / t
else if (z <= 6d+93) then
tmp = t_1
else
tmp = y / a
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double t_1 = -x / (z * a);
double tmp;
if (z <= -2.1e+127) {
tmp = y / a;
} else if (z <= -8.8e-17) {
tmp = y * (-z / t);
} else if (z <= -3.1e-56) {
tmp = t_1;
} else if (z <= 0.00036) {
tmp = x / t;
} else if (z <= 6e+93) {
tmp = t_1;
} else {
tmp = y / a;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = -x / (z * a) tmp = 0 if z <= -2.1e+127: tmp = y / a elif z <= -8.8e-17: tmp = y * (-z / t) elif z <= -3.1e-56: tmp = t_1 elif z <= 0.00036: tmp = x / t elif z <= 6e+93: tmp = t_1 else: tmp = y / a return tmp
function code(x, y, z, t, a) t_1 = Float64(Float64(-x) / Float64(z * a)) tmp = 0.0 if (z <= -2.1e+127) tmp = Float64(y / a); elseif (z <= -8.8e-17) tmp = Float64(y * Float64(Float64(-z) / t)); elseif (z <= -3.1e-56) tmp = t_1; elseif (z <= 0.00036) tmp = Float64(x / t); elseif (z <= 6e+93) tmp = t_1; else tmp = Float64(y / a); end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = -x / (z * a); tmp = 0.0; if (z <= -2.1e+127) tmp = y / a; elseif (z <= -8.8e-17) tmp = y * (-z / t); elseif (z <= -3.1e-56) tmp = t_1; elseif (z <= 0.00036) tmp = x / t; elseif (z <= 6e+93) tmp = t_1; else tmp = y / a; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[((-x) / N[(z * a), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -2.1e+127], N[(y / a), $MachinePrecision], If[LessEqual[z, -8.8e-17], N[(y * N[((-z) / t), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -3.1e-56], t$95$1, If[LessEqual[z, 0.00036], N[(x / t), $MachinePrecision], If[LessEqual[z, 6e+93], t$95$1, N[(y / a), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{-x}{z \cdot a}\\
\mathbf{if}\;z \leq -2.1 \cdot 10^{+127}:\\
\;\;\;\;\frac{y}{a}\\
\mathbf{elif}\;z \leq -8.8 \cdot 10^{-17}:\\
\;\;\;\;y \cdot \frac{-z}{t}\\
\mathbf{elif}\;z \leq -3.1 \cdot 10^{-56}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq 0.00036:\\
\;\;\;\;\frac{x}{t}\\
\mathbf{elif}\;z \leq 6 \cdot 10^{+93}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;\frac{y}{a}\\
\end{array}
\end{array}
if z < -2.09999999999999992e127 or 5.99999999999999957e93 < z Initial program 61.6%
*-commutative61.6%
Simplified61.6%
Taylor expanded in z around inf 59.7%
if -2.09999999999999992e127 < z < -8.8e-17Initial program 93.7%
*-commutative93.7%
Simplified93.7%
Taylor expanded in t around inf 70.0%
Taylor expanded in x around 0 46.4%
mul-1-neg46.4%
*-commutative46.4%
associate-*l/52.4%
distribute-rgt-neg-in52.4%
Simplified52.4%
if -8.8e-17 < z < -3.09999999999999987e-56 or 3.60000000000000023e-4 < z < 5.99999999999999957e93Initial program 91.5%
*-commutative91.5%
Simplified91.5%
Taylor expanded in t around 0 69.3%
associate-*r*69.3%
neg-mul-169.3%
*-commutative69.3%
Simplified69.3%
Taylor expanded in x around inf 49.4%
associate-*r/49.4%
neg-mul-149.4%
Simplified49.4%
if -3.09999999999999987e-56 < z < 3.60000000000000023e-4Initial program 99.8%
*-commutative99.8%
Simplified99.8%
Taylor expanded in z around 0 64.9%
Final simplification60.3%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (/ (- y (/ x z)) a)))
(if (<= t -8.5e-9)
(/ (- x (* y z)) t)
(if (<= t -2.1e-22)
t_1
(if (<= t -1.15e-44)
(/ x (- t (* z a)))
(if (<= t 840000000000.0) t_1 (- (/ x t) (/ z (/ t y)))))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = (y - (x / z)) / a;
double tmp;
if (t <= -8.5e-9) {
tmp = (x - (y * z)) / t;
} else if (t <= -2.1e-22) {
tmp = t_1;
} else if (t <= -1.15e-44) {
tmp = x / (t - (z * a));
} else if (t <= 840000000000.0) {
tmp = t_1;
} else {
tmp = (x / t) - (z / (t / y));
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: t_1
real(8) :: tmp
t_1 = (y - (x / z)) / a
if (t <= (-8.5d-9)) then
tmp = (x - (y * z)) / t
else if (t <= (-2.1d-22)) then
tmp = t_1
else if (t <= (-1.15d-44)) then
tmp = x / (t - (z * a))
else if (t <= 840000000000.0d0) then
tmp = t_1
else
tmp = (x / t) - (z / (t / y))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double t_1 = (y - (x / z)) / a;
double tmp;
if (t <= -8.5e-9) {
tmp = (x - (y * z)) / t;
} else if (t <= -2.1e-22) {
tmp = t_1;
} else if (t <= -1.15e-44) {
tmp = x / (t - (z * a));
} else if (t <= 840000000000.0) {
tmp = t_1;
} else {
tmp = (x / t) - (z / (t / y));
}
return tmp;
}
def code(x, y, z, t, a): t_1 = (y - (x / z)) / a tmp = 0 if t <= -8.5e-9: tmp = (x - (y * z)) / t elif t <= -2.1e-22: tmp = t_1 elif t <= -1.15e-44: tmp = x / (t - (z * a)) elif t <= 840000000000.0: tmp = t_1 else: tmp = (x / t) - (z / (t / y)) return tmp
function code(x, y, z, t, a) t_1 = Float64(Float64(y - Float64(x / z)) / a) tmp = 0.0 if (t <= -8.5e-9) tmp = Float64(Float64(x - Float64(y * z)) / t); elseif (t <= -2.1e-22) tmp = t_1; elseif (t <= -1.15e-44) tmp = Float64(x / Float64(t - Float64(z * a))); elseif (t <= 840000000000.0) tmp = t_1; else tmp = Float64(Float64(x / t) - Float64(z / Float64(t / y))); end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = (y - (x / z)) / a; tmp = 0.0; if (t <= -8.5e-9) tmp = (x - (y * z)) / t; elseif (t <= -2.1e-22) tmp = t_1; elseif (t <= -1.15e-44) tmp = x / (t - (z * a)); elseif (t <= 840000000000.0) tmp = t_1; else tmp = (x / t) - (z / (t / y)); 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[t, -8.5e-9], N[(N[(x - N[(y * z), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision], If[LessEqual[t, -2.1e-22], t$95$1, If[LessEqual[t, -1.15e-44], N[(x / N[(t - N[(z * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 840000000000.0], t$95$1, N[(N[(x / t), $MachinePrecision] - N[(z / N[(t / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{y - \frac{x}{z}}{a}\\
\mathbf{if}\;t \leq -8.5 \cdot 10^{-9}:\\
\;\;\;\;\frac{x - y \cdot z}{t}\\
\mathbf{elif}\;t \leq -2.1 \cdot 10^{-22}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;t \leq -1.15 \cdot 10^{-44}:\\
\;\;\;\;\frac{x}{t - z \cdot a}\\
\mathbf{elif}\;t \leq 840000000000:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{t} - \frac{z}{\frac{t}{y}}\\
\end{array}
\end{array}
if t < -8.5e-9Initial program 86.1%
*-commutative86.1%
Simplified86.1%
Taylor expanded in t around inf 77.4%
if -8.5e-9 < t < -2.10000000000000008e-22 or -1.14999999999999999e-44 < t < 8.4e11Initial program 84.4%
*-commutative84.4%
Simplified84.4%
Taylor expanded in t around 0 68.8%
associate-*r/68.8%
neg-mul-168.8%
*-commutative68.8%
associate-/r*71.3%
sub-neg71.3%
distribute-neg-in71.3%
remove-double-neg71.3%
Simplified71.3%
Taylor expanded in x around 0 81.9%
mul-1-neg81.9%
unsub-neg81.9%
Simplified81.9%
if -2.10000000000000008e-22 < t < -1.14999999999999999e-44Initial program 87.5%
*-commutative87.5%
Simplified87.5%
Taylor expanded in x around inf 88.0%
*-commutative88.0%
Simplified88.0%
if 8.4e11 < t Initial program 86.7%
*-commutative86.7%
Simplified86.7%
Taylor expanded in t around inf 78.8%
div-sub78.8%
*-commutative78.8%
associate-/l*83.3%
Applied egg-rr83.3%
Final simplification81.4%
(FPCore (x y z t a)
:precision binary64
(if (<= t -8.2e-9)
(/ (- x (* y z)) t)
(if (<= t -7e-22)
(- (/ y a) (/ x (* z a)))
(if (<= t -7.5e-47)
(/ x (- t (* z a)))
(if (<= t 11000000000.0)
(/ (- y (/ x z)) a)
(- (/ x t) (/ z (/ t y))))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -8.2e-9) {
tmp = (x - (y * z)) / t;
} else if (t <= -7e-22) {
tmp = (y / a) - (x / (z * a));
} else if (t <= -7.5e-47) {
tmp = x / (t - (z * a));
} else if (t <= 11000000000.0) {
tmp = (y - (x / z)) / a;
} else {
tmp = (x / t) - (z / (t / y));
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (t <= (-8.2d-9)) then
tmp = (x - (y * z)) / t
else if (t <= (-7d-22)) then
tmp = (y / a) - (x / (z * a))
else if (t <= (-7.5d-47)) then
tmp = x / (t - (z * a))
else if (t <= 11000000000.0d0) then
tmp = (y - (x / z)) / a
else
tmp = (x / t) - (z / (t / y))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -8.2e-9) {
tmp = (x - (y * z)) / t;
} else if (t <= -7e-22) {
tmp = (y / a) - (x / (z * a));
} else if (t <= -7.5e-47) {
tmp = x / (t - (z * a));
} else if (t <= 11000000000.0) {
tmp = (y - (x / z)) / a;
} else {
tmp = (x / t) - (z / (t / y));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if t <= -8.2e-9: tmp = (x - (y * z)) / t elif t <= -7e-22: tmp = (y / a) - (x / (z * a)) elif t <= -7.5e-47: tmp = x / (t - (z * a)) elif t <= 11000000000.0: tmp = (y - (x / z)) / a else: tmp = (x / t) - (z / (t / y)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (t <= -8.2e-9) tmp = Float64(Float64(x - Float64(y * z)) / t); elseif (t <= -7e-22) tmp = Float64(Float64(y / a) - Float64(x / Float64(z * a))); elseif (t <= -7.5e-47) tmp = Float64(x / Float64(t - Float64(z * a))); elseif (t <= 11000000000.0) tmp = Float64(Float64(y - Float64(x / z)) / a); else tmp = Float64(Float64(x / t) - Float64(z / Float64(t / y))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (t <= -8.2e-9) tmp = (x - (y * z)) / t; elseif (t <= -7e-22) tmp = (y / a) - (x / (z * a)); elseif (t <= -7.5e-47) tmp = x / (t - (z * a)); elseif (t <= 11000000000.0) tmp = (y - (x / z)) / a; else tmp = (x / t) - (z / (t / y)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, -8.2e-9], N[(N[(x - N[(y * z), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision], If[LessEqual[t, -7e-22], N[(N[(y / a), $MachinePrecision] - N[(x / N[(z * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, -7.5e-47], N[(x / N[(t - N[(z * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 11000000000.0], N[(N[(y - N[(x / z), $MachinePrecision]), $MachinePrecision] / a), $MachinePrecision], N[(N[(x / t), $MachinePrecision] - N[(z / N[(t / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -8.2 \cdot 10^{-9}:\\
\;\;\;\;\frac{x - y \cdot z}{t}\\
\mathbf{elif}\;t \leq -7 \cdot 10^{-22}:\\
\;\;\;\;\frac{y}{a} - \frac{x}{z \cdot a}\\
\mathbf{elif}\;t \leq -7.5 \cdot 10^{-47}:\\
\;\;\;\;\frac{x}{t - z \cdot a}\\
\mathbf{elif}\;t \leq 11000000000:\\
\;\;\;\;\frac{y - \frac{x}{z}}{a}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{t} - \frac{z}{\frac{t}{y}}\\
\end{array}
\end{array}
if t < -8.2000000000000006e-9Initial program 86.1%
*-commutative86.1%
Simplified86.1%
Taylor expanded in t around inf 77.4%
if -8.2000000000000006e-9 < t < -7.00000000000000011e-22Initial program 79.7%
*-commutative79.7%
Simplified79.7%
Taylor expanded in t around 0 75.2%
associate-*r*75.2%
neg-mul-175.2%
*-commutative75.2%
Simplified75.2%
frac-2neg75.2%
div-inv75.2%
sub-neg75.2%
distribute-neg-in75.2%
*-commutative75.2%
distribute-lft-neg-in75.2%
add-sqr-sqrt0.0%
sqrt-unprod36.9%
sqr-neg36.9%
sqrt-unprod36.9%
add-sqr-sqrt36.9%
distribute-lft-neg-in36.9%
add-sqr-sqrt0.0%
sqrt-unprod75.2%
sqr-neg75.2%
sqrt-unprod74.6%
add-sqr-sqrt75.2%
distribute-rgt-neg-out75.2%
remove-double-neg75.2%
Applied egg-rr75.2%
associate-*r/75.2%
*-rgt-identity75.2%
+-commutative75.2%
unsub-neg75.2%
*-commutative75.2%
Simplified75.2%
Taylor expanded in z around 0 95.2%
+-commutative95.2%
mul-1-neg95.2%
associate-/l/94.9%
unsub-neg94.9%
associate-/l/95.2%
Simplified95.2%
if -7.00000000000000011e-22 < t < -7.49999999999999969e-47Initial program 87.5%
*-commutative87.5%
Simplified87.5%
Taylor expanded in x around inf 88.0%
*-commutative88.0%
Simplified88.0%
if -7.49999999999999969e-47 < t < 1.1e10Initial program 84.6%
*-commutative84.6%
Simplified84.6%
Taylor expanded in t around 0 68.6%
associate-*r/68.6%
neg-mul-168.6%
*-commutative68.6%
associate-/r*71.1%
sub-neg71.1%
distribute-neg-in71.1%
remove-double-neg71.1%
Simplified71.1%
Taylor expanded in x around 0 81.4%
mul-1-neg81.4%
unsub-neg81.4%
Simplified81.4%
if 1.1e10 < t Initial program 86.7%
*-commutative86.7%
Simplified86.7%
Taylor expanded in t around inf 78.8%
div-sub78.8%
*-commutative78.8%
associate-/l*83.3%
Applied egg-rr83.3%
Final simplification81.4%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (/ (- y (/ x z)) a)) (t_2 (/ (- x (* y z)) t)))
(if (<= t -8.2e-9)
t_2
(if (<= t -5.5e-21)
t_1
(if (<= t -5.1e-46)
(/ x (- t (* z a)))
(if (<= t 12500000000.0) t_1 t_2))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = (y - (x / z)) / a;
double t_2 = (x - (y * z)) / t;
double tmp;
if (t <= -8.2e-9) {
tmp = t_2;
} else if (t <= -5.5e-21) {
tmp = t_1;
} else if (t <= -5.1e-46) {
tmp = x / (t - (z * a));
} else if (t <= 12500000000.0) {
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 = (y - (x / z)) / a
t_2 = (x - (y * z)) / t
if (t <= (-8.2d-9)) then
tmp = t_2
else if (t <= (-5.5d-21)) then
tmp = t_1
else if (t <= (-5.1d-46)) then
tmp = x / (t - (z * a))
else if (t <= 12500000000.0d0) 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 = (y - (x / z)) / a;
double t_2 = (x - (y * z)) / t;
double tmp;
if (t <= -8.2e-9) {
tmp = t_2;
} else if (t <= -5.5e-21) {
tmp = t_1;
} else if (t <= -5.1e-46) {
tmp = x / (t - (z * a));
} else if (t <= 12500000000.0) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = (y - (x / z)) / a t_2 = (x - (y * z)) / t tmp = 0 if t <= -8.2e-9: tmp = t_2 elif t <= -5.5e-21: tmp = t_1 elif t <= -5.1e-46: tmp = x / (t - (z * a)) elif t <= 12500000000.0: tmp = t_1 else: tmp = t_2 return tmp
function code(x, y, z, t, a) t_1 = Float64(Float64(y - Float64(x / z)) / a) t_2 = Float64(Float64(x - Float64(y * z)) / t) tmp = 0.0 if (t <= -8.2e-9) tmp = t_2; elseif (t <= -5.5e-21) tmp = t_1; elseif (t <= -5.1e-46) tmp = Float64(x / Float64(t - Float64(z * a))); elseif (t <= 12500000000.0) tmp = t_1; else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = (y - (x / z)) / a; t_2 = (x - (y * z)) / t; tmp = 0.0; if (t <= -8.2e-9) tmp = t_2; elseif (t <= -5.5e-21) tmp = t_1; elseif (t <= -5.1e-46) tmp = x / (t - (z * a)); elseif (t <= 12500000000.0) tmp = t_1; else tmp = 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[(x - N[(y * z), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision]}, If[LessEqual[t, -8.2e-9], t$95$2, If[LessEqual[t, -5.5e-21], t$95$1, If[LessEqual[t, -5.1e-46], N[(x / N[(t - N[(z * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 12500000000.0], t$95$1, t$95$2]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{y - \frac{x}{z}}{a}\\
t_2 := \frac{x - y \cdot z}{t}\\
\mathbf{if}\;t \leq -8.2 \cdot 10^{-9}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;t \leq -5.5 \cdot 10^{-21}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;t \leq -5.1 \cdot 10^{-46}:\\
\;\;\;\;\frac{x}{t - z \cdot a}\\
\mathbf{elif}\;t \leq 12500000000:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;t_2\\
\end{array}
\end{array}
if t < -8.2000000000000006e-9 or 1.25e10 < t Initial program 86.4%
*-commutative86.4%
Simplified86.4%
Taylor expanded in t around inf 78.1%
if -8.2000000000000006e-9 < t < -5.49999999999999977e-21 or -5.0999999999999997e-46 < t < 1.25e10Initial program 84.4%
*-commutative84.4%
Simplified84.4%
Taylor expanded in t around 0 68.8%
associate-*r/68.8%
neg-mul-168.8%
*-commutative68.8%
associate-/r*71.3%
sub-neg71.3%
distribute-neg-in71.3%
remove-double-neg71.3%
Simplified71.3%
Taylor expanded in x around 0 81.9%
mul-1-neg81.9%
unsub-neg81.9%
Simplified81.9%
if -5.49999999999999977e-21 < t < -5.0999999999999997e-46Initial program 87.5%
*-commutative87.5%
Simplified87.5%
Taylor expanded in x around inf 88.0%
*-commutative88.0%
Simplified88.0%
Final simplification80.3%
(FPCore (x y z t a)
:precision binary64
(if (<= z -2.5e+127)
(/ y a)
(if (<= z -7.5e-238)
(/ (- x (* y z)) t)
(if (<= z 4.2e+185) (/ x (- t (* z a))) (/ y a)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -2.5e+127) {
tmp = y / a;
} else if (z <= -7.5e-238) {
tmp = (x - (y * z)) / t;
} else if (z <= 4.2e+185) {
tmp = x / (t - (z * a));
} 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.5d+127)) then
tmp = y / a
else if (z <= (-7.5d-238)) then
tmp = (x - (y * z)) / t
else if (z <= 4.2d+185) then
tmp = x / (t - (z * a))
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.5e+127) {
tmp = y / a;
} else if (z <= -7.5e-238) {
tmp = (x - (y * z)) / t;
} else if (z <= 4.2e+185) {
tmp = x / (t - (z * a));
} else {
tmp = y / a;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -2.5e+127: tmp = y / a elif z <= -7.5e-238: tmp = (x - (y * z)) / t elif z <= 4.2e+185: tmp = x / (t - (z * a)) else: tmp = y / a return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -2.5e+127) tmp = Float64(y / a); elseif (z <= -7.5e-238) tmp = Float64(Float64(x - Float64(y * z)) / t); elseif (z <= 4.2e+185) tmp = Float64(x / Float64(t - Float64(z * a))); else tmp = Float64(y / a); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (z <= -2.5e+127) tmp = y / a; elseif (z <= -7.5e-238) tmp = (x - (y * z)) / t; elseif (z <= 4.2e+185) tmp = x / (t - (z * a)); else tmp = y / a; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -2.5e+127], N[(y / a), $MachinePrecision], If[LessEqual[z, -7.5e-238], N[(N[(x - N[(y * z), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision], If[LessEqual[z, 4.2e+185], N[(x / N[(t - N[(z * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(y / a), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.5 \cdot 10^{+127}:\\
\;\;\;\;\frac{y}{a}\\
\mathbf{elif}\;z \leq -7.5 \cdot 10^{-238}:\\
\;\;\;\;\frac{x - y \cdot z}{t}\\
\mathbf{elif}\;z \leq 4.2 \cdot 10^{+185}:\\
\;\;\;\;\frac{x}{t - z \cdot a}\\
\mathbf{else}:\\
\;\;\;\;\frac{y}{a}\\
\end{array}
\end{array}
if z < -2.5000000000000002e127 or 4.2e185 < z Initial program 57.9%
*-commutative57.9%
Simplified57.9%
Taylor expanded in z around inf 69.8%
if -2.5000000000000002e127 < z < -7.50000000000000061e-238Initial program 98.2%
*-commutative98.2%
Simplified98.2%
Taylor expanded in t around inf 71.2%
if -7.50000000000000061e-238 < z < 4.2e185Initial program 91.4%
*-commutative91.4%
Simplified91.4%
Taylor expanded in x around inf 71.0%
*-commutative71.0%
Simplified71.0%
Final simplification70.8%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -1.02e+150) (not (<= z 3.7e+105))) (/ (- y (/ x z)) a) (/ (- x (* y z)) (- t (* z a)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -1.02e+150) || !(z <= 3.7e+105)) {
tmp = (y - (x / z)) / a;
} else {
tmp = (x - (y * z)) / (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 ((z <= (-1.02d+150)) .or. (.not. (z <= 3.7d+105))) then
tmp = (y - (x / z)) / a
else
tmp = (x - (y * z)) / (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 ((z <= -1.02e+150) || !(z <= 3.7e+105)) {
tmp = (y - (x / z)) / a;
} else {
tmp = (x - (y * z)) / (t - (z * a));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -1.02e+150) or not (z <= 3.7e+105): tmp = (y - (x / z)) / a else: tmp = (x - (y * z)) / (t - (z * a)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -1.02e+150) || !(z <= 3.7e+105)) tmp = Float64(Float64(y - Float64(x / z)) / a); else tmp = Float64(Float64(x - Float64(y * z)) / Float64(t - Float64(z * a))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((z <= -1.02e+150) || ~((z <= 3.7e+105))) tmp = (y - (x / z)) / a; else tmp = (x - (y * z)) / (t - (z * a)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -1.02e+150], N[Not[LessEqual[z, 3.7e+105]], $MachinePrecision]], N[(N[(y - N[(x / z), $MachinePrecision]), $MachinePrecision] / a), $MachinePrecision], N[(N[(x - N[(y * z), $MachinePrecision]), $MachinePrecision] / N[(t - N[(z * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.02 \cdot 10^{+150} \lor \neg \left(z \leq 3.7 \cdot 10^{+105}\right):\\
\;\;\;\;\frac{y - \frac{x}{z}}{a}\\
\mathbf{else}:\\
\;\;\;\;\frac{x - y \cdot z}{t - z \cdot a}\\
\end{array}
\end{array}
if z < -1.0199999999999999e150 or 3.69999999999999985e105 < z Initial program 59.4%
*-commutative59.4%
Simplified59.4%
Taylor expanded in t around 0 47.0%
associate-*r/47.0%
neg-mul-147.0%
*-commutative47.0%
associate-/r*61.8%
sub-neg61.8%
distribute-neg-in61.8%
remove-double-neg61.8%
Simplified61.8%
Taylor expanded in x around 0 86.2%
mul-1-neg86.2%
unsub-neg86.2%
Simplified86.2%
if -1.0199999999999999e150 < z < 3.69999999999999985e105Initial program 97.1%
Final simplification93.7%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -1.95e+98) (not (<= z 4.2e+185))) (/ y a) (/ x (- t (* z a)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -1.95e+98) || !(z <= 4.2e+185)) {
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 ((z <= (-1.95d+98)) .or. (.not. (z <= 4.2d+185))) 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 ((z <= -1.95e+98) || !(z <= 4.2e+185)) {
tmp = y / a;
} else {
tmp = x / (t - (z * a));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -1.95e+98) or not (z <= 4.2e+185): tmp = y / a else: tmp = x / (t - (z * a)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -1.95e+98) || !(z <= 4.2e+185)) 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 ((z <= -1.95e+98) || ~((z <= 4.2e+185))) tmp = y / a; else tmp = x / (t - (z * a)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -1.95e+98], N[Not[LessEqual[z, 4.2e+185]], $MachinePrecision]], N[(y / a), $MachinePrecision], N[(x / N[(t - N[(z * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.95 \cdot 10^{+98} \lor \neg \left(z \leq 4.2 \cdot 10^{+185}\right):\\
\;\;\;\;\frac{y}{a}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{t - z \cdot a}\\
\end{array}
\end{array}
if z < -1.95e98 or 4.2e185 < z Initial program 59.1%
*-commutative59.1%
Simplified59.1%
Taylor expanded in z around inf 68.5%
if -1.95e98 < z < 4.2e185Initial program 93.9%
*-commutative93.9%
Simplified93.9%
Taylor expanded in x around inf 68.7%
*-commutative68.7%
Simplified68.7%
Final simplification68.6%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -1.06e+104) (not (<= z 54.0))) (/ y a) (/ x t)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -1.06e+104) || !(z <= 54.0)) {
tmp = y / a;
} else {
tmp = x / t;
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if ((z <= (-1.06d+104)) .or. (.not. (z <= 54.0d0))) then
tmp = y / a
else
tmp = x / t
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -1.06e+104) || !(z <= 54.0)) {
tmp = y / a;
} else {
tmp = x / t;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -1.06e+104) or not (z <= 54.0): tmp = y / a else: tmp = x / t return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -1.06e+104) || !(z <= 54.0)) tmp = Float64(y / a); else tmp = Float64(x / t); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((z <= -1.06e+104) || ~((z <= 54.0))) tmp = y / a; else tmp = x / t; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -1.06e+104], N[Not[LessEqual[z, 54.0]], $MachinePrecision]], N[(y / a), $MachinePrecision], N[(x / t), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.06 \cdot 10^{+104} \lor \neg \left(z \leq 54\right):\\
\;\;\;\;\frac{y}{a}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{t}\\
\end{array}
\end{array}
if z < -1.05999999999999994e104 or 54 < z Initial program 68.4%
*-commutative68.4%
Simplified68.4%
Taylor expanded in z around inf 51.5%
if -1.05999999999999994e104 < z < 54Initial program 99.8%
*-commutative99.8%
Simplified99.8%
Taylor expanded in z around 0 60.2%
Final simplification56.2%
(FPCore (x y z t a) :precision binary64 (/ x t))
double code(double x, double y, double z, double t, double a) {
return x / t;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
code = x / t
end function
public static double code(double x, double y, double z, double t, double a) {
return x / t;
}
def code(x, y, z, t, a): return x / t
function code(x, y, z, t, a) return Float64(x / t) end
function tmp = code(x, y, z, t, a) tmp = x / t; end
code[x_, y_, z_, t_, a_] := N[(x / t), $MachinePrecision]
\begin{array}{l}
\\
\frac{x}{t}
\end{array}
Initial program 85.5%
*-commutative85.5%
Simplified85.5%
Taylor expanded in z around 0 39.4%
Final simplification39.4%
(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 2024024
(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))))