
(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 (* y (+ (/ z (- (* z a) t)) (/ x (* y t_1)))))
(t_3 (/ (- x (* z y)) t_1)))
(if (<= t_3 (- INFINITY))
t_2
(if (<= t_3 -2e-313)
t_3
(if (<= t_3 0.0)
(/ y (- a (/ t z)))
(if (<= t_3 2e+272) t_3 (if (<= t_3 INFINITY) t_2 (/ y a))))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = t - (z * a);
double t_2 = y * ((z / ((z * a) - t)) + (x / (y * t_1)));
double t_3 = (x - (z * y)) / t_1;
double tmp;
if (t_3 <= -((double) INFINITY)) {
tmp = t_2;
} else if (t_3 <= -2e-313) {
tmp = t_3;
} else if (t_3 <= 0.0) {
tmp = y / (a - (t / z));
} else if (t_3 <= 2e+272) {
tmp = t_3;
} 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 = t - (z * a);
double t_2 = y * ((z / ((z * a) - t)) + (x / (y * t_1)));
double t_3 = (x - (z * y)) / t_1;
double tmp;
if (t_3 <= -Double.POSITIVE_INFINITY) {
tmp = t_2;
} else if (t_3 <= -2e-313) {
tmp = t_3;
} else if (t_3 <= 0.0) {
tmp = y / (a - (t / z));
} else if (t_3 <= 2e+272) {
tmp = t_3;
} 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 = t - (z * a) t_2 = y * ((z / ((z * a) - t)) + (x / (y * t_1))) t_3 = (x - (z * y)) / t_1 tmp = 0 if t_3 <= -math.inf: tmp = t_2 elif t_3 <= -2e-313: tmp = t_3 elif t_3 <= 0.0: tmp = y / (a - (t / z)) elif t_3 <= 2e+272: tmp = t_3 elif t_3 <= math.inf: tmp = t_2 else: tmp = y / a return tmp
function code(x, y, z, t, a) t_1 = Float64(t - Float64(z * a)) t_2 = Float64(y * Float64(Float64(z / Float64(Float64(z * a) - t)) + Float64(x / Float64(y * t_1)))) t_3 = Float64(Float64(x - Float64(z * y)) / t_1) tmp = 0.0 if (t_3 <= Float64(-Inf)) tmp = t_2; elseif (t_3 <= -2e-313) tmp = t_3; elseif (t_3 <= 0.0) tmp = Float64(y / Float64(a - Float64(t / z))); elseif (t_3 <= 2e+272) tmp = t_3; 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 = t - (z * a); t_2 = y * ((z / ((z * a) - t)) + (x / (y * t_1))); t_3 = (x - (z * y)) / t_1; tmp = 0.0; if (t_3 <= -Inf) tmp = t_2; elseif (t_3 <= -2e-313) tmp = t_3; elseif (t_3 <= 0.0) tmp = y / (a - (t / z)); elseif (t_3 <= 2e+272) tmp = t_3; 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[(t - N[(z * a), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(y * N[(N[(z / N[(N[(z * a), $MachinePrecision] - t), $MachinePrecision]), $MachinePrecision] + N[(x / N[(y * t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(N[(x - N[(z * y), $MachinePrecision]), $MachinePrecision] / t$95$1), $MachinePrecision]}, If[LessEqual[t$95$3, (-Infinity)], t$95$2, If[LessEqual[t$95$3, -2e-313], t$95$3, If[LessEqual[t$95$3, 0.0], N[(y / N[(a - N[(t / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$3, 2e+272], t$95$3, If[LessEqual[t$95$3, Infinity], t$95$2, N[(y / a), $MachinePrecision]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := t - z \cdot a\\
t_2 := y \cdot \left(\frac{z}{z \cdot a - t} + \frac{x}{y \cdot t\_1}\right)\\
t_3 := \frac{x - z \cdot y}{t\_1}\\
\mathbf{if}\;t\_3 \leq -\infty:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;t\_3 \leq -2 \cdot 10^{-313}:\\
\;\;\;\;t\_3\\
\mathbf{elif}\;t\_3 \leq 0:\\
\;\;\;\;\frac{y}{a - \frac{t}{z}}\\
\mathbf{elif}\;t\_3 \leq 2 \cdot 10^{+272}:\\
\;\;\;\;t\_3\\
\mathbf{elif}\;t\_3 \leq \infty:\\
\;\;\;\;t\_2\\
\mathbf{else}:\\
\;\;\;\;\frac{y}{a}\\
\end{array}
\end{array}
if (/.f64 (-.f64 x (*.f64 y z)) (-.f64 t (*.f64 a z))) < -inf.0 or 2.0000000000000001e272 < (/.f64 (-.f64 x (*.f64 y z)) (-.f64 t (*.f64 a z))) < +inf.0Initial program 67.1%
*-commutative67.1%
Simplified67.1%
Taylor expanded in y around inf 99.8%
Simplified99.8%
if -inf.0 < (/.f64 (-.f64 x (*.f64 y z)) (-.f64 t (*.f64 a z))) < -1.99999999998e-313 or 0.0 < (/.f64 (-.f64 x (*.f64 y z)) (-.f64 t (*.f64 a z))) < 2.0000000000000001e272Initial program 99.7%
if -1.99999999998e-313 < (/.f64 (-.f64 x (*.f64 y z)) (-.f64 t (*.f64 a z))) < 0.0Initial program 70.0%
*-commutative70.0%
Simplified70.0%
Taylor expanded in x around inf 70.0%
Simplified69.9%
Taylor expanded in z around inf 69.9%
associate-*r/69.9%
neg-mul-169.9%
Simplified69.9%
Taylor expanded in y around 0 85.9%
associate-/r*83.4%
mul-1-neg83.4%
distribute-frac-neg83.4%
distribute-frac-neg83.4%
unsub-neg83.4%
Simplified83.4%
Taylor expanded in x around 0 85.9%
if +inf.0 < (/.f64 (-.f64 x (*.f64 y z)) (-.f64 t (*.f64 a z))) Initial program 0.0%
*-commutative0.0%
Simplified0.0%
Taylor expanded in z around inf 100.0%
Final simplification97.6%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (- t (* z a))))
(if (or (<= z -7.6e+100) (not (<= z 1.15e+54)))
(fma x (/ (/ y x) (- a (/ t z))) (/ x t_1))
(/ (- x (* z y)) t_1))))
double code(double x, double y, double z, double t, double a) {
double t_1 = t - (z * a);
double tmp;
if ((z <= -7.6e+100) || !(z <= 1.15e+54)) {
tmp = fma(x, ((y / x) / (a - (t / z))), (x / t_1));
} else {
tmp = (x - (z * y)) / t_1;
}
return tmp;
}
function code(x, y, z, t, a) t_1 = Float64(t - Float64(z * a)) tmp = 0.0 if ((z <= -7.6e+100) || !(z <= 1.15e+54)) tmp = fma(x, Float64(Float64(y / x) / Float64(a - Float64(t / z))), Float64(x / t_1)); else tmp = Float64(Float64(x - Float64(z * y)) / t_1); end return tmp end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(t - N[(z * a), $MachinePrecision]), $MachinePrecision]}, If[Or[LessEqual[z, -7.6e+100], N[Not[LessEqual[z, 1.15e+54]], $MachinePrecision]], N[(x * N[(N[(y / x), $MachinePrecision] / N[(a - N[(t / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(x / t$95$1), $MachinePrecision]), $MachinePrecision], N[(N[(x - N[(z * y), $MachinePrecision]), $MachinePrecision] / t$95$1), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := t - z \cdot a\\
\mathbf{if}\;z \leq -7.6 \cdot 10^{+100} \lor \neg \left(z \leq 1.15 \cdot 10^{+54}\right):\\
\;\;\;\;\mathsf{fma}\left(x, \frac{\frac{y}{x}}{a - \frac{t}{z}}, \frac{x}{t\_1}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{x - z \cdot y}{t\_1}\\
\end{array}
\end{array}
if z < -7.59999999999999927e100 or 1.14999999999999997e54 < z Initial program 62.6%
*-commutative62.6%
Simplified62.6%
Taylor expanded in x around inf 57.1%
Simplified69.4%
Taylor expanded in z around inf 69.4%
associate-*r/69.4%
neg-mul-169.4%
Simplified69.4%
Taylor expanded in y around 0 85.5%
associate-/r*86.4%
mul-1-neg86.4%
distribute-frac-neg86.4%
distribute-frac-neg86.4%
unsub-neg86.4%
Simplified86.4%
if -7.59999999999999927e100 < z < 1.14999999999999997e54Initial program 99.2%
Final simplification94.2%
(FPCore (x y z t a)
:precision binary64
(if (or (<= z -2.8e+132)
(not
(or (<= z -9.5e+88)
(and (not (<= z -1.8e-13))
(or (<= z 2.75e-78)
(and (not (<= z 3.2e-32)) (<= z 4000000000.0)))))))
(/ y (- a (/ t z)))
(/ x (- t (* z a)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -2.8e+132) || !((z <= -9.5e+88) || (!(z <= -1.8e-13) && ((z <= 2.75e-78) || (!(z <= 3.2e-32) && (z <= 4000000000.0)))))) {
tmp = y / (a - (t / z));
} 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 <= (-2.8d+132)) .or. (.not. (z <= (-9.5d+88)) .or. (.not. (z <= (-1.8d-13))) .and. (z <= 2.75d-78) .or. (.not. (z <= 3.2d-32)) .and. (z <= 4000000000.0d0))) then
tmp = y / (a - (t / z))
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 <= -2.8e+132) || !((z <= -9.5e+88) || (!(z <= -1.8e-13) && ((z <= 2.75e-78) || (!(z <= 3.2e-32) && (z <= 4000000000.0)))))) {
tmp = y / (a - (t / z));
} else {
tmp = x / (t - (z * a));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -2.8e+132) or not ((z <= -9.5e+88) or (not (z <= -1.8e-13) and ((z <= 2.75e-78) or (not (z <= 3.2e-32) and (z <= 4000000000.0))))): tmp = y / (a - (t / z)) else: tmp = x / (t - (z * a)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -2.8e+132) || !((z <= -9.5e+88) || (!(z <= -1.8e-13) && ((z <= 2.75e-78) || (!(z <= 3.2e-32) && (z <= 4000000000.0)))))) tmp = Float64(y / Float64(a - Float64(t / z))); 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 <= -2.8e+132) || ~(((z <= -9.5e+88) || (~((z <= -1.8e-13)) && ((z <= 2.75e-78) || (~((z <= 3.2e-32)) && (z <= 4000000000.0))))))) tmp = y / (a - (t / z)); else tmp = x / (t - (z * a)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -2.8e+132], N[Not[Or[LessEqual[z, -9.5e+88], And[N[Not[LessEqual[z, -1.8e-13]], $MachinePrecision], Or[LessEqual[z, 2.75e-78], And[N[Not[LessEqual[z, 3.2e-32]], $MachinePrecision], LessEqual[z, 4000000000.0]]]]]], $MachinePrecision]], N[(y / N[(a - N[(t / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x / N[(t - N[(z * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.8 \cdot 10^{+132} \lor \neg \left(z \leq -9.5 \cdot 10^{+88} \lor \neg \left(z \leq -1.8 \cdot 10^{-13}\right) \land \left(z \leq 2.75 \cdot 10^{-78} \lor \neg \left(z \leq 3.2 \cdot 10^{-32}\right) \land z \leq 4000000000\right)\right):\\
\;\;\;\;\frac{y}{a - \frac{t}{z}}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{t - z \cdot a}\\
\end{array}
\end{array}
if z < -2.7999999999999999e132 or -9.50000000000000059e88 < z < -1.7999999999999999e-13 or 2.75000000000000009e-78 < z < 3.2000000000000002e-32 or 4e9 < z Initial program 70.6%
*-commutative70.6%
Simplified70.6%
Taylor expanded in x around inf 61.6%
Simplified71.3%
Taylor expanded in z around inf 71.3%
associate-*r/71.3%
neg-mul-171.3%
Simplified71.3%
Taylor expanded in y around 0 84.9%
associate-/r*84.3%
mul-1-neg84.3%
distribute-frac-neg84.3%
distribute-frac-neg84.3%
unsub-neg84.3%
Simplified84.3%
Taylor expanded in x around 0 81.6%
if -2.7999999999999999e132 < z < -9.50000000000000059e88 or -1.7999999999999999e-13 < z < 2.75000000000000009e-78 or 3.2000000000000002e-32 < z < 4e9Initial program 98.4%
*-commutative98.4%
Simplified98.4%
Taylor expanded in x around inf 80.6%
*-commutative80.6%
Simplified80.6%
Final simplification81.1%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (/ x (- t (* z a)))))
(if (<= z -7.2e+133)
(/ y a)
(if (<= z -1.65e+87)
t_1
(if (<= z -8.5e+28)
(/ (* z y) (- t))
(if (<= z 950000000000.0)
t_1
(if (<= z 7.2e+137) (* z (/ y (- t))) (/ y a))))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = x / (t - (z * a));
double tmp;
if (z <= -7.2e+133) {
tmp = y / a;
} else if (z <= -1.65e+87) {
tmp = t_1;
} else if (z <= -8.5e+28) {
tmp = (z * y) / -t;
} else if (z <= 950000000000.0) {
tmp = t_1;
} else if (z <= 7.2e+137) {
tmp = z * (y / -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) :: t_1
real(8) :: tmp
t_1 = x / (t - (z * a))
if (z <= (-7.2d+133)) then
tmp = y / a
else if (z <= (-1.65d+87)) then
tmp = t_1
else if (z <= (-8.5d+28)) then
tmp = (z * y) / -t
else if (z <= 950000000000.0d0) then
tmp = t_1
else if (z <= 7.2d+137) then
tmp = z * (y / -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 t_1 = x / (t - (z * a));
double tmp;
if (z <= -7.2e+133) {
tmp = y / a;
} else if (z <= -1.65e+87) {
tmp = t_1;
} else if (z <= -8.5e+28) {
tmp = (z * y) / -t;
} else if (z <= 950000000000.0) {
tmp = t_1;
} else if (z <= 7.2e+137) {
tmp = z * (y / -t);
} else {
tmp = y / a;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = x / (t - (z * a)) tmp = 0 if z <= -7.2e+133: tmp = y / a elif z <= -1.65e+87: tmp = t_1 elif z <= -8.5e+28: tmp = (z * y) / -t elif z <= 950000000000.0: tmp = t_1 elif z <= 7.2e+137: tmp = z * (y / -t) else: tmp = y / a return tmp
function code(x, y, z, t, a) t_1 = Float64(x / Float64(t - Float64(z * a))) tmp = 0.0 if (z <= -7.2e+133) tmp = Float64(y / a); elseif (z <= -1.65e+87) tmp = t_1; elseif (z <= -8.5e+28) tmp = Float64(Float64(z * y) / Float64(-t)); elseif (z <= 950000000000.0) tmp = t_1; elseif (z <= 7.2e+137) tmp = Float64(z * Float64(y / Float64(-t))); else tmp = Float64(y / a); end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = x / (t - (z * a)); tmp = 0.0; if (z <= -7.2e+133) tmp = y / a; elseif (z <= -1.65e+87) tmp = t_1; elseif (z <= -8.5e+28) tmp = (z * y) / -t; elseif (z <= 950000000000.0) tmp = t_1; elseif (z <= 7.2e+137) tmp = z * (y / -t); else tmp = y / a; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(x / N[(t - N[(z * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -7.2e+133], N[(y / a), $MachinePrecision], If[LessEqual[z, -1.65e+87], t$95$1, If[LessEqual[z, -8.5e+28], N[(N[(z * y), $MachinePrecision] / (-t)), $MachinePrecision], If[LessEqual[z, 950000000000.0], t$95$1, If[LessEqual[z, 7.2e+137], N[(z * N[(y / (-t)), $MachinePrecision]), $MachinePrecision], N[(y / a), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{x}{t - z \cdot a}\\
\mathbf{if}\;z \leq -7.2 \cdot 10^{+133}:\\
\;\;\;\;\frac{y}{a}\\
\mathbf{elif}\;z \leq -1.65 \cdot 10^{+87}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq -8.5 \cdot 10^{+28}:\\
\;\;\;\;\frac{z \cdot y}{-t}\\
\mathbf{elif}\;z \leq 950000000000:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 7.2 \cdot 10^{+137}:\\
\;\;\;\;z \cdot \frac{y}{-t}\\
\mathbf{else}:\\
\;\;\;\;\frac{y}{a}\\
\end{array}
\end{array}
if z < -7.19999999999999956e133 or 7.1999999999999999e137 < z Initial program 60.8%
*-commutative60.8%
Simplified60.8%
Taylor expanded in z around inf 65.4%
if -7.19999999999999956e133 < z < -1.6500000000000001e87 or -8.49999999999999954e28 < z < 9.5e11Initial program 98.6%
*-commutative98.6%
Simplified98.6%
Taylor expanded in x around inf 75.0%
*-commutative75.0%
Simplified75.0%
if -1.6500000000000001e87 < z < -8.49999999999999954e28Initial program 91.1%
*-commutative91.1%
Simplified91.1%
Taylor expanded in x around 0 82.2%
mul-1-neg82.2%
associate-/l*82.1%
distribute-rgt-neg-in82.1%
distribute-neg-frac282.1%
cancel-sign-sub-inv82.1%
*-commutative82.1%
+-commutative82.1%
distribute-rgt-neg-out82.1%
distribute-lft-neg-in82.1%
*-commutative82.1%
fma-undefine82.1%
neg-sub082.1%
fma-undefine82.1%
distribute-rgt-neg-in82.1%
mul-1-neg82.1%
associate-*r*82.1%
neg-mul-182.1%
*-commutative82.1%
associate--r+82.1%
neg-sub082.1%
distribute-rgt-neg-out82.1%
remove-double-neg82.1%
Simplified82.1%
Taylor expanded in z around 0 73.3%
associate-*r/73.3%
associate-*r*73.3%
neg-mul-173.3%
Simplified73.3%
if 9.5e11 < z < 7.1999999999999999e137Initial program 67.4%
*-commutative67.4%
Simplified67.4%
Taylor expanded in t around inf 44.4%
Taylor expanded in x around 0 35.9%
mul-1-neg35.9%
*-commutative35.9%
associate-/l*49.7%
distribute-rgt-neg-in49.7%
distribute-neg-frac249.7%
Simplified49.7%
Final simplification70.1%
(FPCore (x y z t a)
:precision binary64
(if (<= z -4.4e+92)
(/ y a)
(if (<= z -4.9e+29)
(/ (* z y) (- t))
(if (<= z -0.04)
(/ y a)
(if (<= z 840000000000.0)
(/ x t)
(if (<= z 7e+137) (* z (/ y (- t))) (/ y a)))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -4.4e+92) {
tmp = y / a;
} else if (z <= -4.9e+29) {
tmp = (z * y) / -t;
} else if (z <= -0.04) {
tmp = y / a;
} else if (z <= 840000000000.0) {
tmp = x / t;
} else if (z <= 7e+137) {
tmp = z * (y / -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 <= (-4.4d+92)) then
tmp = y / a
else if (z <= (-4.9d+29)) then
tmp = (z * y) / -t
else if (z <= (-0.04d0)) then
tmp = y / a
else if (z <= 840000000000.0d0) then
tmp = x / t
else if (z <= 7d+137) then
tmp = z * (y / -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 <= -4.4e+92) {
tmp = y / a;
} else if (z <= -4.9e+29) {
tmp = (z * y) / -t;
} else if (z <= -0.04) {
tmp = y / a;
} else if (z <= 840000000000.0) {
tmp = x / t;
} else if (z <= 7e+137) {
tmp = z * (y / -t);
} else {
tmp = y / a;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -4.4e+92: tmp = y / a elif z <= -4.9e+29: tmp = (z * y) / -t elif z <= -0.04: tmp = y / a elif z <= 840000000000.0: tmp = x / t elif z <= 7e+137: tmp = z * (y / -t) else: tmp = y / a return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -4.4e+92) tmp = Float64(y / a); elseif (z <= -4.9e+29) tmp = Float64(Float64(z * y) / Float64(-t)); elseif (z <= -0.04) tmp = Float64(y / a); elseif (z <= 840000000000.0) tmp = Float64(x / t); elseif (z <= 7e+137) tmp = Float64(z * Float64(y / Float64(-t))); else tmp = Float64(y / a); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (z <= -4.4e+92) tmp = y / a; elseif (z <= -4.9e+29) tmp = (z * y) / -t; elseif (z <= -0.04) tmp = y / a; elseif (z <= 840000000000.0) tmp = x / t; elseif (z <= 7e+137) tmp = z * (y / -t); else tmp = y / a; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -4.4e+92], N[(y / a), $MachinePrecision], If[LessEqual[z, -4.9e+29], N[(N[(z * y), $MachinePrecision] / (-t)), $MachinePrecision], If[LessEqual[z, -0.04], N[(y / a), $MachinePrecision], If[LessEqual[z, 840000000000.0], N[(x / t), $MachinePrecision], If[LessEqual[z, 7e+137], N[(z * N[(y / (-t)), $MachinePrecision]), $MachinePrecision], N[(y / a), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -4.4 \cdot 10^{+92}:\\
\;\;\;\;\frac{y}{a}\\
\mathbf{elif}\;z \leq -4.9 \cdot 10^{+29}:\\
\;\;\;\;\frac{z \cdot y}{-t}\\
\mathbf{elif}\;z \leq -0.04:\\
\;\;\;\;\frac{y}{a}\\
\mathbf{elif}\;z \leq 840000000000:\\
\;\;\;\;\frac{x}{t}\\
\mathbf{elif}\;z \leq 7 \cdot 10^{+137}:\\
\;\;\;\;z \cdot \frac{y}{-t}\\
\mathbf{else}:\\
\;\;\;\;\frac{y}{a}\\
\end{array}
\end{array}
if z < -4.39999999999999984e92 or -4.9000000000000001e29 < z < -0.0400000000000000008 or 7.0000000000000002e137 < z Initial program 68.2%
*-commutative68.2%
Simplified68.2%
Taylor expanded in z around inf 60.7%
if -4.39999999999999984e92 < z < -4.9000000000000001e29Initial program 92.4%
*-commutative92.4%
Simplified92.4%
Taylor expanded in x around 0 77.7%
mul-1-neg77.7%
associate-/l*77.6%
distribute-rgt-neg-in77.6%
distribute-neg-frac277.6%
cancel-sign-sub-inv77.6%
*-commutative77.6%
+-commutative77.6%
distribute-rgt-neg-out77.6%
distribute-lft-neg-in77.6%
*-commutative77.6%
fma-undefine77.6%
neg-sub077.6%
fma-undefine77.6%
distribute-rgt-neg-in77.6%
mul-1-neg77.6%
associate-*r*77.6%
neg-mul-177.6%
*-commutative77.6%
associate--r+77.6%
neg-sub077.6%
distribute-rgt-neg-out77.6%
remove-double-neg77.6%
Simplified77.6%
Taylor expanded in z around 0 70.2%
associate-*r/70.2%
associate-*r*70.2%
neg-mul-170.2%
Simplified70.2%
if -0.0400000000000000008 < z < 8.4e11Initial program 99.8%
*-commutative99.8%
Simplified99.8%
Taylor expanded in z around 0 63.0%
if 8.4e11 < z < 7.0000000000000002e137Initial program 67.4%
*-commutative67.4%
Simplified67.4%
Taylor expanded in t around inf 44.4%
Taylor expanded in x around 0 35.9%
mul-1-neg35.9%
*-commutative35.9%
associate-/l*49.7%
distribute-rgt-neg-in49.7%
distribute-neg-frac249.7%
Simplified49.7%
Final simplification61.4%
(FPCore (x y z t a)
:precision binary64
(if (<= z -2.9e+92)
(/ y a)
(if (<= z -2e+29)
(* (- y) (/ z t))
(if (<= z -0.048)
(/ y a)
(if (<= z 650000000000.0)
(/ x t)
(if (<= z 2.2e+138) (* z (/ y (- t))) (/ y a)))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -2.9e+92) {
tmp = y / a;
} else if (z <= -2e+29) {
tmp = -y * (z / t);
} else if (z <= -0.048) {
tmp = y / a;
} else if (z <= 650000000000.0) {
tmp = x / t;
} else if (z <= 2.2e+138) {
tmp = z * (y / -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.9d+92)) then
tmp = y / a
else if (z <= (-2d+29)) then
tmp = -y * (z / t)
else if (z <= (-0.048d0)) then
tmp = y / a
else if (z <= 650000000000.0d0) then
tmp = x / t
else if (z <= 2.2d+138) then
tmp = z * (y / -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.9e+92) {
tmp = y / a;
} else if (z <= -2e+29) {
tmp = -y * (z / t);
} else if (z <= -0.048) {
tmp = y / a;
} else if (z <= 650000000000.0) {
tmp = x / t;
} else if (z <= 2.2e+138) {
tmp = z * (y / -t);
} else {
tmp = y / a;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -2.9e+92: tmp = y / a elif z <= -2e+29: tmp = -y * (z / t) elif z <= -0.048: tmp = y / a elif z <= 650000000000.0: tmp = x / t elif z <= 2.2e+138: tmp = z * (y / -t) else: tmp = y / a return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -2.9e+92) tmp = Float64(y / a); elseif (z <= -2e+29) tmp = Float64(Float64(-y) * Float64(z / t)); elseif (z <= -0.048) tmp = Float64(y / a); elseif (z <= 650000000000.0) tmp = Float64(x / t); elseif (z <= 2.2e+138) tmp = Float64(z * Float64(y / Float64(-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.9e+92) tmp = y / a; elseif (z <= -2e+29) tmp = -y * (z / t); elseif (z <= -0.048) tmp = y / a; elseif (z <= 650000000000.0) tmp = x / t; elseif (z <= 2.2e+138) tmp = z * (y / -t); else tmp = y / a; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -2.9e+92], N[(y / a), $MachinePrecision], If[LessEqual[z, -2e+29], N[((-y) * N[(z / t), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -0.048], N[(y / a), $MachinePrecision], If[LessEqual[z, 650000000000.0], N[(x / t), $MachinePrecision], If[LessEqual[z, 2.2e+138], N[(z * N[(y / (-t)), $MachinePrecision]), $MachinePrecision], N[(y / a), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.9 \cdot 10^{+92}:\\
\;\;\;\;\frac{y}{a}\\
\mathbf{elif}\;z \leq -2 \cdot 10^{+29}:\\
\;\;\;\;\left(-y\right) \cdot \frac{z}{t}\\
\mathbf{elif}\;z \leq -0.048:\\
\;\;\;\;\frac{y}{a}\\
\mathbf{elif}\;z \leq 650000000000:\\
\;\;\;\;\frac{x}{t}\\
\mathbf{elif}\;z \leq 2.2 \cdot 10^{+138}:\\
\;\;\;\;z \cdot \frac{y}{-t}\\
\mathbf{else}:\\
\;\;\;\;\frac{y}{a}\\
\end{array}
\end{array}
if z < -2.9000000000000001e92 or -1.99999999999999983e29 < z < -0.048000000000000001 or 2.2000000000000001e138 < z Initial program 68.2%
*-commutative68.2%
Simplified68.2%
Taylor expanded in z around inf 60.7%
if -2.9000000000000001e92 < z < -1.99999999999999983e29Initial program 92.4%
*-commutative92.4%
Simplified92.4%
Taylor expanded in x around 0 77.7%
mul-1-neg77.7%
associate-/l*77.6%
distribute-rgt-neg-in77.6%
distribute-neg-frac277.6%
cancel-sign-sub-inv77.6%
*-commutative77.6%
+-commutative77.6%
distribute-rgt-neg-out77.6%
distribute-lft-neg-in77.6%
*-commutative77.6%
fma-undefine77.6%
neg-sub077.6%
fma-undefine77.6%
distribute-rgt-neg-in77.6%
mul-1-neg77.6%
associate-*r*77.6%
neg-mul-177.6%
*-commutative77.6%
associate--r+77.6%
neg-sub077.6%
distribute-rgt-neg-out77.6%
remove-double-neg77.6%
Simplified77.6%
Taylor expanded in z around 0 70.0%
associate-*r/70.0%
mul-1-neg70.0%
Simplified70.0%
if -0.048000000000000001 < z < 6.5e11Initial program 99.8%
*-commutative99.8%
Simplified99.8%
Taylor expanded in z around 0 63.0%
if 6.5e11 < z < 2.2000000000000001e138Initial program 67.4%
*-commutative67.4%
Simplified67.4%
Taylor expanded in t around inf 44.4%
Taylor expanded in x around 0 35.9%
mul-1-neg35.9%
*-commutative35.9%
associate-/l*49.7%
distribute-rgt-neg-in49.7%
distribute-neg-frac249.7%
Simplified49.7%
Final simplification61.4%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (* (- y) (/ z t))))
(if (<= z -4.8e+92)
(/ y a)
(if (<= z -4.5e+29)
t_1
(if (<= z -0.054)
(/ y a)
(if (<= z 68000000000.0)
(/ x t)
(if (<= z 7.2e+137) t_1 (/ y a))))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = -y * (z / t);
double tmp;
if (z <= -4.8e+92) {
tmp = y / a;
} else if (z <= -4.5e+29) {
tmp = t_1;
} else if (z <= -0.054) {
tmp = y / a;
} else if (z <= 68000000000.0) {
tmp = x / t;
} else if (z <= 7.2e+137) {
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 = -y * (z / t)
if (z <= (-4.8d+92)) then
tmp = y / a
else if (z <= (-4.5d+29)) then
tmp = t_1
else if (z <= (-0.054d0)) then
tmp = y / a
else if (z <= 68000000000.0d0) then
tmp = x / t
else if (z <= 7.2d+137) 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 = -y * (z / t);
double tmp;
if (z <= -4.8e+92) {
tmp = y / a;
} else if (z <= -4.5e+29) {
tmp = t_1;
} else if (z <= -0.054) {
tmp = y / a;
} else if (z <= 68000000000.0) {
tmp = x / t;
} else if (z <= 7.2e+137) {
tmp = t_1;
} else {
tmp = y / a;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = -y * (z / t) tmp = 0 if z <= -4.8e+92: tmp = y / a elif z <= -4.5e+29: tmp = t_1 elif z <= -0.054: tmp = y / a elif z <= 68000000000.0: tmp = x / t elif z <= 7.2e+137: tmp = t_1 else: tmp = y / a return tmp
function code(x, y, z, t, a) t_1 = Float64(Float64(-y) * Float64(z / t)) tmp = 0.0 if (z <= -4.8e+92) tmp = Float64(y / a); elseif (z <= -4.5e+29) tmp = t_1; elseif (z <= -0.054) tmp = Float64(y / a); elseif (z <= 68000000000.0) tmp = Float64(x / t); elseif (z <= 7.2e+137) tmp = t_1; else tmp = Float64(y / a); end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = -y * (z / t); tmp = 0.0; if (z <= -4.8e+92) tmp = y / a; elseif (z <= -4.5e+29) tmp = t_1; elseif (z <= -0.054) tmp = y / a; elseif (z <= 68000000000.0) tmp = x / t; elseif (z <= 7.2e+137) tmp = t_1; else tmp = y / a; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[((-y) * N[(z / t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -4.8e+92], N[(y / a), $MachinePrecision], If[LessEqual[z, -4.5e+29], t$95$1, If[LessEqual[z, -0.054], N[(y / a), $MachinePrecision], If[LessEqual[z, 68000000000.0], N[(x / t), $MachinePrecision], If[LessEqual[z, 7.2e+137], t$95$1, N[(y / a), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(-y\right) \cdot \frac{z}{t}\\
\mathbf{if}\;z \leq -4.8 \cdot 10^{+92}:\\
\;\;\;\;\frac{y}{a}\\
\mathbf{elif}\;z \leq -4.5 \cdot 10^{+29}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq -0.054:\\
\;\;\;\;\frac{y}{a}\\
\mathbf{elif}\;z \leq 68000000000:\\
\;\;\;\;\frac{x}{t}\\
\mathbf{elif}\;z \leq 7.2 \cdot 10^{+137}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;\frac{y}{a}\\
\end{array}
\end{array}
if z < -4.80000000000000009e92 or -4.5000000000000002e29 < z < -0.0539999999999999994 or 7.1999999999999999e137 < z Initial program 68.2%
*-commutative68.2%
Simplified68.2%
Taylor expanded in z around inf 60.7%
if -4.80000000000000009e92 < z < -4.5000000000000002e29 or 6.8e10 < z < 7.1999999999999999e137Initial program 77.0%
*-commutative77.0%
Simplified77.0%
Taylor expanded in x around 0 57.3%
mul-1-neg57.3%
associate-/l*65.8%
distribute-rgt-neg-in65.8%
distribute-neg-frac265.8%
cancel-sign-sub-inv65.8%
*-commutative65.8%
+-commutative65.8%
distribute-rgt-neg-out65.8%
distribute-lft-neg-in65.8%
*-commutative65.8%
fma-undefine65.8%
neg-sub065.8%
fma-undefine65.8%
distribute-rgt-neg-in65.8%
mul-1-neg65.8%
associate-*r*65.8%
neg-mul-165.8%
*-commutative65.8%
associate--r+65.8%
neg-sub065.8%
distribute-rgt-neg-out65.8%
remove-double-neg65.8%
Simplified65.8%
Taylor expanded in z around 0 57.3%
associate-*r/57.3%
mul-1-neg57.3%
Simplified57.3%
if -0.0539999999999999994 < z < 6.8e10Initial program 99.8%
*-commutative99.8%
Simplified99.8%
Taylor expanded in z around 0 63.0%
Final simplification61.4%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (/ y (- a (/ t z)))))
(if (<= z -8.2e-14)
t_1
(if (<= z -4.3e-184)
(/ x (- t (* z a)))
(if (<= z 2000000000.0) (/ (- x (* z y)) t) t_1)))))
double code(double x, double y, double z, double t, double a) {
double t_1 = y / (a - (t / z));
double tmp;
if (z <= -8.2e-14) {
tmp = t_1;
} else if (z <= -4.3e-184) {
tmp = x / (t - (z * a));
} else if (z <= 2000000000.0) {
tmp = (x - (z * y)) / 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 / (a - (t / z))
if (z <= (-8.2d-14)) then
tmp = t_1
else if (z <= (-4.3d-184)) then
tmp = x / (t - (z * a))
else if (z <= 2000000000.0d0) then
tmp = (x - (z * y)) / 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 / (a - (t / z));
double tmp;
if (z <= -8.2e-14) {
tmp = t_1;
} else if (z <= -4.3e-184) {
tmp = x / (t - (z * a));
} else if (z <= 2000000000.0) {
tmp = (x - (z * y)) / t;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = y / (a - (t / z)) tmp = 0 if z <= -8.2e-14: tmp = t_1 elif z <= -4.3e-184: tmp = x / (t - (z * a)) elif z <= 2000000000.0: tmp = (x - (z * y)) / t else: tmp = t_1 return tmp
function code(x, y, z, t, a) t_1 = Float64(y / Float64(a - Float64(t / z))) tmp = 0.0 if (z <= -8.2e-14) tmp = t_1; elseif (z <= -4.3e-184) tmp = Float64(x / Float64(t - Float64(z * a))); elseif (z <= 2000000000.0) tmp = Float64(Float64(x - Float64(z * y)) / t); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = y / (a - (t / z)); tmp = 0.0; if (z <= -8.2e-14) tmp = t_1; elseif (z <= -4.3e-184) tmp = x / (t - (z * a)); elseif (z <= 2000000000.0) tmp = (x - (z * y)) / t; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(y / N[(a - N[(t / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -8.2e-14], t$95$1, If[LessEqual[z, -4.3e-184], N[(x / N[(t - N[(z * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 2000000000.0], N[(N[(x - N[(z * y), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{y}{a - \frac{t}{z}}\\
\mathbf{if}\;z \leq -8.2 \cdot 10^{-14}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq -4.3 \cdot 10^{-184}:\\
\;\;\;\;\frac{x}{t - z \cdot a}\\
\mathbf{elif}\;z \leq 2000000000:\\
\;\;\;\;\frac{x - z \cdot y}{t}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -8.2000000000000004e-14 or 2e9 < z Initial program 71.4%
*-commutative71.4%
Simplified71.4%
Taylor expanded in x around inf 65.1%
Simplified73.4%
Taylor expanded in z around inf 73.4%
associate-*r/73.4%
neg-mul-173.4%
Simplified73.4%
Taylor expanded in y around 0 87.3%
associate-/r*86.1%
mul-1-neg86.1%
distribute-frac-neg86.1%
distribute-frac-neg86.1%
unsub-neg86.1%
Simplified86.1%
Taylor expanded in x around 0 77.4%
if -8.2000000000000004e-14 < z < -4.30000000000000007e-184Initial program 99.8%
*-commutative99.8%
Simplified99.8%
Taylor expanded in x around inf 80.9%
*-commutative80.9%
Simplified80.9%
if -4.30000000000000007e-184 < z < 2e9Initial program 99.8%
*-commutative99.8%
Simplified99.8%
Taylor expanded in t around inf 85.8%
Final simplification80.8%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -3.7e+134) (not (<= z 1.05e+121))) (/ y (- a (/ t z))) (/ (- x (* z y)) (- t (* z a)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -3.7e+134) || !(z <= 1.05e+121)) {
tmp = y / (a - (t / z));
} else {
tmp = (x - (z * y)) / (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 <= (-3.7d+134)) .or. (.not. (z <= 1.05d+121))) then
tmp = y / (a - (t / z))
else
tmp = (x - (z * y)) / (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 <= -3.7e+134) || !(z <= 1.05e+121)) {
tmp = y / (a - (t / z));
} else {
tmp = (x - (z * y)) / (t - (z * a));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -3.7e+134) or not (z <= 1.05e+121): tmp = y / (a - (t / z)) else: tmp = (x - (z * y)) / (t - (z * a)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -3.7e+134) || !(z <= 1.05e+121)) tmp = Float64(y / Float64(a - Float64(t / z))); else tmp = Float64(Float64(x - Float64(z * y)) / Float64(t - Float64(z * a))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((z <= -3.7e+134) || ~((z <= 1.05e+121))) tmp = y / (a - (t / z)); else tmp = (x - (z * y)) / (t - (z * a)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -3.7e+134], N[Not[LessEqual[z, 1.05e+121]], $MachinePrecision]], N[(y / N[(a - N[(t / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x - N[(z * y), $MachinePrecision]), $MachinePrecision] / N[(t - N[(z * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -3.7 \cdot 10^{+134} \lor \neg \left(z \leq 1.05 \cdot 10^{+121}\right):\\
\;\;\;\;\frac{y}{a - \frac{t}{z}}\\
\mathbf{else}:\\
\;\;\;\;\frac{x - z \cdot y}{t - z \cdot a}\\
\end{array}
\end{array}
if z < -3.70000000000000013e134 or 1.0500000000000001e121 < z Initial program 59.6%
*-commutative59.6%
Simplified59.6%
Taylor expanded in x around inf 53.8%
Simplified67.1%
Taylor expanded in z around inf 67.1%
associate-*r/67.1%
neg-mul-167.1%
Simplified67.1%
Taylor expanded in y around 0 85.2%
associate-/r*86.4%
mul-1-neg86.4%
distribute-frac-neg86.4%
distribute-frac-neg86.4%
unsub-neg86.4%
Simplified86.4%
Taylor expanded in x around 0 85.3%
if -3.70000000000000013e134 < z < 1.0500000000000001e121Initial program 96.0%
Final simplification92.8%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -0.055) (not (<= z 37000000000.0))) (/ y a) (/ x t)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -0.055) || !(z <= 37000000000.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 <= (-0.055d0)) .or. (.not. (z <= 37000000000.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 <= -0.055) || !(z <= 37000000000.0)) {
tmp = y / a;
} else {
tmp = x / t;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -0.055) or not (z <= 37000000000.0): tmp = y / a else: tmp = x / t return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -0.055) || !(z <= 37000000000.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 <= -0.055) || ~((z <= 37000000000.0))) tmp = y / a; else tmp = x / t; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -0.055], N[Not[LessEqual[z, 37000000000.0]], $MachinePrecision]], N[(y / a), $MachinePrecision], N[(x / t), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -0.055 \lor \neg \left(z \leq 37000000000\right):\\
\;\;\;\;\frac{y}{a}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{t}\\
\end{array}
\end{array}
if z < -0.0550000000000000003 or 3.7e10 < z Initial program 70.5%
*-commutative70.5%
Simplified70.5%
Taylor expanded in z around inf 51.8%
if -0.0550000000000000003 < z < 3.7e10Initial program 99.8%
*-commutative99.8%
Simplified99.8%
Taylor expanded in z around 0 63.0%
Final simplification57.3%
(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 84.9%
*-commutative84.9%
Simplified84.9%
Taylor expanded in z around 0 40.3%
(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 2024085
(FPCore (x y z t a)
:name "Diagrams.Solve.Tridiagonal:solveTriDiagonal from diagrams-solve-0.1, A"
:precision binary64
:alt
(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))))