
(FPCore (x y z t) :precision binary64 (+ (- x (/ y (* z 3.0))) (/ t (* (* z 3.0) y))))
double code(double x, double y, double z, double t) {
return (x - (y / (z * 3.0))) + (t / ((z * 3.0) * y));
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = (x - (y / (z * 3.0d0))) + (t / ((z * 3.0d0) * y))
end function
public static double code(double x, double y, double z, double t) {
return (x - (y / (z * 3.0))) + (t / ((z * 3.0) * y));
}
def code(x, y, z, t): return (x - (y / (z * 3.0))) + (t / ((z * 3.0) * y))
function code(x, y, z, t) return Float64(Float64(x - Float64(y / Float64(z * 3.0))) + Float64(t / Float64(Float64(z * 3.0) * y))) end
function tmp = code(x, y, z, t) tmp = (x - (y / (z * 3.0))) + (t / ((z * 3.0) * y)); end
code[x_, y_, z_, t_] := N[(N[(x - N[(y / N[(z * 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(t / N[(N[(z * 3.0), $MachinePrecision] * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(x - \frac{y}{z \cdot 3}\right) + \frac{t}{\left(z \cdot 3\right) \cdot y}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 16 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t) :precision binary64 (+ (- x (/ y (* z 3.0))) (/ t (* (* z 3.0) y))))
double code(double x, double y, double z, double t) {
return (x - (y / (z * 3.0))) + (t / ((z * 3.0) * y));
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = (x - (y / (z * 3.0d0))) + (t / ((z * 3.0d0) * y))
end function
public static double code(double x, double y, double z, double t) {
return (x - (y / (z * 3.0))) + (t / ((z * 3.0) * y));
}
def code(x, y, z, t): return (x - (y / (z * 3.0))) + (t / ((z * 3.0) * y))
function code(x, y, z, t) return Float64(Float64(x - Float64(y / Float64(z * 3.0))) + Float64(t / Float64(Float64(z * 3.0) * y))) end
function tmp = code(x, y, z, t) tmp = (x - (y / (z * 3.0))) + (t / ((z * 3.0) * y)); end
code[x_, y_, z_, t_] := N[(N[(x - N[(y / N[(z * 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(t / N[(N[(z * 3.0), $MachinePrecision] * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(x - \frac{y}{z \cdot 3}\right) + \frac{t}{\left(z \cdot 3\right) \cdot y}
\end{array}
(FPCore (x y z t) :precision binary64 (if (<= t 1e+44) (+ (+ (* (/ 0.3333333333333333 y) (/ t z)) x) (/ y (* z -3.0))) (+ x (fma -0.3333333333333333 (/ y z) (/ t (* z (* y 3.0)))))))
double code(double x, double y, double z, double t) {
double tmp;
if (t <= 1e+44) {
tmp = (((0.3333333333333333 / y) * (t / z)) + x) + (y / (z * -3.0));
} else {
tmp = x + fma(-0.3333333333333333, (y / z), (t / (z * (y * 3.0))));
}
return tmp;
}
function code(x, y, z, t) tmp = 0.0 if (t <= 1e+44) tmp = Float64(Float64(Float64(Float64(0.3333333333333333 / y) * Float64(t / z)) + x) + Float64(y / Float64(z * -3.0))); else tmp = Float64(x + fma(-0.3333333333333333, Float64(y / z), Float64(t / Float64(z * Float64(y * 3.0))))); end return tmp end
code[x_, y_, z_, t_] := If[LessEqual[t, 1e+44], N[(N[(N[(N[(0.3333333333333333 / y), $MachinePrecision] * N[(t / z), $MachinePrecision]), $MachinePrecision] + x), $MachinePrecision] + N[(y / N[(z * -3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(-0.3333333333333333 * N[(y / z), $MachinePrecision] + N[(t / N[(z * N[(y * 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq 10^{+44}:\\
\;\;\;\;\left(\frac{0.3333333333333333}{y} \cdot \frac{t}{z} + x\right) + \frac{y}{z \cdot -3}\\
\mathbf{else}:\\
\;\;\;\;x + \mathsf{fma}\left(-0.3333333333333333, \frac{y}{z}, \frac{t}{z \cdot \left(y \cdot 3\right)}\right)\\
\end{array}
\end{array}
if t < 1.0000000000000001e44Initial program 92.4%
+-commutative92.4%
associate-+r-92.4%
sub-neg92.4%
associate-*l*92.4%
*-commutative92.4%
distribute-frac-neg292.4%
distribute-rgt-neg-in92.4%
metadata-eval92.4%
Simplified92.4%
*-un-lft-identity92.4%
*-commutative92.4%
times-frac98.7%
Applied egg-rr98.7%
Taylor expanded in y around 0 98.7%
if 1.0000000000000001e44 < t Initial program 99.7%
sub-neg99.7%
associate-+l+99.7%
distribute-frac-neg99.7%
neg-mul-199.7%
*-commutative99.7%
times-frac99.8%
fma-define99.8%
metadata-eval99.8%
associate-*l*99.8%
*-commutative99.8%
Simplified99.8%
(FPCore (x y z t)
:precision binary64
(if (or (<= (* z 3.0) -1e+237)
(not
(or (<= (* z 3.0) -4e+158)
(and (not (<= (* z 3.0) -5e+82)) (<= (* z 3.0) 2e+38)))))
(- x (* 0.3333333333333333 (/ y z)))
(* 0.3333333333333333 (/ (- (/ t y) y) z))))
double code(double x, double y, double z, double t) {
double tmp;
if (((z * 3.0) <= -1e+237) || !(((z * 3.0) <= -4e+158) || (!((z * 3.0) <= -5e+82) && ((z * 3.0) <= 2e+38)))) {
tmp = x - (0.3333333333333333 * (y / z));
} else {
tmp = 0.3333333333333333 * (((t / y) - y) / z);
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (((z * 3.0d0) <= (-1d+237)) .or. (.not. ((z * 3.0d0) <= (-4d+158)) .or. (.not. ((z * 3.0d0) <= (-5d+82))) .and. ((z * 3.0d0) <= 2d+38))) then
tmp = x - (0.3333333333333333d0 * (y / z))
else
tmp = 0.3333333333333333d0 * (((t / y) - y) / z)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (((z * 3.0) <= -1e+237) || !(((z * 3.0) <= -4e+158) || (!((z * 3.0) <= -5e+82) && ((z * 3.0) <= 2e+38)))) {
tmp = x - (0.3333333333333333 * (y / z));
} else {
tmp = 0.3333333333333333 * (((t / y) - y) / z);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if ((z * 3.0) <= -1e+237) or not (((z * 3.0) <= -4e+158) or (not ((z * 3.0) <= -5e+82) and ((z * 3.0) <= 2e+38))): tmp = x - (0.3333333333333333 * (y / z)) else: tmp = 0.3333333333333333 * (((t / y) - y) / z) return tmp
function code(x, y, z, t) tmp = 0.0 if ((Float64(z * 3.0) <= -1e+237) || !((Float64(z * 3.0) <= -4e+158) || (!(Float64(z * 3.0) <= -5e+82) && (Float64(z * 3.0) <= 2e+38)))) tmp = Float64(x - Float64(0.3333333333333333 * Float64(y / z))); else tmp = Float64(0.3333333333333333 * Float64(Float64(Float64(t / y) - y) / z)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (((z * 3.0) <= -1e+237) || ~((((z * 3.0) <= -4e+158) || (~(((z * 3.0) <= -5e+82)) && ((z * 3.0) <= 2e+38))))) tmp = x - (0.3333333333333333 * (y / z)); else tmp = 0.3333333333333333 * (((t / y) - y) / z); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[N[(z * 3.0), $MachinePrecision], -1e+237], N[Not[Or[LessEqual[N[(z * 3.0), $MachinePrecision], -4e+158], And[N[Not[LessEqual[N[(z * 3.0), $MachinePrecision], -5e+82]], $MachinePrecision], LessEqual[N[(z * 3.0), $MachinePrecision], 2e+38]]]], $MachinePrecision]], N[(x - N[(0.3333333333333333 * N[(y / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(0.3333333333333333 * N[(N[(N[(t / y), $MachinePrecision] - y), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \cdot 3 \leq -1 \cdot 10^{+237} \lor \neg \left(z \cdot 3 \leq -4 \cdot 10^{+158} \lor \neg \left(z \cdot 3 \leq -5 \cdot 10^{+82}\right) \land z \cdot 3 \leq 2 \cdot 10^{+38}\right):\\
\;\;\;\;x - 0.3333333333333333 \cdot \frac{y}{z}\\
\mathbf{else}:\\
\;\;\;\;0.3333333333333333 \cdot \frac{\frac{t}{y} - y}{z}\\
\end{array}
\end{array}
if (*.f64 z #s(literal 3 binary64)) < -9.9999999999999994e236 or -3.99999999999999981e158 < (*.f64 z #s(literal 3 binary64)) < -5.00000000000000015e82 or 1.99999999999999995e38 < (*.f64 z #s(literal 3 binary64)) Initial program 99.8%
Taylor expanded in t around 0 82.4%
if -9.9999999999999994e236 < (*.f64 z #s(literal 3 binary64)) < -3.99999999999999981e158 or -5.00000000000000015e82 < (*.f64 z #s(literal 3 binary64)) < 1.99999999999999995e38Initial program 91.0%
Taylor expanded in z around 0 86.8%
distribute-lft-out--86.8%
associate-*r/86.9%
*-commutative86.9%
Applied egg-rr86.9%
Final simplification85.4%
(FPCore (x y z t)
:precision binary64
(if (or (<= (* z 3.0) -1e+237)
(not
(or (<= (* z 3.0) -4e+158)
(and (not (<= (* z 3.0) -5e+82)) (<= (* z 3.0) 2e+38)))))
(- x (* 0.3333333333333333 (/ y z)))
(* (- (/ t y) y) (/ 0.3333333333333333 z))))
double code(double x, double y, double z, double t) {
double tmp;
if (((z * 3.0) <= -1e+237) || !(((z * 3.0) <= -4e+158) || (!((z * 3.0) <= -5e+82) && ((z * 3.0) <= 2e+38)))) {
tmp = x - (0.3333333333333333 * (y / z));
} else {
tmp = ((t / y) - y) * (0.3333333333333333 / z);
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (((z * 3.0d0) <= (-1d+237)) .or. (.not. ((z * 3.0d0) <= (-4d+158)) .or. (.not. ((z * 3.0d0) <= (-5d+82))) .and. ((z * 3.0d0) <= 2d+38))) then
tmp = x - (0.3333333333333333d0 * (y / z))
else
tmp = ((t / y) - y) * (0.3333333333333333d0 / z)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (((z * 3.0) <= -1e+237) || !(((z * 3.0) <= -4e+158) || (!((z * 3.0) <= -5e+82) && ((z * 3.0) <= 2e+38)))) {
tmp = x - (0.3333333333333333 * (y / z));
} else {
tmp = ((t / y) - y) * (0.3333333333333333 / z);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if ((z * 3.0) <= -1e+237) or not (((z * 3.0) <= -4e+158) or (not ((z * 3.0) <= -5e+82) and ((z * 3.0) <= 2e+38))): tmp = x - (0.3333333333333333 * (y / z)) else: tmp = ((t / y) - y) * (0.3333333333333333 / z) return tmp
function code(x, y, z, t) tmp = 0.0 if ((Float64(z * 3.0) <= -1e+237) || !((Float64(z * 3.0) <= -4e+158) || (!(Float64(z * 3.0) <= -5e+82) && (Float64(z * 3.0) <= 2e+38)))) tmp = Float64(x - Float64(0.3333333333333333 * Float64(y / z))); else tmp = Float64(Float64(Float64(t / y) - y) * Float64(0.3333333333333333 / z)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (((z * 3.0) <= -1e+237) || ~((((z * 3.0) <= -4e+158) || (~(((z * 3.0) <= -5e+82)) && ((z * 3.0) <= 2e+38))))) tmp = x - (0.3333333333333333 * (y / z)); else tmp = ((t / y) - y) * (0.3333333333333333 / z); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[N[(z * 3.0), $MachinePrecision], -1e+237], N[Not[Or[LessEqual[N[(z * 3.0), $MachinePrecision], -4e+158], And[N[Not[LessEqual[N[(z * 3.0), $MachinePrecision], -5e+82]], $MachinePrecision], LessEqual[N[(z * 3.0), $MachinePrecision], 2e+38]]]], $MachinePrecision]], N[(x - N[(0.3333333333333333 * N[(y / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(t / y), $MachinePrecision] - y), $MachinePrecision] * N[(0.3333333333333333 / z), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \cdot 3 \leq -1 \cdot 10^{+237} \lor \neg \left(z \cdot 3 \leq -4 \cdot 10^{+158} \lor \neg \left(z \cdot 3 \leq -5 \cdot 10^{+82}\right) \land z \cdot 3 \leq 2 \cdot 10^{+38}\right):\\
\;\;\;\;x - 0.3333333333333333 \cdot \frac{y}{z}\\
\mathbf{else}:\\
\;\;\;\;\left(\frac{t}{y} - y\right) \cdot \frac{0.3333333333333333}{z}\\
\end{array}
\end{array}
if (*.f64 z #s(literal 3 binary64)) < -9.9999999999999994e236 or -3.99999999999999981e158 < (*.f64 z #s(literal 3 binary64)) < -5.00000000000000015e82 or 1.99999999999999995e38 < (*.f64 z #s(literal 3 binary64)) Initial program 99.8%
Taylor expanded in t around 0 82.4%
if -9.9999999999999994e236 < (*.f64 z #s(literal 3 binary64)) < -3.99999999999999981e158 or -5.00000000000000015e82 < (*.f64 z #s(literal 3 binary64)) < 1.99999999999999995e38Initial program 91.0%
+-commutative91.0%
associate-+r-91.0%
sub-neg91.0%
associate-*l*91.0%
*-commutative91.0%
distribute-frac-neg291.0%
distribute-rgt-neg-in91.0%
metadata-eval91.0%
Simplified91.0%
*-un-lft-identity91.0%
*-commutative91.0%
times-frac96.3%
Applied egg-rr96.3%
Taylor expanded in z around 0 86.8%
+-commutative86.8%
metadata-eval86.8%
cancel-sign-sub-inv86.8%
distribute-lft-out--86.8%
*-rgt-identity86.8%
associate-*r/86.7%
*-commutative86.7%
associate-*l*86.7%
associate-*r/86.8%
metadata-eval86.8%
Simplified86.8%
Final simplification85.3%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (+ x (/ 0.3333333333333333 (/ (* y z) t))))
(t_2 (- x (* 0.3333333333333333 (/ y z)))))
(if (<= y -0.00055)
t_2
(if (<= y -1.28e-123)
t_1
(if (<= y -1.9e-291)
(* 0.3333333333333333 (/ (- (/ t y) y) z))
(if (<= y 4.9e+39) t_1 t_2))))))
double code(double x, double y, double z, double t) {
double t_1 = x + (0.3333333333333333 / ((y * z) / t));
double t_2 = x - (0.3333333333333333 * (y / z));
double tmp;
if (y <= -0.00055) {
tmp = t_2;
} else if (y <= -1.28e-123) {
tmp = t_1;
} else if (y <= -1.9e-291) {
tmp = 0.3333333333333333 * (((t / y) - y) / z);
} else if (y <= 4.9e+39) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = x + (0.3333333333333333d0 / ((y * z) / t))
t_2 = x - (0.3333333333333333d0 * (y / z))
if (y <= (-0.00055d0)) then
tmp = t_2
else if (y <= (-1.28d-123)) then
tmp = t_1
else if (y <= (-1.9d-291)) then
tmp = 0.3333333333333333d0 * (((t / y) - y) / z)
else if (y <= 4.9d+39) 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 t_1 = x + (0.3333333333333333 / ((y * z) / t));
double t_2 = x - (0.3333333333333333 * (y / z));
double tmp;
if (y <= -0.00055) {
tmp = t_2;
} else if (y <= -1.28e-123) {
tmp = t_1;
} else if (y <= -1.9e-291) {
tmp = 0.3333333333333333 * (((t / y) - y) / z);
} else if (y <= 4.9e+39) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t): t_1 = x + (0.3333333333333333 / ((y * z) / t)) t_2 = x - (0.3333333333333333 * (y / z)) tmp = 0 if y <= -0.00055: tmp = t_2 elif y <= -1.28e-123: tmp = t_1 elif y <= -1.9e-291: tmp = 0.3333333333333333 * (((t / y) - y) / z) elif y <= 4.9e+39: tmp = t_1 else: tmp = t_2 return tmp
function code(x, y, z, t) t_1 = Float64(x + Float64(0.3333333333333333 / Float64(Float64(y * z) / t))) t_2 = Float64(x - Float64(0.3333333333333333 * Float64(y / z))) tmp = 0.0 if (y <= -0.00055) tmp = t_2; elseif (y <= -1.28e-123) tmp = t_1; elseif (y <= -1.9e-291) tmp = Float64(0.3333333333333333 * Float64(Float64(Float64(t / y) - y) / z)); elseif (y <= 4.9e+39) tmp = t_1; else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = x + (0.3333333333333333 / ((y * z) / t)); t_2 = x - (0.3333333333333333 * (y / z)); tmp = 0.0; if (y <= -0.00055) tmp = t_2; elseif (y <= -1.28e-123) tmp = t_1; elseif (y <= -1.9e-291) tmp = 0.3333333333333333 * (((t / y) - y) / z); elseif (y <= 4.9e+39) tmp = t_1; else tmp = t_2; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(x + N[(0.3333333333333333 / N[(N[(y * z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(x - N[(0.3333333333333333 * N[(y / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -0.00055], t$95$2, If[LessEqual[y, -1.28e-123], t$95$1, If[LessEqual[y, -1.9e-291], N[(0.3333333333333333 * N[(N[(N[(t / y), $MachinePrecision] - y), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 4.9e+39], t$95$1, t$95$2]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x + \frac{0.3333333333333333}{\frac{y \cdot z}{t}}\\
t_2 := x - 0.3333333333333333 \cdot \frac{y}{z}\\
\mathbf{if}\;y \leq -0.00055:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;y \leq -1.28 \cdot 10^{-123}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq -1.9 \cdot 10^{-291}:\\
\;\;\;\;0.3333333333333333 \cdot \frac{\frac{t}{y} - y}{z}\\
\mathbf{elif}\;y \leq 4.9 \cdot 10^{+39}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if y < -5.50000000000000033e-4 or 4.89999999999999987e39 < y Initial program 99.8%
Taylor expanded in t around 0 94.4%
if -5.50000000000000033e-4 < y < -1.28000000000000002e-123 or -1.8999999999999999e-291 < y < 4.89999999999999987e39Initial program 93.7%
sub-neg93.7%
associate-+l+93.7%
+-commutative93.7%
remove-double-neg93.7%
distribute-frac-neg93.7%
distribute-neg-in93.7%
remove-double-neg93.7%
sub-neg93.7%
neg-mul-193.7%
times-frac92.0%
distribute-frac-neg92.0%
neg-mul-192.0%
*-commutative92.0%
associate-/l*92.0%
*-commutative92.0%
Simplified91.9%
Taylor expanded in z around 0 92.0%
associate-*r/91.9%
distribute-lft-out--91.9%
clear-num91.9%
*-un-lft-identity91.9%
distribute-lft-out--91.9%
times-frac92.0%
metadata-eval92.0%
Applied egg-rr92.0%
associate-/r*91.9%
metadata-eval91.9%
Simplified91.9%
Taylor expanded in t around inf 87.1%
if -1.28000000000000002e-123 < y < -1.8999999999999999e-291Initial program 75.9%
Taylor expanded in z around 0 85.7%
distribute-lft-out--85.7%
associate-*r/85.8%
*-commutative85.8%
Applied egg-rr85.8%
Final simplification90.0%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (- x (* 0.3333333333333333 (/ y z)))))
(if (<= y -25.0)
t_1
(if (<= y -8.2e-123)
(+ x (* t (/ 0.3333333333333333 (* y z))))
(if (<= y -1e-290)
(* 0.3333333333333333 (/ (- (/ t y) y) z))
(if (<= y 2.7e+39)
(+ x (* 0.3333333333333333 (/ t (* y z))))
t_1))))))
double code(double x, double y, double z, double t) {
double t_1 = x - (0.3333333333333333 * (y / z));
double tmp;
if (y <= -25.0) {
tmp = t_1;
} else if (y <= -8.2e-123) {
tmp = x + (t * (0.3333333333333333 / (y * z)));
} else if (y <= -1e-290) {
tmp = 0.3333333333333333 * (((t / y) - y) / z);
} else if (y <= 2.7e+39) {
tmp = x + (0.3333333333333333 * (t / (y * z)));
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: tmp
t_1 = x - (0.3333333333333333d0 * (y / z))
if (y <= (-25.0d0)) then
tmp = t_1
else if (y <= (-8.2d-123)) then
tmp = x + (t * (0.3333333333333333d0 / (y * z)))
else if (y <= (-1d-290)) then
tmp = 0.3333333333333333d0 * (((t / y) - y) / z)
else if (y <= 2.7d+39) then
tmp = x + (0.3333333333333333d0 * (t / (y * z)))
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = x - (0.3333333333333333 * (y / z));
double tmp;
if (y <= -25.0) {
tmp = t_1;
} else if (y <= -8.2e-123) {
tmp = x + (t * (0.3333333333333333 / (y * z)));
} else if (y <= -1e-290) {
tmp = 0.3333333333333333 * (((t / y) - y) / z);
} else if (y <= 2.7e+39) {
tmp = x + (0.3333333333333333 * (t / (y * z)));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = x - (0.3333333333333333 * (y / z)) tmp = 0 if y <= -25.0: tmp = t_1 elif y <= -8.2e-123: tmp = x + (t * (0.3333333333333333 / (y * z))) elif y <= -1e-290: tmp = 0.3333333333333333 * (((t / y) - y) / z) elif y <= 2.7e+39: tmp = x + (0.3333333333333333 * (t / (y * z))) else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(x - Float64(0.3333333333333333 * Float64(y / z))) tmp = 0.0 if (y <= -25.0) tmp = t_1; elseif (y <= -8.2e-123) tmp = Float64(x + Float64(t * Float64(0.3333333333333333 / Float64(y * z)))); elseif (y <= -1e-290) tmp = Float64(0.3333333333333333 * Float64(Float64(Float64(t / y) - y) / z)); elseif (y <= 2.7e+39) tmp = Float64(x + Float64(0.3333333333333333 * Float64(t / Float64(y * z)))); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = x - (0.3333333333333333 * (y / z)); tmp = 0.0; if (y <= -25.0) tmp = t_1; elseif (y <= -8.2e-123) tmp = x + (t * (0.3333333333333333 / (y * z))); elseif (y <= -1e-290) tmp = 0.3333333333333333 * (((t / y) - y) / z); elseif (y <= 2.7e+39) tmp = x + (0.3333333333333333 * (t / (y * z))); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(x - N[(0.3333333333333333 * N[(y / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -25.0], t$95$1, If[LessEqual[y, -8.2e-123], N[(x + N[(t * N[(0.3333333333333333 / N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, -1e-290], N[(0.3333333333333333 * N[(N[(N[(t / y), $MachinePrecision] - y), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 2.7e+39], N[(x + N[(0.3333333333333333 * N[(t / N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x - 0.3333333333333333 \cdot \frac{y}{z}\\
\mathbf{if}\;y \leq -25:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq -8.2 \cdot 10^{-123}:\\
\;\;\;\;x + t \cdot \frac{0.3333333333333333}{y \cdot z}\\
\mathbf{elif}\;y \leq -1 \cdot 10^{-290}:\\
\;\;\;\;0.3333333333333333 \cdot \frac{\frac{t}{y} - y}{z}\\
\mathbf{elif}\;y \leq 2.7 \cdot 10^{+39}:\\
\;\;\;\;x + 0.3333333333333333 \cdot \frac{t}{y \cdot z}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y < -25 or 2.70000000000000003e39 < y Initial program 99.8%
Taylor expanded in t around 0 94.4%
if -25 < y < -8.2000000000000001e-123Initial program 95.0%
sub-neg95.0%
associate-+l+95.0%
+-commutative95.0%
remove-double-neg95.0%
distribute-frac-neg95.0%
distribute-neg-in95.0%
remove-double-neg95.0%
sub-neg95.0%
neg-mul-195.0%
times-frac97.5%
distribute-frac-neg97.5%
neg-mul-197.5%
*-commutative97.5%
associate-/l*97.5%
*-commutative97.5%
Simplified97.3%
Taylor expanded in z around 0 97.3%
associate-*r/97.3%
distribute-lft-out--97.3%
clear-num97.3%
*-un-lft-identity97.3%
distribute-lft-out--97.3%
times-frac97.3%
metadata-eval97.3%
Applied egg-rr97.3%
associate-/r*97.2%
metadata-eval97.2%
Simplified97.2%
Taylor expanded in t around inf 82.8%
associate-*r/82.8%
*-commutative82.8%
*-commutative82.8%
associate-/l*82.8%
Simplified82.8%
if -8.2000000000000001e-123 < y < -1.0000000000000001e-290Initial program 75.9%
Taylor expanded in z around 0 85.7%
distribute-lft-out--85.7%
associate-*r/85.8%
*-commutative85.8%
Applied egg-rr85.8%
if -1.0000000000000001e-290 < y < 2.70000000000000003e39Initial program 93.0%
sub-neg93.0%
associate-+l+93.0%
+-commutative93.0%
remove-double-neg93.0%
distribute-frac-neg93.0%
distribute-neg-in93.0%
remove-double-neg93.0%
sub-neg93.0%
neg-mul-193.0%
times-frac89.2%
distribute-frac-neg89.2%
neg-mul-189.2%
*-commutative89.2%
associate-/l*89.2%
*-commutative89.2%
Simplified89.2%
Taylor expanded in t around inf 89.3%
Final simplification89.9%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (+ x (* 0.3333333333333333 (/ t (* y z)))))
(t_2 (- x (* 0.3333333333333333 (/ y z)))))
(if (<= y -2.2e-26)
t_2
(if (<= y -1.25e-123)
t_1
(if (<= y -5.4e-291)
(* 0.3333333333333333 (/ (- (/ t y) y) z))
(if (<= y 9.4e+33) t_1 t_2))))))
double code(double x, double y, double z, double t) {
double t_1 = x + (0.3333333333333333 * (t / (y * z)));
double t_2 = x - (0.3333333333333333 * (y / z));
double tmp;
if (y <= -2.2e-26) {
tmp = t_2;
} else if (y <= -1.25e-123) {
tmp = t_1;
} else if (y <= -5.4e-291) {
tmp = 0.3333333333333333 * (((t / y) - y) / z);
} else if (y <= 9.4e+33) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = x + (0.3333333333333333d0 * (t / (y * z)))
t_2 = x - (0.3333333333333333d0 * (y / z))
if (y <= (-2.2d-26)) then
tmp = t_2
else if (y <= (-1.25d-123)) then
tmp = t_1
else if (y <= (-5.4d-291)) then
tmp = 0.3333333333333333d0 * (((t / y) - y) / z)
else if (y <= 9.4d+33) 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 t_1 = x + (0.3333333333333333 * (t / (y * z)));
double t_2 = x - (0.3333333333333333 * (y / z));
double tmp;
if (y <= -2.2e-26) {
tmp = t_2;
} else if (y <= -1.25e-123) {
tmp = t_1;
} else if (y <= -5.4e-291) {
tmp = 0.3333333333333333 * (((t / y) - y) / z);
} else if (y <= 9.4e+33) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t): t_1 = x + (0.3333333333333333 * (t / (y * z))) t_2 = x - (0.3333333333333333 * (y / z)) tmp = 0 if y <= -2.2e-26: tmp = t_2 elif y <= -1.25e-123: tmp = t_1 elif y <= -5.4e-291: tmp = 0.3333333333333333 * (((t / y) - y) / z) elif y <= 9.4e+33: tmp = t_1 else: tmp = t_2 return tmp
function code(x, y, z, t) t_1 = Float64(x + Float64(0.3333333333333333 * Float64(t / Float64(y * z)))) t_2 = Float64(x - Float64(0.3333333333333333 * Float64(y / z))) tmp = 0.0 if (y <= -2.2e-26) tmp = t_2; elseif (y <= -1.25e-123) tmp = t_1; elseif (y <= -5.4e-291) tmp = Float64(0.3333333333333333 * Float64(Float64(Float64(t / y) - y) / z)); elseif (y <= 9.4e+33) tmp = t_1; else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = x + (0.3333333333333333 * (t / (y * z))); t_2 = x - (0.3333333333333333 * (y / z)); tmp = 0.0; if (y <= -2.2e-26) tmp = t_2; elseif (y <= -1.25e-123) tmp = t_1; elseif (y <= -5.4e-291) tmp = 0.3333333333333333 * (((t / y) - y) / z); elseif (y <= 9.4e+33) tmp = t_1; else tmp = t_2; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(x + N[(0.3333333333333333 * N[(t / N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(x - N[(0.3333333333333333 * N[(y / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -2.2e-26], t$95$2, If[LessEqual[y, -1.25e-123], t$95$1, If[LessEqual[y, -5.4e-291], N[(0.3333333333333333 * N[(N[(N[(t / y), $MachinePrecision] - y), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 9.4e+33], t$95$1, t$95$2]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x + 0.3333333333333333 \cdot \frac{t}{y \cdot z}\\
t_2 := x - 0.3333333333333333 \cdot \frac{y}{z}\\
\mathbf{if}\;y \leq -2.2 \cdot 10^{-26}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;y \leq -1.25 \cdot 10^{-123}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq -5.4 \cdot 10^{-291}:\\
\;\;\;\;0.3333333333333333 \cdot \frac{\frac{t}{y} - y}{z}\\
\mathbf{elif}\;y \leq 9.4 \cdot 10^{+33}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if y < -2.2000000000000001e-26 or 9.3999999999999996e33 < y Initial program 99.8%
Taylor expanded in t around 0 92.1%
if -2.2000000000000001e-26 < y < -1.25000000000000007e-123 or -5.39999999999999983e-291 < y < 9.3999999999999996e33Initial program 93.3%
sub-neg93.3%
associate-+l+93.3%
+-commutative93.3%
remove-double-neg93.3%
distribute-frac-neg93.3%
distribute-neg-in93.3%
remove-double-neg93.3%
sub-neg93.3%
neg-mul-193.3%
times-frac91.5%
distribute-frac-neg91.5%
neg-mul-191.5%
*-commutative91.5%
associate-/l*91.5%
*-commutative91.5%
Simplified91.5%
Taylor expanded in t around inf 88.9%
if -1.25000000000000007e-123 < y < -5.39999999999999983e-291Initial program 75.9%
Taylor expanded in z around 0 85.7%
distribute-lft-out--85.7%
associate-*r/85.8%
*-commutative85.8%
Applied egg-rr85.8%
Final simplification89.9%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (/ y (* z -3.0))))
(if (<= t 7e-15)
(+ (+ (* (/ 0.3333333333333333 y) (/ t z)) x) t_1)
(+ t_1 (+ x (/ t (* z (* y 3.0))))))))
double code(double x, double y, double z, double t) {
double t_1 = y / (z * -3.0);
double tmp;
if (t <= 7e-15) {
tmp = (((0.3333333333333333 / y) * (t / z)) + x) + t_1;
} else {
tmp = t_1 + (x + (t / (z * (y * 3.0))));
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: tmp
t_1 = y / (z * (-3.0d0))
if (t <= 7d-15) then
tmp = (((0.3333333333333333d0 / y) * (t / z)) + x) + t_1
else
tmp = t_1 + (x + (t / (z * (y * 3.0d0))))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = y / (z * -3.0);
double tmp;
if (t <= 7e-15) {
tmp = (((0.3333333333333333 / y) * (t / z)) + x) + t_1;
} else {
tmp = t_1 + (x + (t / (z * (y * 3.0))));
}
return tmp;
}
def code(x, y, z, t): t_1 = y / (z * -3.0) tmp = 0 if t <= 7e-15: tmp = (((0.3333333333333333 / y) * (t / z)) + x) + t_1 else: tmp = t_1 + (x + (t / (z * (y * 3.0)))) return tmp
function code(x, y, z, t) t_1 = Float64(y / Float64(z * -3.0)) tmp = 0.0 if (t <= 7e-15) tmp = Float64(Float64(Float64(Float64(0.3333333333333333 / y) * Float64(t / z)) + x) + t_1); else tmp = Float64(t_1 + Float64(x + Float64(t / Float64(z * Float64(y * 3.0))))); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = y / (z * -3.0); tmp = 0.0; if (t <= 7e-15) tmp = (((0.3333333333333333 / y) * (t / z)) + x) + t_1; else tmp = t_1 + (x + (t / (z * (y * 3.0)))); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(y / N[(z * -3.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, 7e-15], N[(N[(N[(N[(0.3333333333333333 / y), $MachinePrecision] * N[(t / z), $MachinePrecision]), $MachinePrecision] + x), $MachinePrecision] + t$95$1), $MachinePrecision], N[(t$95$1 + N[(x + N[(t / N[(z * N[(y * 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{y}{z \cdot -3}\\
\mathbf{if}\;t \leq 7 \cdot 10^{-15}:\\
\;\;\;\;\left(\frac{0.3333333333333333}{y} \cdot \frac{t}{z} + x\right) + t\_1\\
\mathbf{else}:\\
\;\;\;\;t\_1 + \left(x + \frac{t}{z \cdot \left(y \cdot 3\right)}\right)\\
\end{array}
\end{array}
if t < 7.0000000000000001e-15Initial program 91.7%
+-commutative91.7%
associate-+r-91.7%
sub-neg91.7%
associate-*l*91.7%
*-commutative91.7%
distribute-frac-neg291.7%
distribute-rgt-neg-in91.7%
metadata-eval91.7%
Simplified91.7%
*-un-lft-identity91.7%
*-commutative91.7%
times-frac98.6%
Applied egg-rr98.6%
Taylor expanded in y around 0 98.6%
if 7.0000000000000001e-15 < t Initial program 99.8%
+-commutative99.8%
associate-+r-99.8%
sub-neg99.8%
associate-*l*99.8%
*-commutative99.8%
distribute-frac-neg299.8%
distribute-rgt-neg-in99.8%
metadata-eval99.8%
Simplified99.8%
Final simplification99.0%
(FPCore (x y z t) :precision binary64 (if (<= (* z 3.0) 2e+138) (+ x (* 0.3333333333333333 (/ (- (/ t y) y) z))) (+ x (/ 0.3333333333333333 (/ (* y z) t)))))
double code(double x, double y, double z, double t) {
double tmp;
if ((z * 3.0) <= 2e+138) {
tmp = x + (0.3333333333333333 * (((t / y) - y) / z));
} else {
tmp = x + (0.3333333333333333 / ((y * z) / t));
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if ((z * 3.0d0) <= 2d+138) then
tmp = x + (0.3333333333333333d0 * (((t / y) - y) / z))
else
tmp = x + (0.3333333333333333d0 / ((y * z) / t))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((z * 3.0) <= 2e+138) {
tmp = x + (0.3333333333333333 * (((t / y) - y) / z));
} else {
tmp = x + (0.3333333333333333 / ((y * z) / t));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (z * 3.0) <= 2e+138: tmp = x + (0.3333333333333333 * (((t / y) - y) / z)) else: tmp = x + (0.3333333333333333 / ((y * z) / t)) return tmp
function code(x, y, z, t) tmp = 0.0 if (Float64(z * 3.0) <= 2e+138) tmp = Float64(x + Float64(0.3333333333333333 * Float64(Float64(Float64(t / y) - y) / z))); else tmp = Float64(x + Float64(0.3333333333333333 / Float64(Float64(y * z) / t))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((z * 3.0) <= 2e+138) tmp = x + (0.3333333333333333 * (((t / y) - y) / z)); else tmp = x + (0.3333333333333333 / ((y * z) / t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[N[(z * 3.0), $MachinePrecision], 2e+138], N[(x + N[(0.3333333333333333 * N[(N[(N[(t / y), $MachinePrecision] - y), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(0.3333333333333333 / N[(N[(y * z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \cdot 3 \leq 2 \cdot 10^{+138}:\\
\;\;\;\;x + 0.3333333333333333 \cdot \frac{\frac{t}{y} - y}{z}\\
\mathbf{else}:\\
\;\;\;\;x + \frac{0.3333333333333333}{\frac{y \cdot z}{t}}\\
\end{array}
\end{array}
if (*.f64 z #s(literal 3 binary64)) < 2.0000000000000001e138Initial program 92.9%
sub-neg92.9%
associate-+l+92.9%
+-commutative92.9%
remove-double-neg92.9%
distribute-frac-neg92.9%
distribute-neg-in92.9%
remove-double-neg92.9%
sub-neg92.9%
neg-mul-192.9%
times-frac97.7%
distribute-frac-neg97.7%
neg-mul-197.7%
*-commutative97.7%
associate-/l*97.7%
*-commutative97.7%
Simplified97.6%
Taylor expanded in z around 0 97.7%
if 2.0000000000000001e138 < (*.f64 z #s(literal 3 binary64)) Initial program 99.9%
sub-neg99.9%
associate-+l+99.9%
+-commutative99.9%
remove-double-neg99.9%
distribute-frac-neg99.9%
distribute-neg-in99.9%
remove-double-neg99.9%
sub-neg99.9%
neg-mul-199.9%
times-frac80.6%
distribute-frac-neg80.6%
neg-mul-180.6%
*-commutative80.6%
associate-/l*80.6%
*-commutative80.6%
Simplified80.5%
Taylor expanded in z around 0 80.5%
associate-*r/80.5%
distribute-lft-out--80.5%
clear-num80.5%
*-un-lft-identity80.5%
distribute-lft-out--80.5%
times-frac80.5%
metadata-eval80.5%
Applied egg-rr80.5%
associate-/r*80.6%
metadata-eval80.6%
Simplified80.6%
Taylor expanded in t around inf 91.8%
(FPCore (x y z t) :precision binary64 (if (or (<= y -2.4e-63) (not (<= y 6e-130))) (- x (* 0.3333333333333333 (/ y z))) (/ (/ 0.3333333333333333 (/ y t)) z)))
double code(double x, double y, double z, double t) {
double tmp;
if ((y <= -2.4e-63) || !(y <= 6e-130)) {
tmp = x - (0.3333333333333333 * (y / z));
} else {
tmp = (0.3333333333333333 / (y / t)) / z;
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if ((y <= (-2.4d-63)) .or. (.not. (y <= 6d-130))) then
tmp = x - (0.3333333333333333d0 * (y / z))
else
tmp = (0.3333333333333333d0 / (y / t)) / z
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((y <= -2.4e-63) || !(y <= 6e-130)) {
tmp = x - (0.3333333333333333 * (y / z));
} else {
tmp = (0.3333333333333333 / (y / t)) / z;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (y <= -2.4e-63) or not (y <= 6e-130): tmp = x - (0.3333333333333333 * (y / z)) else: tmp = (0.3333333333333333 / (y / t)) / z return tmp
function code(x, y, z, t) tmp = 0.0 if ((y <= -2.4e-63) || !(y <= 6e-130)) tmp = Float64(x - Float64(0.3333333333333333 * Float64(y / z))); else tmp = Float64(Float64(0.3333333333333333 / Float64(y / t)) / z); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((y <= -2.4e-63) || ~((y <= 6e-130))) tmp = x - (0.3333333333333333 * (y / z)); else tmp = (0.3333333333333333 / (y / t)) / z; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[y, -2.4e-63], N[Not[LessEqual[y, 6e-130]], $MachinePrecision]], N[(x - N[(0.3333333333333333 * N[(y / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(0.3333333333333333 / N[(y / t), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -2.4 \cdot 10^{-63} \lor \neg \left(y \leq 6 \cdot 10^{-130}\right):\\
\;\;\;\;x - 0.3333333333333333 \cdot \frac{y}{z}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{0.3333333333333333}{\frac{y}{t}}}{z}\\
\end{array}
\end{array}
if y < -2.4000000000000001e-63 or 5.99999999999999972e-130 < y Initial program 98.7%
Taylor expanded in t around 0 83.4%
if -2.4000000000000001e-63 < y < 5.99999999999999972e-130Initial program 85.6%
Taylor expanded in z around 0 72.5%
div-inv72.4%
distribute-lft-out--72.4%
Applied egg-rr72.4%
Taylor expanded in t around inf 70.4%
un-div-inv70.5%
clear-num70.5%
un-div-inv70.5%
Applied egg-rr70.5%
Final simplification78.7%
(FPCore (x y z t) :precision binary64 (if (or (<= y -2.65e-61) (not (<= y 2.75e-129))) (- x (* 0.3333333333333333 (/ y z))) (/ (* 0.3333333333333333 (/ t y)) z)))
double code(double x, double y, double z, double t) {
double tmp;
if ((y <= -2.65e-61) || !(y <= 2.75e-129)) {
tmp = x - (0.3333333333333333 * (y / z));
} else {
tmp = (0.3333333333333333 * (t / y)) / z;
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if ((y <= (-2.65d-61)) .or. (.not. (y <= 2.75d-129))) then
tmp = x - (0.3333333333333333d0 * (y / z))
else
tmp = (0.3333333333333333d0 * (t / y)) / z
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((y <= -2.65e-61) || !(y <= 2.75e-129)) {
tmp = x - (0.3333333333333333 * (y / z));
} else {
tmp = (0.3333333333333333 * (t / y)) / z;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (y <= -2.65e-61) or not (y <= 2.75e-129): tmp = x - (0.3333333333333333 * (y / z)) else: tmp = (0.3333333333333333 * (t / y)) / z return tmp
function code(x, y, z, t) tmp = 0.0 if ((y <= -2.65e-61) || !(y <= 2.75e-129)) tmp = Float64(x - Float64(0.3333333333333333 * Float64(y / z))); else tmp = Float64(Float64(0.3333333333333333 * Float64(t / y)) / z); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((y <= -2.65e-61) || ~((y <= 2.75e-129))) tmp = x - (0.3333333333333333 * (y / z)); else tmp = (0.3333333333333333 * (t / y)) / z; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[y, -2.65e-61], N[Not[LessEqual[y, 2.75e-129]], $MachinePrecision]], N[(x - N[(0.3333333333333333 * N[(y / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(0.3333333333333333 * N[(t / y), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -2.65 \cdot 10^{-61} \lor \neg \left(y \leq 2.75 \cdot 10^{-129}\right):\\
\;\;\;\;x - 0.3333333333333333 \cdot \frac{y}{z}\\
\mathbf{else}:\\
\;\;\;\;\frac{0.3333333333333333 \cdot \frac{t}{y}}{z}\\
\end{array}
\end{array}
if y < -2.65e-61 or 2.75000000000000012e-129 < y Initial program 98.7%
Taylor expanded in t around 0 83.4%
if -2.65e-61 < y < 2.75000000000000012e-129Initial program 85.6%
Taylor expanded in z around 0 72.5%
Taylor expanded in t around inf 70.5%
Final simplification78.7%
(FPCore (x y z t) :precision binary64 (if (<= x -3.5e-12) x (if (<= x 2.6e+113) (/ y (* z -3.0)) x)))
double code(double x, double y, double z, double t) {
double tmp;
if (x <= -3.5e-12) {
tmp = x;
} else if (x <= 2.6e+113) {
tmp = y / (z * -3.0);
} else {
tmp = x;
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (x <= (-3.5d-12)) then
tmp = x
else if (x <= 2.6d+113) then
tmp = y / (z * (-3.0d0))
else
tmp = x
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (x <= -3.5e-12) {
tmp = x;
} else if (x <= 2.6e+113) {
tmp = y / (z * -3.0);
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if x <= -3.5e-12: tmp = x elif x <= 2.6e+113: tmp = y / (z * -3.0) else: tmp = x return tmp
function code(x, y, z, t) tmp = 0.0 if (x <= -3.5e-12) tmp = x; elseif (x <= 2.6e+113) tmp = Float64(y / Float64(z * -3.0)); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (x <= -3.5e-12) tmp = x; elseif (x <= 2.6e+113) tmp = y / (z * -3.0); else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[x, -3.5e-12], x, If[LessEqual[x, 2.6e+113], N[(y / N[(z * -3.0), $MachinePrecision]), $MachinePrecision], x]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -3.5 \cdot 10^{-12}:\\
\;\;\;\;x\\
\mathbf{elif}\;x \leq 2.6 \cdot 10^{+113}:\\
\;\;\;\;\frac{y}{z \cdot -3}\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if x < -3.5e-12 or 2.5999999999999999e113 < x Initial program 92.4%
sub-neg92.4%
associate-+l+92.4%
+-commutative92.4%
remove-double-neg92.4%
distribute-frac-neg92.4%
distribute-neg-in92.4%
remove-double-neg92.4%
sub-neg92.4%
neg-mul-192.4%
times-frac97.3%
distribute-frac-neg97.3%
neg-mul-197.3%
*-commutative97.3%
associate-/l*97.3%
*-commutative97.3%
Simplified97.2%
Taylor expanded in x around inf 55.8%
if -3.5e-12 < x < 2.5999999999999999e113Initial program 95.0%
+-commutative95.0%
associate-+r-95.0%
sub-neg95.0%
associate-*l*95.0%
*-commutative95.0%
distribute-frac-neg295.0%
distribute-rgt-neg-in95.0%
metadata-eval95.0%
Simplified95.0%
*-un-lft-identity95.0%
*-commutative95.0%
times-frac95.6%
Applied egg-rr95.6%
Taylor expanded in y around inf 46.2%
metadata-eval46.2%
times-frac46.2%
*-un-lft-identity46.2%
*-commutative46.2%
Applied egg-rr46.2%
(FPCore (x y z t) :precision binary64 (if (<= x -4.4e-11) x (if (<= x 1e+114) (/ -0.3333333333333333 (/ z y)) x)))
double code(double x, double y, double z, double t) {
double tmp;
if (x <= -4.4e-11) {
tmp = x;
} else if (x <= 1e+114) {
tmp = -0.3333333333333333 / (z / y);
} else {
tmp = x;
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (x <= (-4.4d-11)) then
tmp = x
else if (x <= 1d+114) then
tmp = (-0.3333333333333333d0) / (z / y)
else
tmp = x
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (x <= -4.4e-11) {
tmp = x;
} else if (x <= 1e+114) {
tmp = -0.3333333333333333 / (z / y);
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if x <= -4.4e-11: tmp = x elif x <= 1e+114: tmp = -0.3333333333333333 / (z / y) else: tmp = x return tmp
function code(x, y, z, t) tmp = 0.0 if (x <= -4.4e-11) tmp = x; elseif (x <= 1e+114) tmp = Float64(-0.3333333333333333 / Float64(z / y)); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (x <= -4.4e-11) tmp = x; elseif (x <= 1e+114) tmp = -0.3333333333333333 / (z / y); else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[x, -4.4e-11], x, If[LessEqual[x, 1e+114], N[(-0.3333333333333333 / N[(z / y), $MachinePrecision]), $MachinePrecision], x]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -4.4 \cdot 10^{-11}:\\
\;\;\;\;x\\
\mathbf{elif}\;x \leq 10^{+114}:\\
\;\;\;\;\frac{-0.3333333333333333}{\frac{z}{y}}\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if x < -4.4000000000000003e-11 or 1e114 < x Initial program 92.4%
sub-neg92.4%
associate-+l+92.4%
+-commutative92.4%
remove-double-neg92.4%
distribute-frac-neg92.4%
distribute-neg-in92.4%
remove-double-neg92.4%
sub-neg92.4%
neg-mul-192.4%
times-frac97.3%
distribute-frac-neg97.3%
neg-mul-197.3%
*-commutative97.3%
associate-/l*97.3%
*-commutative97.3%
Simplified97.2%
Taylor expanded in x around inf 55.8%
if -4.4000000000000003e-11 < x < 1e114Initial program 95.0%
+-commutative95.0%
associate-+r-95.0%
sub-neg95.0%
associate-*l*95.0%
*-commutative95.0%
distribute-frac-neg295.0%
distribute-rgt-neg-in95.0%
metadata-eval95.0%
Simplified95.0%
*-un-lft-identity95.0%
*-commutative95.0%
times-frac95.6%
Applied egg-rr95.6%
Taylor expanded in y around inf 46.2%
clear-num46.2%
un-div-inv46.2%
Applied egg-rr46.2%
(FPCore (x y z t) :precision binary64 (if (<= x -9.8e-14) x (if (<= x 1.6e+113) (* -0.3333333333333333 (/ y z)) x)))
double code(double x, double y, double z, double t) {
double tmp;
if (x <= -9.8e-14) {
tmp = x;
} else if (x <= 1.6e+113) {
tmp = -0.3333333333333333 * (y / z);
} else {
tmp = x;
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (x <= (-9.8d-14)) then
tmp = x
else if (x <= 1.6d+113) then
tmp = (-0.3333333333333333d0) * (y / z)
else
tmp = x
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (x <= -9.8e-14) {
tmp = x;
} else if (x <= 1.6e+113) {
tmp = -0.3333333333333333 * (y / z);
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if x <= -9.8e-14: tmp = x elif x <= 1.6e+113: tmp = -0.3333333333333333 * (y / z) else: tmp = x return tmp
function code(x, y, z, t) tmp = 0.0 if (x <= -9.8e-14) tmp = x; elseif (x <= 1.6e+113) tmp = Float64(-0.3333333333333333 * Float64(y / z)); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (x <= -9.8e-14) tmp = x; elseif (x <= 1.6e+113) tmp = -0.3333333333333333 * (y / z); else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[x, -9.8e-14], x, If[LessEqual[x, 1.6e+113], N[(-0.3333333333333333 * N[(y / z), $MachinePrecision]), $MachinePrecision], x]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -9.8 \cdot 10^{-14}:\\
\;\;\;\;x\\
\mathbf{elif}\;x \leq 1.6 \cdot 10^{+113}:\\
\;\;\;\;-0.3333333333333333 \cdot \frac{y}{z}\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if x < -9.79999999999999989e-14 or 1.5999999999999999e113 < x Initial program 92.4%
sub-neg92.4%
associate-+l+92.4%
+-commutative92.4%
remove-double-neg92.4%
distribute-frac-neg92.4%
distribute-neg-in92.4%
remove-double-neg92.4%
sub-neg92.4%
neg-mul-192.4%
times-frac97.3%
distribute-frac-neg97.3%
neg-mul-197.3%
*-commutative97.3%
associate-/l*97.3%
*-commutative97.3%
Simplified97.2%
Taylor expanded in x around inf 55.8%
if -9.79999999999999989e-14 < x < 1.5999999999999999e113Initial program 95.0%
+-commutative95.0%
associate-+r-95.0%
sub-neg95.0%
associate-*l*95.0%
*-commutative95.0%
distribute-frac-neg295.0%
distribute-rgt-neg-in95.0%
metadata-eval95.0%
Simplified95.0%
*-un-lft-identity95.0%
*-commutative95.0%
times-frac95.6%
Applied egg-rr95.6%
Taylor expanded in y around inf 46.2%
(FPCore (x y z t) :precision binary64 (+ (+ (* (/ 0.3333333333333333 y) (/ t z)) x) (/ y (* z -3.0))))
double code(double x, double y, double z, double t) {
return (((0.3333333333333333 / y) * (t / z)) + x) + (y / (z * -3.0));
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = (((0.3333333333333333d0 / y) * (t / z)) + x) + (y / (z * (-3.0d0)))
end function
public static double code(double x, double y, double z, double t) {
return (((0.3333333333333333 / y) * (t / z)) + x) + (y / (z * -3.0));
}
def code(x, y, z, t): return (((0.3333333333333333 / y) * (t / z)) + x) + (y / (z * -3.0))
function code(x, y, z, t) return Float64(Float64(Float64(Float64(0.3333333333333333 / y) * Float64(t / z)) + x) + Float64(y / Float64(z * -3.0))) end
function tmp = code(x, y, z, t) tmp = (((0.3333333333333333 / y) * (t / z)) + x) + (y / (z * -3.0)); end
code[x_, y_, z_, t_] := N[(N[(N[(N[(0.3333333333333333 / y), $MachinePrecision] * N[(t / z), $MachinePrecision]), $MachinePrecision] + x), $MachinePrecision] + N[(y / N[(z * -3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(\frac{0.3333333333333333}{y} \cdot \frac{t}{z} + x\right) + \frac{y}{z \cdot -3}
\end{array}
Initial program 93.9%
+-commutative93.9%
associate-+r-93.9%
sub-neg93.9%
associate-*l*93.9%
*-commutative93.9%
distribute-frac-neg293.9%
distribute-rgt-neg-in93.9%
metadata-eval93.9%
Simplified93.9%
*-un-lft-identity93.9%
*-commutative93.9%
times-frac97.4%
Applied egg-rr97.4%
Taylor expanded in y around 0 97.4%
(FPCore (x y z t) :precision binary64 (- x (* 0.3333333333333333 (/ y z))))
double code(double x, double y, double z, double t) {
return x - (0.3333333333333333 * (y / z));
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = x - (0.3333333333333333d0 * (y / z))
end function
public static double code(double x, double y, double z, double t) {
return x - (0.3333333333333333 * (y / z));
}
def code(x, y, z, t): return x - (0.3333333333333333 * (y / z))
function code(x, y, z, t) return Float64(x - Float64(0.3333333333333333 * Float64(y / z))) end
function tmp = code(x, y, z, t) tmp = x - (0.3333333333333333 * (y / z)); end
code[x_, y_, z_, t_] := N[(x - N[(0.3333333333333333 * N[(y / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x - 0.3333333333333333 \cdot \frac{y}{z}
\end{array}
Initial program 93.9%
Taylor expanded in t around 0 61.0%
(FPCore (x y z t) :precision binary64 x)
double code(double x, double y, double z, double t) {
return x;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = x
end function
public static double code(double x, double y, double z, double t) {
return x;
}
def code(x, y, z, t): return x
function code(x, y, z, t) return x end
function tmp = code(x, y, z, t) tmp = x; end
code[x_, y_, z_, t_] := x
\begin{array}{l}
\\
x
\end{array}
Initial program 93.9%
sub-neg93.9%
associate-+l+93.9%
+-commutative93.9%
remove-double-neg93.9%
distribute-frac-neg93.9%
distribute-neg-in93.9%
remove-double-neg93.9%
sub-neg93.9%
neg-mul-193.9%
times-frac95.1%
distribute-frac-neg95.1%
neg-mul-195.1%
*-commutative95.1%
associate-/l*95.1%
*-commutative95.1%
Simplified95.1%
Taylor expanded in x around inf 30.9%
(FPCore (x y z t) :precision binary64 (+ (- x (/ y (* z 3.0))) (/ (/ t (* z 3.0)) y)))
double code(double x, double y, double z, double t) {
return (x - (y / (z * 3.0))) + ((t / (z * 3.0)) / y);
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = (x - (y / (z * 3.0d0))) + ((t / (z * 3.0d0)) / y)
end function
public static double code(double x, double y, double z, double t) {
return (x - (y / (z * 3.0))) + ((t / (z * 3.0)) / y);
}
def code(x, y, z, t): return (x - (y / (z * 3.0))) + ((t / (z * 3.0)) / y)
function code(x, y, z, t) return Float64(Float64(x - Float64(y / Float64(z * 3.0))) + Float64(Float64(t / Float64(z * 3.0)) / y)) end
function tmp = code(x, y, z, t) tmp = (x - (y / (z * 3.0))) + ((t / (z * 3.0)) / y); end
code[x_, y_, z_, t_] := N[(N[(x - N[(y / N[(z * 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(t / N[(z * 3.0), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(x - \frac{y}{z \cdot 3}\right) + \frac{\frac{t}{z \cdot 3}}{y}
\end{array}
herbie shell --seed 2024096
(FPCore (x y z t)
:name "Diagrams.Solve.Polynomial:cubForm from diagrams-solve-0.1, H"
:precision binary64
:alt
(+ (- x (/ y (* z 3.0))) (/ (/ t (* z 3.0)) y))
(+ (- x (/ y (* z 3.0))) (/ t (* (* z 3.0) y))))