
(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 (if (<= z -1.9e+207) (- (/ y a) (/ (/ x a) z)) (if (<= z 7.2e+155) (/ (- x (* z y)) (- t (* z a))) (/ (- y (/ x z)) a))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -1.9e+207) {
tmp = (y / a) - ((x / a) / z);
} else if (z <= 7.2e+155) {
tmp = (x - (z * y)) / (t - (z * a));
} 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) :: tmp
if (z <= (-1.9d+207)) then
tmp = (y / a) - ((x / a) / z)
else if (z <= 7.2d+155) then
tmp = (x - (z * y)) / (t - (z * a))
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 tmp;
if (z <= -1.9e+207) {
tmp = (y / a) - ((x / a) / z);
} else if (z <= 7.2e+155) {
tmp = (x - (z * y)) / (t - (z * a));
} else {
tmp = (y - (x / z)) / a;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -1.9e+207: tmp = (y / a) - ((x / a) / z) elif z <= 7.2e+155: tmp = (x - (z * y)) / (t - (z * a)) else: tmp = (y - (x / z)) / a return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -1.9e+207) tmp = Float64(Float64(y / a) - Float64(Float64(x / a) / z)); elseif (z <= 7.2e+155) tmp = Float64(Float64(x - Float64(z * y)) / Float64(t - Float64(z * a))); else tmp = Float64(Float64(y - Float64(x / z)) / a); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (z <= -1.9e+207) tmp = (y / a) - ((x / a) / z); elseif (z <= 7.2e+155) tmp = (x - (z * y)) / (t - (z * a)); else tmp = (y - (x / z)) / a; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -1.9e+207], N[(N[(y / a), $MachinePrecision] - N[(N[(x / a), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 7.2e+155], N[(N[(x - N[(z * y), $MachinePrecision]), $MachinePrecision] / N[(t - N[(z * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(y - N[(x / z), $MachinePrecision]), $MachinePrecision] / a), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.9 \cdot 10^{+207}:\\
\;\;\;\;\frac{y}{a} - \frac{\frac{x}{a}}{z}\\
\mathbf{elif}\;z \leq 7.2 \cdot 10^{+155}:\\
\;\;\;\;\frac{x - z \cdot y}{t - z \cdot a}\\
\mathbf{else}:\\
\;\;\;\;\frac{y - \frac{x}{z}}{a}\\
\end{array}
\end{array}
if z < -1.89999999999999993e207Initial program 39.1%
*-commutative39.1%
Simplified39.1%
Taylor expanded in z around inf 60.6%
+-commutative60.6%
associate--l+60.6%
associate-/r*84.0%
associate-*r/84.0%
associate-/r*84.0%
associate-*r/84.0%
div-sub84.0%
distribute-lft-out--84.0%
associate-*r/84.0%
mul-1-neg84.0%
unsub-neg84.0%
Simplified92.3%
Taylor expanded in x around inf 100.0%
if -1.89999999999999993e207 < z < 7.20000000000000015e155Initial program 94.8%
if 7.20000000000000015e155 < z Initial program 56.8%
*-commutative56.8%
Simplified56.8%
Taylor expanded in z around inf 64.2%
+-commutative64.2%
associate--l+64.2%
associate-/r*67.0%
associate-*r/67.0%
associate-/r*64.2%
associate-*r/64.2%
div-sub64.2%
distribute-lft-out--64.2%
associate-*r/64.2%
mul-1-neg64.2%
unsub-neg64.2%
Simplified79.1%
Taylor expanded in a around inf 85.1%
Final simplification93.8%
(FPCore (x y z t a)
:precision binary64
(if (<= a -5.3e+156)
(/ x (- t (* z a)))
(if (or (<= a -1.05e+80)
(and (not (<= a 6e-63)) (or (<= a 8.5e+62) (not (<= a 2.25e+105)))))
(/ (- y (/ x z)) a)
(/ (- x (* z y)) t))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= -5.3e+156) {
tmp = x / (t - (z * a));
} else if ((a <= -1.05e+80) || (!(a <= 6e-63) && ((a <= 8.5e+62) || !(a <= 2.25e+105)))) {
tmp = (y - (x / z)) / a;
} else {
tmp = (x - (z * y)) / 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 <= (-5.3d+156)) then
tmp = x / (t - (z * a))
else if ((a <= (-1.05d+80)) .or. (.not. (a <= 6d-63)) .and. (a <= 8.5d+62) .or. (.not. (a <= 2.25d+105))) then
tmp = (y - (x / z)) / a
else
tmp = (x - (z * y)) / 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 <= -5.3e+156) {
tmp = x / (t - (z * a));
} else if ((a <= -1.05e+80) || (!(a <= 6e-63) && ((a <= 8.5e+62) || !(a <= 2.25e+105)))) {
tmp = (y - (x / z)) / a;
} else {
tmp = (x - (z * y)) / t;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if a <= -5.3e+156: tmp = x / (t - (z * a)) elif (a <= -1.05e+80) or (not (a <= 6e-63) and ((a <= 8.5e+62) or not (a <= 2.25e+105))): tmp = (y - (x / z)) / a else: tmp = (x - (z * y)) / t return tmp
function code(x, y, z, t, a) tmp = 0.0 if (a <= -5.3e+156) tmp = Float64(x / Float64(t - Float64(z * a))); elseif ((a <= -1.05e+80) || (!(a <= 6e-63) && ((a <= 8.5e+62) || !(a <= 2.25e+105)))) tmp = Float64(Float64(y - Float64(x / z)) / a); else tmp = Float64(Float64(x - Float64(z * y)) / t); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (a <= -5.3e+156) tmp = x / (t - (z * a)); elseif ((a <= -1.05e+80) || (~((a <= 6e-63)) && ((a <= 8.5e+62) || ~((a <= 2.25e+105))))) tmp = (y - (x / z)) / a; else tmp = (x - (z * y)) / t; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[a, -5.3e+156], N[(x / N[(t - N[(z * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[a, -1.05e+80], And[N[Not[LessEqual[a, 6e-63]], $MachinePrecision], Or[LessEqual[a, 8.5e+62], N[Not[LessEqual[a, 2.25e+105]], $MachinePrecision]]]], N[(N[(y - N[(x / z), $MachinePrecision]), $MachinePrecision] / a), $MachinePrecision], N[(N[(x - N[(z * y), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -5.3 \cdot 10^{+156}:\\
\;\;\;\;\frac{x}{t - z \cdot a}\\
\mathbf{elif}\;a \leq -1.05 \cdot 10^{+80} \lor \neg \left(a \leq 6 \cdot 10^{-63}\right) \land \left(a \leq 8.5 \cdot 10^{+62} \lor \neg \left(a \leq 2.25 \cdot 10^{+105}\right)\right):\\
\;\;\;\;\frac{y - \frac{x}{z}}{a}\\
\mathbf{else}:\\
\;\;\;\;\frac{x - z \cdot y}{t}\\
\end{array}
\end{array}
if a < -5.2999999999999998e156Initial program 81.3%
*-commutative81.3%
Simplified81.3%
Taylor expanded in x around inf 71.6%
*-commutative71.6%
Simplified71.6%
if -5.2999999999999998e156 < a < -1.05000000000000001e80 or 5.99999999999999959e-63 < a < 8.4999999999999997e62 or 2.2500000000000001e105 < a Initial program 72.4%
*-commutative72.4%
Simplified72.4%
Taylor expanded in z around inf 69.0%
+-commutative69.0%
associate--l+69.0%
associate-/r*75.8%
associate-*r/75.8%
associate-/r*74.7%
associate-*r/74.7%
div-sub74.7%
distribute-lft-out--74.7%
associate-*r/74.7%
mul-1-neg74.7%
unsub-neg74.7%
Simplified79.0%
Taylor expanded in a around inf 78.0%
if -1.05000000000000001e80 < a < 5.99999999999999959e-63 or 8.4999999999999997e62 < a < 2.2500000000000001e105Initial program 97.2%
*-commutative97.2%
Simplified97.2%
Taylor expanded in t around inf 81.5%
Final simplification79.2%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (/ x (- t (* z a)))))
(if (<= a -1.38e+48)
t_1
(if (<= a 2.8e-74)
(/ (- x (* z y)) t)
(if (<= a 1.9e+109)
t_1
(if (<= a 4.5e+158)
(/ y a)
(if (<= a 1.65e+261) t_1 (* (/ x a) (/ -1.0 z)))))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = x / (t - (z * a));
double tmp;
if (a <= -1.38e+48) {
tmp = t_1;
} else if (a <= 2.8e-74) {
tmp = (x - (z * y)) / t;
} else if (a <= 1.9e+109) {
tmp = t_1;
} else if (a <= 4.5e+158) {
tmp = y / a;
} else if (a <= 1.65e+261) {
tmp = t_1;
} else {
tmp = (x / a) * (-1.0 / z);
}
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 (a <= (-1.38d+48)) then
tmp = t_1
else if (a <= 2.8d-74) then
tmp = (x - (z * y)) / t
else if (a <= 1.9d+109) then
tmp = t_1
else if (a <= 4.5d+158) then
tmp = y / a
else if (a <= 1.65d+261) then
tmp = t_1
else
tmp = (x / a) * ((-1.0d0) / z)
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 (a <= -1.38e+48) {
tmp = t_1;
} else if (a <= 2.8e-74) {
tmp = (x - (z * y)) / t;
} else if (a <= 1.9e+109) {
tmp = t_1;
} else if (a <= 4.5e+158) {
tmp = y / a;
} else if (a <= 1.65e+261) {
tmp = t_1;
} else {
tmp = (x / a) * (-1.0 / z);
}
return tmp;
}
def code(x, y, z, t, a): t_1 = x / (t - (z * a)) tmp = 0 if a <= -1.38e+48: tmp = t_1 elif a <= 2.8e-74: tmp = (x - (z * y)) / t elif a <= 1.9e+109: tmp = t_1 elif a <= 4.5e+158: tmp = y / a elif a <= 1.65e+261: tmp = t_1 else: tmp = (x / a) * (-1.0 / z) return tmp
function code(x, y, z, t, a) t_1 = Float64(x / Float64(t - Float64(z * a))) tmp = 0.0 if (a <= -1.38e+48) tmp = t_1; elseif (a <= 2.8e-74) tmp = Float64(Float64(x - Float64(z * y)) / t); elseif (a <= 1.9e+109) tmp = t_1; elseif (a <= 4.5e+158) tmp = Float64(y / a); elseif (a <= 1.65e+261) tmp = t_1; else tmp = Float64(Float64(x / a) * Float64(-1.0 / z)); end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = x / (t - (z * a)); tmp = 0.0; if (a <= -1.38e+48) tmp = t_1; elseif (a <= 2.8e-74) tmp = (x - (z * y)) / t; elseif (a <= 1.9e+109) tmp = t_1; elseif (a <= 4.5e+158) tmp = y / a; elseif (a <= 1.65e+261) tmp = t_1; else tmp = (x / a) * (-1.0 / z); 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[a, -1.38e+48], t$95$1, If[LessEqual[a, 2.8e-74], N[(N[(x - N[(z * y), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision], If[LessEqual[a, 1.9e+109], t$95$1, If[LessEqual[a, 4.5e+158], N[(y / a), $MachinePrecision], If[LessEqual[a, 1.65e+261], t$95$1, N[(N[(x / a), $MachinePrecision] * N[(-1.0 / z), $MachinePrecision]), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{x}{t - z \cdot a}\\
\mathbf{if}\;a \leq -1.38 \cdot 10^{+48}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;a \leq 2.8 \cdot 10^{-74}:\\
\;\;\;\;\frac{x - z \cdot y}{t}\\
\mathbf{elif}\;a \leq 1.9 \cdot 10^{+109}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;a \leq 4.5 \cdot 10^{+158}:\\
\;\;\;\;\frac{y}{a}\\
\mathbf{elif}\;a \leq 1.65 \cdot 10^{+261}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{a} \cdot \frac{-1}{z}\\
\end{array}
\end{array}
if a < -1.3800000000000001e48 or 2.79999999999999988e-74 < a < 1.90000000000000019e109 or 4.50000000000000046e158 < a < 1.65e261Initial program 80.9%
*-commutative80.9%
Simplified80.9%
Taylor expanded in x around inf 61.7%
*-commutative61.7%
Simplified61.7%
if -1.3800000000000001e48 < a < 2.79999999999999988e-74Initial program 97.6%
*-commutative97.6%
Simplified97.6%
Taylor expanded in t around inf 82.0%
if 1.90000000000000019e109 < a < 4.50000000000000046e158Initial program 56.1%
*-commutative56.1%
Simplified56.1%
Taylor expanded in z around inf 81.1%
if 1.65e261 < a Initial program 62.5%
*-commutative62.5%
Simplified62.5%
Taylor expanded in z around inf 71.7%
+-commutative71.7%
associate--l+71.7%
associate-/r*99.8%
associate-*r/99.8%
associate-/r*99.8%
associate-*r/99.8%
div-sub99.8%
distribute-lft-out--99.8%
associate-*r/99.8%
mul-1-neg99.8%
unsub-neg99.8%
Simplified99.8%
Taylor expanded in y around 0 53.5%
associate-*r/53.5%
mul-1-neg53.5%
*-commutative53.5%
Simplified53.5%
neg-mul-153.5%
times-frac81.8%
Applied egg-rr81.8%
Final simplification73.3%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (/ (- y (/ x z)) a)) (t_2 (/ (- x (* z y)) t)))
(if (<= a -8.8e+157)
(/ x (- t (* z a)))
(if (<= a -8e+78)
t_1
(if (<= a 6e-63)
t_2
(if (<= a 2.5e+62)
(- (/ y a) (/ x (* z a)))
(if (<= a 2.8e+105) t_2 t_1)))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = (y - (x / z)) / a;
double t_2 = (x - (z * y)) / t;
double tmp;
if (a <= -8.8e+157) {
tmp = x / (t - (z * a));
} else if (a <= -8e+78) {
tmp = t_1;
} else if (a <= 6e-63) {
tmp = t_2;
} else if (a <= 2.5e+62) {
tmp = (y / a) - (x / (z * a));
} else if (a <= 2.8e+105) {
tmp = t_2;
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = (y - (x / z)) / a
t_2 = (x - (z * y)) / t
if (a <= (-8.8d+157)) then
tmp = x / (t - (z * a))
else if (a <= (-8d+78)) then
tmp = t_1
else if (a <= 6d-63) then
tmp = t_2
else if (a <= 2.5d+62) then
tmp = (y / a) - (x / (z * a))
else if (a <= 2.8d+105) then
tmp = t_2
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double t_1 = (y - (x / z)) / a;
double t_2 = (x - (z * y)) / t;
double tmp;
if (a <= -8.8e+157) {
tmp = x / (t - (z * a));
} else if (a <= -8e+78) {
tmp = t_1;
} else if (a <= 6e-63) {
tmp = t_2;
} else if (a <= 2.5e+62) {
tmp = (y / a) - (x / (z * a));
} else if (a <= 2.8e+105) {
tmp = t_2;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = (y - (x / z)) / a t_2 = (x - (z * y)) / t tmp = 0 if a <= -8.8e+157: tmp = x / (t - (z * a)) elif a <= -8e+78: tmp = t_1 elif a <= 6e-63: tmp = t_2 elif a <= 2.5e+62: tmp = (y / a) - (x / (z * a)) elif a <= 2.8e+105: tmp = t_2 else: tmp = t_1 return tmp
function code(x, y, z, t, a) t_1 = Float64(Float64(y - Float64(x / z)) / a) t_2 = Float64(Float64(x - Float64(z * y)) / t) tmp = 0.0 if (a <= -8.8e+157) tmp = Float64(x / Float64(t - Float64(z * a))); elseif (a <= -8e+78) tmp = t_1; elseif (a <= 6e-63) tmp = t_2; elseif (a <= 2.5e+62) tmp = Float64(Float64(y / a) - Float64(x / Float64(z * a))); elseif (a <= 2.8e+105) tmp = t_2; else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = (y - (x / z)) / a; t_2 = (x - (z * y)) / t; tmp = 0.0; if (a <= -8.8e+157) tmp = x / (t - (z * a)); elseif (a <= -8e+78) tmp = t_1; elseif (a <= 6e-63) tmp = t_2; elseif (a <= 2.5e+62) tmp = (y / a) - (x / (z * a)); elseif (a <= 2.8e+105) tmp = t_2; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(y - N[(x / z), $MachinePrecision]), $MachinePrecision] / a), $MachinePrecision]}, Block[{t$95$2 = N[(N[(x - N[(z * y), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision]}, If[LessEqual[a, -8.8e+157], N[(x / N[(t - N[(z * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, -8e+78], t$95$1, If[LessEqual[a, 6e-63], t$95$2, If[LessEqual[a, 2.5e+62], N[(N[(y / a), $MachinePrecision] - N[(x / N[(z * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 2.8e+105], t$95$2, t$95$1]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{y - \frac{x}{z}}{a}\\
t_2 := \frac{x - z \cdot y}{t}\\
\mathbf{if}\;a \leq -8.8 \cdot 10^{+157}:\\
\;\;\;\;\frac{x}{t - z \cdot a}\\
\mathbf{elif}\;a \leq -8 \cdot 10^{+78}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;a \leq 6 \cdot 10^{-63}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;a \leq 2.5 \cdot 10^{+62}:\\
\;\;\;\;\frac{y}{a} - \frac{x}{z \cdot a}\\
\mathbf{elif}\;a \leq 2.8 \cdot 10^{+105}:\\
\;\;\;\;t_2\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if a < -8.8000000000000005e157Initial program 81.3%
*-commutative81.3%
Simplified81.3%
Taylor expanded in x around inf 71.6%
*-commutative71.6%
Simplified71.6%
if -8.8000000000000005e157 < a < -8.00000000000000007e78 or 2.8000000000000001e105 < a Initial program 72.0%
*-commutative72.0%
Simplified72.0%
Taylor expanded in z around inf 68.2%
+-commutative68.2%
associate--l+68.2%
associate-/r*77.9%
associate-*r/77.9%
associate-/r*77.9%
associate-*r/77.9%
div-sub77.9%
distribute-lft-out--77.9%
associate-*r/77.9%
mul-1-neg77.9%
unsub-neg77.9%
Simplified82.5%
Taylor expanded in a around inf 77.7%
if -8.00000000000000007e78 < a < 5.99999999999999959e-63 or 2.50000000000000014e62 < a < 2.8000000000000001e105Initial program 97.2%
*-commutative97.2%
Simplified97.2%
Taylor expanded in t around inf 81.5%
if 5.99999999999999959e-63 < a < 2.50000000000000014e62Initial program 73.3%
*-commutative73.3%
Simplified73.3%
Taylor expanded in z around inf 71.0%
+-commutative71.0%
associate--l+71.0%
associate-/r*71.0%
associate-*r/71.0%
associate-/r*67.3%
associate-*r/67.3%
div-sub67.3%
distribute-lft-out--67.3%
associate-*r/67.3%
mul-1-neg67.3%
unsub-neg67.3%
Simplified71.1%
Taylor expanded in t around 0 78.6%
*-commutative78.6%
Simplified78.6%
Final simplification79.2%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (/ (- x (* z y)) t)) (t_2 (- (/ y a) (/ (/ x a) z))))
(if (<= a -6e+80)
t_2
(if (<= a 6e-63)
t_1
(if (<= a 1.2e+63)
(- (/ y a) (/ x (* z a)))
(if (<= a 4e+105) t_1 t_2))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = (x - (z * y)) / t;
double t_2 = (y / a) - ((x / a) / z);
double tmp;
if (a <= -6e+80) {
tmp = t_2;
} else if (a <= 6e-63) {
tmp = t_1;
} else if (a <= 1.2e+63) {
tmp = (y / a) - (x / (z * a));
} else if (a <= 4e+105) {
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 - (z * y)) / t
t_2 = (y / a) - ((x / a) / z)
if (a <= (-6d+80)) then
tmp = t_2
else if (a <= 6d-63) then
tmp = t_1
else if (a <= 1.2d+63) then
tmp = (y / a) - (x / (z * a))
else if (a <= 4d+105) 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 - (z * y)) / t;
double t_2 = (y / a) - ((x / a) / z);
double tmp;
if (a <= -6e+80) {
tmp = t_2;
} else if (a <= 6e-63) {
tmp = t_1;
} else if (a <= 1.2e+63) {
tmp = (y / a) - (x / (z * a));
} else if (a <= 4e+105) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = (x - (z * y)) / t t_2 = (y / a) - ((x / a) / z) tmp = 0 if a <= -6e+80: tmp = t_2 elif a <= 6e-63: tmp = t_1 elif a <= 1.2e+63: tmp = (y / a) - (x / (z * a)) elif a <= 4e+105: tmp = t_1 else: tmp = t_2 return tmp
function code(x, y, z, t, a) t_1 = Float64(Float64(x - Float64(z * y)) / t) t_2 = Float64(Float64(y / a) - Float64(Float64(x / a) / z)) tmp = 0.0 if (a <= -6e+80) tmp = t_2; elseif (a <= 6e-63) tmp = t_1; elseif (a <= 1.2e+63) tmp = Float64(Float64(y / a) - Float64(x / Float64(z * a))); elseif (a <= 4e+105) tmp = t_1; else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = (x - (z * y)) / t; t_2 = (y / a) - ((x / a) / z); tmp = 0.0; if (a <= -6e+80) tmp = t_2; elseif (a <= 6e-63) tmp = t_1; elseif (a <= 1.2e+63) tmp = (y / a) - (x / (z * a)); elseif (a <= 4e+105) 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[(z * y), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision]}, Block[{t$95$2 = N[(N[(y / a), $MachinePrecision] - N[(N[(x / a), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[a, -6e+80], t$95$2, If[LessEqual[a, 6e-63], t$95$1, If[LessEqual[a, 1.2e+63], N[(N[(y / a), $MachinePrecision] - N[(x / N[(z * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 4e+105], t$95$1, t$95$2]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{x - z \cdot y}{t}\\
t_2 := \frac{y}{a} - \frac{\frac{x}{a}}{z}\\
\mathbf{if}\;a \leq -6 \cdot 10^{+80}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;a \leq 6 \cdot 10^{-63}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;a \leq 1.2 \cdot 10^{+63}:\\
\;\;\;\;\frac{y}{a} - \frac{x}{z \cdot a}\\
\mathbf{elif}\;a \leq 4 \cdot 10^{+105}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;t_2\\
\end{array}
\end{array}
if a < -5.99999999999999974e80 or 3.9999999999999998e105 < a Initial program 75.1%
*-commutative75.1%
Simplified75.1%
Taylor expanded in z around inf 64.1%
+-commutative64.1%
associate--l+64.1%
associate-/r*71.7%
associate-*r/71.7%
associate-/r*71.7%
associate-*r/71.7%
div-sub71.7%
distribute-lft-out--71.7%
associate-*r/71.7%
mul-1-neg71.7%
unsub-neg71.7%
Simplified75.9%
Taylor expanded in x around inf 76.3%
if -5.99999999999999974e80 < a < 5.99999999999999959e-63 or 1.2e63 < a < 3.9999999999999998e105Initial program 97.2%
*-commutative97.2%
Simplified97.2%
Taylor expanded in t around inf 81.5%
if 5.99999999999999959e-63 < a < 1.2e63Initial program 73.3%
*-commutative73.3%
Simplified73.3%
Taylor expanded in z around inf 71.0%
+-commutative71.0%
associate--l+71.0%
associate-/r*71.0%
associate-*r/71.0%
associate-/r*67.3%
associate-*r/67.3%
div-sub67.3%
distribute-lft-out--67.3%
associate-*r/67.3%
mul-1-neg67.3%
unsub-neg67.3%
Simplified71.1%
Taylor expanded in t around 0 78.6%
*-commutative78.6%
Simplified78.6%
Final simplification79.5%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (/ (- x (* z y)) t)) (t_2 (- (/ y a) (/ (/ x a) z))))
(if (<= a -7.2e+78)
t_2
(if (<= a 6e-63)
t_1
(if (<= a 7.6e+62)
(+ (/ y a) (/ -1.0 (/ a (/ x z))))
(if (<= a 2.25e+105) t_1 t_2))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = (x - (z * y)) / t;
double t_2 = (y / a) - ((x / a) / z);
double tmp;
if (a <= -7.2e+78) {
tmp = t_2;
} else if (a <= 6e-63) {
tmp = t_1;
} else if (a <= 7.6e+62) {
tmp = (y / a) + (-1.0 / (a / (x / z)));
} else if (a <= 2.25e+105) {
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 - (z * y)) / t
t_2 = (y / a) - ((x / a) / z)
if (a <= (-7.2d+78)) then
tmp = t_2
else if (a <= 6d-63) then
tmp = t_1
else if (a <= 7.6d+62) then
tmp = (y / a) + ((-1.0d0) / (a / (x / z)))
else if (a <= 2.25d+105) 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 - (z * y)) / t;
double t_2 = (y / a) - ((x / a) / z);
double tmp;
if (a <= -7.2e+78) {
tmp = t_2;
} else if (a <= 6e-63) {
tmp = t_1;
} else if (a <= 7.6e+62) {
tmp = (y / a) + (-1.0 / (a / (x / z)));
} else if (a <= 2.25e+105) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = (x - (z * y)) / t t_2 = (y / a) - ((x / a) / z) tmp = 0 if a <= -7.2e+78: tmp = t_2 elif a <= 6e-63: tmp = t_1 elif a <= 7.6e+62: tmp = (y / a) + (-1.0 / (a / (x / z))) elif a <= 2.25e+105: tmp = t_1 else: tmp = t_2 return tmp
function code(x, y, z, t, a) t_1 = Float64(Float64(x - Float64(z * y)) / t) t_2 = Float64(Float64(y / a) - Float64(Float64(x / a) / z)) tmp = 0.0 if (a <= -7.2e+78) tmp = t_2; elseif (a <= 6e-63) tmp = t_1; elseif (a <= 7.6e+62) tmp = Float64(Float64(y / a) + Float64(-1.0 / Float64(a / Float64(x / z)))); elseif (a <= 2.25e+105) tmp = t_1; else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = (x - (z * y)) / t; t_2 = (y / a) - ((x / a) / z); tmp = 0.0; if (a <= -7.2e+78) tmp = t_2; elseif (a <= 6e-63) tmp = t_1; elseif (a <= 7.6e+62) tmp = (y / a) + (-1.0 / (a / (x / z))); elseif (a <= 2.25e+105) 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[(z * y), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision]}, Block[{t$95$2 = N[(N[(y / a), $MachinePrecision] - N[(N[(x / a), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[a, -7.2e+78], t$95$2, If[LessEqual[a, 6e-63], t$95$1, If[LessEqual[a, 7.6e+62], N[(N[(y / a), $MachinePrecision] + N[(-1.0 / N[(a / N[(x / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 2.25e+105], t$95$1, t$95$2]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{x - z \cdot y}{t}\\
t_2 := \frac{y}{a} - \frac{\frac{x}{a}}{z}\\
\mathbf{if}\;a \leq -7.2 \cdot 10^{+78}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;a \leq 6 \cdot 10^{-63}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;a \leq 7.6 \cdot 10^{+62}:\\
\;\;\;\;\frac{y}{a} + \frac{-1}{\frac{a}{\frac{x}{z}}}\\
\mathbf{elif}\;a \leq 2.25 \cdot 10^{+105}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;t_2\\
\end{array}
\end{array}
if a < -7.20000000000000039e78 or 2.2500000000000001e105 < a Initial program 75.1%
*-commutative75.1%
Simplified75.1%
Taylor expanded in z around inf 64.1%
+-commutative64.1%
associate--l+64.1%
associate-/r*71.7%
associate-*r/71.7%
associate-/r*71.7%
associate-*r/71.7%
div-sub71.7%
distribute-lft-out--71.7%
associate-*r/71.7%
mul-1-neg71.7%
unsub-neg71.7%
Simplified75.9%
Taylor expanded in x around inf 76.3%
if -7.20000000000000039e78 < a < 5.99999999999999959e-63 or 7.59999999999999967e62 < a < 2.2500000000000001e105Initial program 97.2%
*-commutative97.2%
Simplified97.2%
Taylor expanded in t around inf 81.5%
if 5.99999999999999959e-63 < a < 7.59999999999999967e62Initial program 73.3%
*-commutative73.3%
Simplified73.3%
Taylor expanded in z around inf 71.0%
+-commutative71.0%
associate--l+71.0%
associate-/r*71.0%
associate-*r/71.0%
associate-/r*67.3%
associate-*r/67.3%
div-sub67.3%
distribute-lft-out--67.3%
associate-*r/67.3%
mul-1-neg67.3%
unsub-neg67.3%
Simplified71.1%
Taylor expanded in t around 0 78.6%
*-commutative78.6%
Simplified78.6%
clear-num78.6%
inv-pow78.6%
Applied egg-rr78.6%
unpow-178.6%
*-commutative78.6%
associate-/l*78.6%
Simplified78.6%
Final simplification79.5%
(FPCore (x y z t a) :precision binary64 (if (<= z -3.8e+99) (/ y a) (if (<= z 3.15e+153) (/ x (- t (* z a))) (/ y a))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -3.8e+99) {
tmp = y / a;
} else if (z <= 3.15e+153) {
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 <= (-3.8d+99)) then
tmp = y / a
else if (z <= 3.15d+153) 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 <= -3.8e+99) {
tmp = y / a;
} else if (z <= 3.15e+153) {
tmp = x / (t - (z * a));
} else {
tmp = y / a;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -3.8e+99: tmp = y / a elif z <= 3.15e+153: tmp = x / (t - (z * a)) else: tmp = y / a return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -3.8e+99) tmp = Float64(y / a); elseif (z <= 3.15e+153) 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 <= -3.8e+99) tmp = y / a; elseif (z <= 3.15e+153) tmp = x / (t - (z * a)); else tmp = y / a; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -3.8e+99], N[(y / a), $MachinePrecision], If[LessEqual[z, 3.15e+153], N[(x / N[(t - N[(z * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(y / a), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -3.8 \cdot 10^{+99}:\\
\;\;\;\;\frac{y}{a}\\
\mathbf{elif}\;z \leq 3.15 \cdot 10^{+153}:\\
\;\;\;\;\frac{x}{t - z \cdot a}\\
\mathbf{else}:\\
\;\;\;\;\frac{y}{a}\\
\end{array}
\end{array}
if z < -3.8e99 or 3.1500000000000001e153 < z Initial program 60.2%
*-commutative60.2%
Simplified60.2%
Taylor expanded in z around inf 60.1%
if -3.8e99 < z < 3.1500000000000001e153Initial program 97.7%
*-commutative97.7%
Simplified97.7%
Taylor expanded in x around inf 69.5%
*-commutative69.5%
Simplified69.5%
Final simplification66.9%
(FPCore (x y z t a)
:precision binary64
(if (<= z -6.5e+88)
(/ y a)
(if (<= z -2.8e-53)
(/ (* z (- y)) t)
(if (<= z 12000000000.0) (/ x t) (/ y a)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -6.5e+88) {
tmp = y / a;
} else if (z <= -2.8e-53) {
tmp = (z * -y) / t;
} else if (z <= 12000000000.0) {
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 <= (-6.5d+88)) then
tmp = y / a
else if (z <= (-2.8d-53)) then
tmp = (z * -y) / t
else if (z <= 12000000000.0d0) 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 <= -6.5e+88) {
tmp = y / a;
} else if (z <= -2.8e-53) {
tmp = (z * -y) / t;
} else if (z <= 12000000000.0) {
tmp = x / t;
} else {
tmp = y / a;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -6.5e+88: tmp = y / a elif z <= -2.8e-53: tmp = (z * -y) / t elif z <= 12000000000.0: tmp = x / t else: tmp = y / a return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -6.5e+88) tmp = Float64(y / a); elseif (z <= -2.8e-53) tmp = Float64(Float64(z * Float64(-y)) / t); elseif (z <= 12000000000.0) 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 <= -6.5e+88) tmp = y / a; elseif (z <= -2.8e-53) tmp = (z * -y) / t; elseif (z <= 12000000000.0) tmp = x / t; else tmp = y / a; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -6.5e+88], N[(y / a), $MachinePrecision], If[LessEqual[z, -2.8e-53], N[(N[(z * (-y)), $MachinePrecision] / t), $MachinePrecision], If[LessEqual[z, 12000000000.0], N[(x / t), $MachinePrecision], N[(y / a), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -6.5 \cdot 10^{+88}:\\
\;\;\;\;\frac{y}{a}\\
\mathbf{elif}\;z \leq -2.8 \cdot 10^{-53}:\\
\;\;\;\;\frac{z \cdot \left(-y\right)}{t}\\
\mathbf{elif}\;z \leq 12000000000:\\
\;\;\;\;\frac{x}{t}\\
\mathbf{else}:\\
\;\;\;\;\frac{y}{a}\\
\end{array}
\end{array}
if z < -6.5000000000000002e88 or 1.2e10 < z Initial program 67.8%
*-commutative67.8%
Simplified67.8%
Taylor expanded in z around inf 55.6%
if -6.5000000000000002e88 < z < -2.79999999999999985e-53Initial program 92.0%
*-commutative92.0%
Simplified92.0%
Taylor expanded in t around inf 49.5%
Taylor expanded in x around 0 38.9%
mul-1-neg38.9%
Simplified38.9%
if -2.79999999999999985e-53 < z < 1.2e10Initial program 99.8%
*-commutative99.8%
Simplified99.8%
Taylor expanded in z around 0 59.6%
Final simplification56.1%
(FPCore (x y z t a)
:precision binary64
(if (<= z -8.5e+88)
(/ y a)
(if (<= z -1.9e-52)
(* z (- (/ y t)))
(if (<= z 380000000000.0) (/ x t) (/ y a)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -8.5e+88) {
tmp = y / a;
} else if (z <= -1.9e-52) {
tmp = z * -(y / t);
} else if (z <= 380000000000.0) {
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 <= (-8.5d+88)) then
tmp = y / a
else if (z <= (-1.9d-52)) then
tmp = z * -(y / t)
else if (z <= 380000000000.0d0) 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 <= -8.5e+88) {
tmp = y / a;
} else if (z <= -1.9e-52) {
tmp = z * -(y / t);
} else if (z <= 380000000000.0) {
tmp = x / t;
} else {
tmp = y / a;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -8.5e+88: tmp = y / a elif z <= -1.9e-52: tmp = z * -(y / t) elif z <= 380000000000.0: tmp = x / t else: tmp = y / a return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -8.5e+88) tmp = Float64(y / a); elseif (z <= -1.9e-52) tmp = Float64(z * Float64(-Float64(y / t))); elseif (z <= 380000000000.0) 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 <= -8.5e+88) tmp = y / a; elseif (z <= -1.9e-52) tmp = z * -(y / t); elseif (z <= 380000000000.0) tmp = x / t; else tmp = y / a; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -8.5e+88], N[(y / a), $MachinePrecision], If[LessEqual[z, -1.9e-52], N[(z * (-N[(y / t), $MachinePrecision])), $MachinePrecision], If[LessEqual[z, 380000000000.0], N[(x / t), $MachinePrecision], N[(y / a), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -8.5 \cdot 10^{+88}:\\
\;\;\;\;\frac{y}{a}\\
\mathbf{elif}\;z \leq -1.9 \cdot 10^{-52}:\\
\;\;\;\;z \cdot \left(-\frac{y}{t}\right)\\
\mathbf{elif}\;z \leq 380000000000:\\
\;\;\;\;\frac{x}{t}\\
\mathbf{else}:\\
\;\;\;\;\frac{y}{a}\\
\end{array}
\end{array}
if z < -8.5000000000000005e88 or 3.8e11 < z Initial program 67.8%
*-commutative67.8%
Simplified67.8%
Taylor expanded in z around inf 55.6%
if -8.5000000000000005e88 < z < -1.9000000000000002e-52Initial program 92.0%
*-commutative92.0%
Simplified92.0%
Taylor expanded in t around inf 49.5%
Taylor expanded in x around 0 38.9%
mul-1-neg38.9%
associate-/l*42.7%
distribute-neg-frac42.7%
Simplified42.7%
Taylor expanded in y around 0 38.9%
mul-1-neg38.9%
associate-*l/42.8%
distribute-rgt-neg-in42.8%
Simplified42.8%
if -1.9000000000000002e-52 < z < 3.8e11Initial program 99.8%
*-commutative99.8%
Simplified99.8%
Taylor expanded in z around 0 59.6%
Final simplification56.5%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -2.65e-51) (not (<= z 105000000000.0))) (/ y a) (/ x t)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -2.65e-51) || !(z <= 105000000000.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 <= (-2.65d-51)) .or. (.not. (z <= 105000000000.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 <= -2.65e-51) || !(z <= 105000000000.0)) {
tmp = y / a;
} else {
tmp = x / t;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -2.65e-51) or not (z <= 105000000000.0): tmp = y / a else: tmp = x / t return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -2.65e-51) || !(z <= 105000000000.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 <= -2.65e-51) || ~((z <= 105000000000.0))) tmp = y / a; else tmp = x / t; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -2.65e-51], N[Not[LessEqual[z, 105000000000.0]], $MachinePrecision]], N[(y / a), $MachinePrecision], N[(x / t), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.65 \cdot 10^{-51} \lor \neg \left(z \leq 105000000000\right):\\
\;\;\;\;\frac{y}{a}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{t}\\
\end{array}
\end{array}
if z < -2.64999999999999987e-51 or 1.05e11 < z Initial program 72.9%
*-commutative72.9%
Simplified72.9%
Taylor expanded in z around inf 48.7%
if -2.64999999999999987e-51 < z < 1.05e11Initial program 99.8%
*-commutative99.8%
Simplified99.8%
Taylor expanded in z around 0 59.6%
Final simplification54.5%
(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 87.3%
*-commutative87.3%
Simplified87.3%
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 2023293
(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))))