
(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 (or (<= (* z 3.0) -1e-88) (not (<= (* z 3.0) 1e-22))) (+ (/ t (* y (* z 3.0))) (- x (/ y (* z 3.0)))) (+ x (/ -0.3333333333333333 (/ z (- y (/ t y)))))))
double code(double x, double y, double z, double t) {
double tmp;
if (((z * 3.0) <= -1e-88) || !((z * 3.0) <= 1e-22)) {
tmp = (t / (y * (z * 3.0))) + (x - (y / (z * 3.0)));
} else {
tmp = x + (-0.3333333333333333 / (z / (y - (t / y))));
}
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-88)) .or. (.not. ((z * 3.0d0) <= 1d-22))) then
tmp = (t / (y * (z * 3.0d0))) + (x - (y / (z * 3.0d0)))
else
tmp = x + ((-0.3333333333333333d0) / (z / (y - (t / y))))
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-88) || !((z * 3.0) <= 1e-22)) {
tmp = (t / (y * (z * 3.0))) + (x - (y / (z * 3.0)));
} else {
tmp = x + (-0.3333333333333333 / (z / (y - (t / y))));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if ((z * 3.0) <= -1e-88) or not ((z * 3.0) <= 1e-22): tmp = (t / (y * (z * 3.0))) + (x - (y / (z * 3.0))) else: tmp = x + (-0.3333333333333333 / (z / (y - (t / y)))) return tmp
function code(x, y, z, t) tmp = 0.0 if ((Float64(z * 3.0) <= -1e-88) || !(Float64(z * 3.0) <= 1e-22)) tmp = Float64(Float64(t / Float64(y * Float64(z * 3.0))) + Float64(x - Float64(y / Float64(z * 3.0)))); else tmp = Float64(x + Float64(-0.3333333333333333 / Float64(z / Float64(y - Float64(t / y))))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (((z * 3.0) <= -1e-88) || ~(((z * 3.0) <= 1e-22))) tmp = (t / (y * (z * 3.0))) + (x - (y / (z * 3.0))); else tmp = x + (-0.3333333333333333 / (z / (y - (t / y)))); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[N[(z * 3.0), $MachinePrecision], -1e-88], N[Not[LessEqual[N[(z * 3.0), $MachinePrecision], 1e-22]], $MachinePrecision]], N[(N[(t / N[(y * N[(z * 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(x - N[(y / N[(z * 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(-0.3333333333333333 / N[(z / N[(y - N[(t / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \cdot 3 \leq -1 \cdot 10^{-88} \lor \neg \left(z \cdot 3 \leq 10^{-22}\right):\\
\;\;\;\;\frac{t}{y \cdot \left(z \cdot 3\right)} + \left(x - \frac{y}{z \cdot 3}\right)\\
\mathbf{else}:\\
\;\;\;\;x + \frac{-0.3333333333333333}{\frac{z}{y - \frac{t}{y}}}\\
\end{array}
\end{array}
if (*.f64 z 3) < -9.99999999999999934e-89 or 1e-22 < (*.f64 z 3) Initial program 99.8%
if -9.99999999999999934e-89 < (*.f64 z 3) < 1e-22Initial program 88.5%
Simplified99.8%
Taylor expanded in z around 0 99.8%
clear-num99.8%
un-div-inv99.8%
Applied egg-rr99.8%
Final simplification99.8%
(FPCore (x y z t) :precision binary64 (if (<= t 3e+42) (+ (+ x (* -0.3333333333333333 (/ y z))) (* (/ t z) (/ (/ 1.0 y) 3.0))) (+ (- x (pow (* 3.0 (/ z y)) -1.0)) (/ t (* y (* z 3.0))))))
double code(double x, double y, double z, double t) {
double tmp;
if (t <= 3e+42) {
tmp = (x + (-0.3333333333333333 * (y / z))) + ((t / z) * ((1.0 / y) / 3.0));
} else {
tmp = (x - pow((3.0 * (z / y)), -1.0)) + (t / (y * (z * 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) :: tmp
if (t <= 3d+42) then
tmp = (x + ((-0.3333333333333333d0) * (y / z))) + ((t / z) * ((1.0d0 / y) / 3.0d0))
else
tmp = (x - ((3.0d0 * (z / y)) ** (-1.0d0))) + (t / (y * (z * 3.0d0)))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (t <= 3e+42) {
tmp = (x + (-0.3333333333333333 * (y / z))) + ((t / z) * ((1.0 / y) / 3.0));
} else {
tmp = (x - Math.pow((3.0 * (z / y)), -1.0)) + (t / (y * (z * 3.0)));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if t <= 3e+42: tmp = (x + (-0.3333333333333333 * (y / z))) + ((t / z) * ((1.0 / y) / 3.0)) else: tmp = (x - math.pow((3.0 * (z / y)), -1.0)) + (t / (y * (z * 3.0))) return tmp
function code(x, y, z, t) tmp = 0.0 if (t <= 3e+42) tmp = Float64(Float64(x + Float64(-0.3333333333333333 * Float64(y / z))) + Float64(Float64(t / z) * Float64(Float64(1.0 / y) / 3.0))); else tmp = Float64(Float64(x - (Float64(3.0 * Float64(z / y)) ^ -1.0)) + Float64(t / Float64(y * Float64(z * 3.0)))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (t <= 3e+42) tmp = (x + (-0.3333333333333333 * (y / z))) + ((t / z) * ((1.0 / y) / 3.0)); else tmp = (x - ((3.0 * (z / y)) ^ -1.0)) + (t / (y * (z * 3.0))); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[t, 3e+42], N[(N[(x + N[(-0.3333333333333333 * N[(y / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(t / z), $MachinePrecision] * N[(N[(1.0 / y), $MachinePrecision] / 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x - N[Power[N[(3.0 * N[(z / y), $MachinePrecision]), $MachinePrecision], -1.0], $MachinePrecision]), $MachinePrecision] + N[(t / N[(y * N[(z * 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq 3 \cdot 10^{+42}:\\
\;\;\;\;\left(x + -0.3333333333333333 \cdot \frac{y}{z}\right) + \frac{t}{z} \cdot \frac{\frac{1}{y}}{3}\\
\mathbf{else}:\\
\;\;\;\;\left(x - {\left(3 \cdot \frac{z}{y}\right)}^{-1}\right) + \frac{t}{y \cdot \left(z \cdot 3\right)}\\
\end{array}
\end{array}
if t < 3.00000000000000029e42Initial program 94.0%
sub-neg94.0%
distribute-frac-neg94.0%
neg-mul-194.0%
*-commutative94.0%
times-frac93.9%
metadata-eval93.9%
associate-/l/97.0%
associate-/l/96.9%
Simplified96.9%
associate-/l/97.0%
div-inv96.9%
times-frac98.8%
Applied egg-rr98.8%
if 3.00000000000000029e42 < t Initial program 98.0%
clear-num98.0%
inv-pow98.0%
*-commutative98.0%
*-un-lft-identity98.0%
times-frac98.0%
metadata-eval98.0%
Applied egg-rr98.0%
Final simplification98.6%
(FPCore (x y z t) :precision binary64 (if (<= t 20000000.0) (+ (+ x (* -0.3333333333333333 (/ y z))) (* (/ t z) (/ (/ 1.0 y) 3.0))) (+ (/ t (* y (* z 3.0))) (- x (/ y (* z 3.0))))))
double code(double x, double y, double z, double t) {
double tmp;
if (t <= 20000000.0) {
tmp = (x + (-0.3333333333333333 * (y / z))) + ((t / z) * ((1.0 / y) / 3.0));
} else {
tmp = (t / (y * (z * 3.0))) + (x - (y / (z * 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) :: tmp
if (t <= 20000000.0d0) then
tmp = (x + ((-0.3333333333333333d0) * (y / z))) + ((t / z) * ((1.0d0 / y) / 3.0d0))
else
tmp = (t / (y * (z * 3.0d0))) + (x - (y / (z * 3.0d0)))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (t <= 20000000.0) {
tmp = (x + (-0.3333333333333333 * (y / z))) + ((t / z) * ((1.0 / y) / 3.0));
} else {
tmp = (t / (y * (z * 3.0))) + (x - (y / (z * 3.0)));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if t <= 20000000.0: tmp = (x + (-0.3333333333333333 * (y / z))) + ((t / z) * ((1.0 / y) / 3.0)) else: tmp = (t / (y * (z * 3.0))) + (x - (y / (z * 3.0))) return tmp
function code(x, y, z, t) tmp = 0.0 if (t <= 20000000.0) tmp = Float64(Float64(x + Float64(-0.3333333333333333 * Float64(y / z))) + Float64(Float64(t / z) * Float64(Float64(1.0 / y) / 3.0))); else tmp = Float64(Float64(t / Float64(y * Float64(z * 3.0))) + Float64(x - Float64(y / Float64(z * 3.0)))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (t <= 20000000.0) tmp = (x + (-0.3333333333333333 * (y / z))) + ((t / z) * ((1.0 / y) / 3.0)); else tmp = (t / (y * (z * 3.0))) + (x - (y / (z * 3.0))); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[t, 20000000.0], N[(N[(x + N[(-0.3333333333333333 * N[(y / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(t / z), $MachinePrecision] * N[(N[(1.0 / y), $MachinePrecision] / 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(t / N[(y * N[(z * 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(x - N[(y / N[(z * 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq 20000000:\\
\;\;\;\;\left(x + -0.3333333333333333 \cdot \frac{y}{z}\right) + \frac{t}{z} \cdot \frac{\frac{1}{y}}{3}\\
\mathbf{else}:\\
\;\;\;\;\frac{t}{y \cdot \left(z \cdot 3\right)} + \left(x - \frac{y}{z \cdot 3}\right)\\
\end{array}
\end{array}
if t < 2e7Initial program 93.8%
sub-neg93.8%
distribute-frac-neg93.8%
neg-mul-193.8%
*-commutative93.8%
times-frac93.8%
metadata-eval93.8%
associate-/l/96.9%
associate-/l/96.9%
Simplified96.9%
associate-/l/96.9%
div-inv96.8%
times-frac98.8%
Applied egg-rr98.8%
if 2e7 < t Initial program 98.1%
Final simplification98.6%
(FPCore (x y z t)
:precision binary64
(if (<= (* z 3.0) -1e-24)
(+ x (* y (/ -0.3333333333333333 z)))
(if (<= (* z 3.0) 1e+53)
(* (- y (/ t y)) (/ -0.3333333333333333 z))
(- x (* (/ y z) 0.3333333333333333)))))
double code(double x, double y, double z, double t) {
double tmp;
if ((z * 3.0) <= -1e-24) {
tmp = x + (y * (-0.3333333333333333 / z));
} else if ((z * 3.0) <= 1e+53) {
tmp = (y - (t / y)) * (-0.3333333333333333 / z);
} else {
tmp = x - ((y / z) * 0.3333333333333333);
}
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-24)) then
tmp = x + (y * ((-0.3333333333333333d0) / z))
else if ((z * 3.0d0) <= 1d+53) then
tmp = (y - (t / y)) * ((-0.3333333333333333d0) / z)
else
tmp = x - ((y / z) * 0.3333333333333333d0)
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-24) {
tmp = x + (y * (-0.3333333333333333 / z));
} else if ((z * 3.0) <= 1e+53) {
tmp = (y - (t / y)) * (-0.3333333333333333 / z);
} else {
tmp = x - ((y / z) * 0.3333333333333333);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (z * 3.0) <= -1e-24: tmp = x + (y * (-0.3333333333333333 / z)) elif (z * 3.0) <= 1e+53: tmp = (y - (t / y)) * (-0.3333333333333333 / z) else: tmp = x - ((y / z) * 0.3333333333333333) return tmp
function code(x, y, z, t) tmp = 0.0 if (Float64(z * 3.0) <= -1e-24) tmp = Float64(x + Float64(y * Float64(-0.3333333333333333 / z))); elseif (Float64(z * 3.0) <= 1e+53) tmp = Float64(Float64(y - Float64(t / y)) * Float64(-0.3333333333333333 / z)); else tmp = Float64(x - Float64(Float64(y / z) * 0.3333333333333333)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((z * 3.0) <= -1e-24) tmp = x + (y * (-0.3333333333333333 / z)); elseif ((z * 3.0) <= 1e+53) tmp = (y - (t / y)) * (-0.3333333333333333 / z); else tmp = x - ((y / z) * 0.3333333333333333); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[N[(z * 3.0), $MachinePrecision], -1e-24], N[(x + N[(y * N[(-0.3333333333333333 / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(z * 3.0), $MachinePrecision], 1e+53], N[(N[(y - N[(t / y), $MachinePrecision]), $MachinePrecision] * N[(-0.3333333333333333 / z), $MachinePrecision]), $MachinePrecision], N[(x - N[(N[(y / z), $MachinePrecision] * 0.3333333333333333), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \cdot 3 \leq -1 \cdot 10^{-24}:\\
\;\;\;\;x + y \cdot \frac{-0.3333333333333333}{z}\\
\mathbf{elif}\;z \cdot 3 \leq 10^{+53}:\\
\;\;\;\;\left(y - \frac{t}{y}\right) \cdot \frac{-0.3333333333333333}{z}\\
\mathbf{else}:\\
\;\;\;\;x - \frac{y}{z} \cdot 0.3333333333333333\\
\end{array}
\end{array}
if (*.f64 z 3) < -9.99999999999999924e-25Initial program 99.8%
Simplified89.6%
Taylor expanded in y around inf 78.0%
if -9.99999999999999924e-25 < (*.f64 z 3) < 9.9999999999999999e52Initial program 91.2%
sub-neg91.2%
distribute-frac-neg91.2%
neg-mul-191.2%
*-commutative91.2%
times-frac91.2%
metadata-eval91.2%
associate-/l/98.5%
associate-/l/98.5%
Simplified98.5%
associate-/l/98.5%
div-inv98.5%
times-frac91.9%
Applied egg-rr91.9%
Taylor expanded in x around 0 83.9%
*-commutative83.9%
associate-*l/83.8%
associate-*r/83.9%
associate-*r/83.8%
*-commutative83.8%
times-frac88.0%
metadata-eval88.0%
distribute-neg-frac88.0%
distribute-rgt-neg-in88.0%
distribute-lft-neg-in88.0%
distribute-neg-frac88.0%
*-rgt-identity88.0%
associate-*r/88.0%
distribute-lft-neg-out88.0%
distribute-rgt-neg-out88.0%
distribute-rgt-in88.7%
*-commutative88.7%
cancel-sign-sub-inv88.7%
associate-*l/88.7%
*-lft-identity88.7%
*-commutative88.7%
Simplified88.7%
if 9.9999999999999999e52 < (*.f64 z 3) Initial program 99.7%
Taylor expanded in t around 0 77.9%
Final simplification84.2%
(FPCore (x y z t) :precision binary64 (if (or (<= y -1.05e-90) (not (<= y 1.32e-122))) (+ x (* -0.3333333333333333 (/ (- y (/ t y)) z))) (+ x (* 0.3333333333333333 (/ (/ t z) y)))))
double code(double x, double y, double z, double t) {
double tmp;
if ((y <= -1.05e-90) || !(y <= 1.32e-122)) {
tmp = x + (-0.3333333333333333 * ((y - (t / y)) / z));
} else {
tmp = x + (0.3333333333333333 * ((t / z) / y));
}
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 <= (-1.05d-90)) .or. (.not. (y <= 1.32d-122))) then
tmp = x + ((-0.3333333333333333d0) * ((y - (t / y)) / z))
else
tmp = x + (0.3333333333333333d0 * ((t / z) / y))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((y <= -1.05e-90) || !(y <= 1.32e-122)) {
tmp = x + (-0.3333333333333333 * ((y - (t / y)) / z));
} else {
tmp = x + (0.3333333333333333 * ((t / z) / y));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (y <= -1.05e-90) or not (y <= 1.32e-122): tmp = x + (-0.3333333333333333 * ((y - (t / y)) / z)) else: tmp = x + (0.3333333333333333 * ((t / z) / y)) return tmp
function code(x, y, z, t) tmp = 0.0 if ((y <= -1.05e-90) || !(y <= 1.32e-122)) tmp = Float64(x + Float64(-0.3333333333333333 * Float64(Float64(y - Float64(t / y)) / z))); else tmp = Float64(x + Float64(0.3333333333333333 * Float64(Float64(t / z) / y))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((y <= -1.05e-90) || ~((y <= 1.32e-122))) tmp = x + (-0.3333333333333333 * ((y - (t / y)) / z)); else tmp = x + (0.3333333333333333 * ((t / z) / y)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[y, -1.05e-90], N[Not[LessEqual[y, 1.32e-122]], $MachinePrecision]], N[(x + N[(-0.3333333333333333 * N[(N[(y - N[(t / y), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(0.3333333333333333 * N[(N[(t / z), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.05 \cdot 10^{-90} \lor \neg \left(y \leq 1.32 \cdot 10^{-122}\right):\\
\;\;\;\;x + -0.3333333333333333 \cdot \frac{y - \frac{t}{y}}{z}\\
\mathbf{else}:\\
\;\;\;\;x + 0.3333333333333333 \cdot \frac{\frac{t}{z}}{y}\\
\end{array}
\end{array}
if y < -1.05e-90 or 1.3200000000000001e-122 < y Initial program 98.6%
Simplified99.7%
Taylor expanded in z around 0 99.7%
if -1.05e-90 < y < 1.3200000000000001e-122Initial program 87.7%
sub-neg87.7%
distribute-frac-neg87.7%
neg-mul-187.7%
*-commutative87.7%
times-frac87.7%
metadata-eval87.7%
associate-/l/85.9%
associate-/l/86.0%
Simplified86.0%
Taylor expanded in y around 0 86.7%
expm1-log1p-u41.7%
expm1-udef39.5%
*-commutative39.5%
Applied egg-rr39.5%
expm1-def41.7%
expm1-log1p86.7%
associate-/r*98.8%
Simplified98.8%
Final simplification99.4%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (- y (/ t y))))
(if (<= y -1e-90)
(+ x (* t_1 (/ -0.3333333333333333 z)))
(if (<= y 1e-127)
(+ x (* 0.3333333333333333 (/ (/ t z) y)))
(+ x (* -0.3333333333333333 (/ t_1 z)))))))
double code(double x, double y, double z, double t) {
double t_1 = y - (t / y);
double tmp;
if (y <= -1e-90) {
tmp = x + (t_1 * (-0.3333333333333333 / z));
} else if (y <= 1e-127) {
tmp = x + (0.3333333333333333 * ((t / z) / y));
} else {
tmp = x + (-0.3333333333333333 * (t_1 / 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) :: t_1
real(8) :: tmp
t_1 = y - (t / y)
if (y <= (-1d-90)) then
tmp = x + (t_1 * ((-0.3333333333333333d0) / z))
else if (y <= 1d-127) then
tmp = x + (0.3333333333333333d0 * ((t / z) / y))
else
tmp = x + ((-0.3333333333333333d0) * (t_1 / z))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = y - (t / y);
double tmp;
if (y <= -1e-90) {
tmp = x + (t_1 * (-0.3333333333333333 / z));
} else if (y <= 1e-127) {
tmp = x + (0.3333333333333333 * ((t / z) / y));
} else {
tmp = x + (-0.3333333333333333 * (t_1 / z));
}
return tmp;
}
def code(x, y, z, t): t_1 = y - (t / y) tmp = 0 if y <= -1e-90: tmp = x + (t_1 * (-0.3333333333333333 / z)) elif y <= 1e-127: tmp = x + (0.3333333333333333 * ((t / z) / y)) else: tmp = x + (-0.3333333333333333 * (t_1 / z)) return tmp
function code(x, y, z, t) t_1 = Float64(y - Float64(t / y)) tmp = 0.0 if (y <= -1e-90) tmp = Float64(x + Float64(t_1 * Float64(-0.3333333333333333 / z))); elseif (y <= 1e-127) tmp = Float64(x + Float64(0.3333333333333333 * Float64(Float64(t / z) / y))); else tmp = Float64(x + Float64(-0.3333333333333333 * Float64(t_1 / z))); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = y - (t / y); tmp = 0.0; if (y <= -1e-90) tmp = x + (t_1 * (-0.3333333333333333 / z)); elseif (y <= 1e-127) tmp = x + (0.3333333333333333 * ((t / z) / y)); else tmp = x + (-0.3333333333333333 * (t_1 / z)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(y - N[(t / y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -1e-90], N[(x + N[(t$95$1 * N[(-0.3333333333333333 / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1e-127], N[(x + N[(0.3333333333333333 * N[(N[(t / z), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(-0.3333333333333333 * N[(t$95$1 / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := y - \frac{t}{y}\\
\mathbf{if}\;y \leq -1 \cdot 10^{-90}:\\
\;\;\;\;x + t_1 \cdot \frac{-0.3333333333333333}{z}\\
\mathbf{elif}\;y \leq 10^{-127}:\\
\;\;\;\;x + 0.3333333333333333 \cdot \frac{\frac{t}{z}}{y}\\
\mathbf{else}:\\
\;\;\;\;x + -0.3333333333333333 \cdot \frac{t_1}{z}\\
\end{array}
\end{array}
if y < -9.99999999999999995e-91Initial program 97.3%
Simplified99.8%
if -9.99999999999999995e-91 < y < 1e-127Initial program 87.7%
sub-neg87.7%
distribute-frac-neg87.7%
neg-mul-187.7%
*-commutative87.7%
times-frac87.7%
metadata-eval87.7%
associate-/l/85.9%
associate-/l/86.0%
Simplified86.0%
Taylor expanded in y around 0 86.7%
expm1-log1p-u41.7%
expm1-udef39.5%
*-commutative39.5%
Applied egg-rr39.5%
expm1-def41.7%
expm1-log1p86.7%
associate-/r*98.8%
Simplified98.8%
if 1e-127 < y Initial program 99.9%
Simplified99.7%
Taylor expanded in z around 0 99.7%
Final simplification99.4%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (- y (/ t y))))
(if (<= y -9.8e-91)
(+ x (* t_1 (/ -0.3333333333333333 z)))
(if (<= y 1.92e-44)
(+ x (* 0.3333333333333333 (/ (/ t z) y)))
(+ x (/ -0.3333333333333333 (/ z t_1)))))))
double code(double x, double y, double z, double t) {
double t_1 = y - (t / y);
double tmp;
if (y <= -9.8e-91) {
tmp = x + (t_1 * (-0.3333333333333333 / z));
} else if (y <= 1.92e-44) {
tmp = x + (0.3333333333333333 * ((t / z) / y));
} else {
tmp = x + (-0.3333333333333333 / (z / 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 = y - (t / y)
if (y <= (-9.8d-91)) then
tmp = x + (t_1 * ((-0.3333333333333333d0) / z))
else if (y <= 1.92d-44) then
tmp = x + (0.3333333333333333d0 * ((t / z) / y))
else
tmp = x + ((-0.3333333333333333d0) / (z / t_1))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = y - (t / y);
double tmp;
if (y <= -9.8e-91) {
tmp = x + (t_1 * (-0.3333333333333333 / z));
} else if (y <= 1.92e-44) {
tmp = x + (0.3333333333333333 * ((t / z) / y));
} else {
tmp = x + (-0.3333333333333333 / (z / t_1));
}
return tmp;
}
def code(x, y, z, t): t_1 = y - (t / y) tmp = 0 if y <= -9.8e-91: tmp = x + (t_1 * (-0.3333333333333333 / z)) elif y <= 1.92e-44: tmp = x + (0.3333333333333333 * ((t / z) / y)) else: tmp = x + (-0.3333333333333333 / (z / t_1)) return tmp
function code(x, y, z, t) t_1 = Float64(y - Float64(t / y)) tmp = 0.0 if (y <= -9.8e-91) tmp = Float64(x + Float64(t_1 * Float64(-0.3333333333333333 / z))); elseif (y <= 1.92e-44) tmp = Float64(x + Float64(0.3333333333333333 * Float64(Float64(t / z) / y))); else tmp = Float64(x + Float64(-0.3333333333333333 / Float64(z / t_1))); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = y - (t / y); tmp = 0.0; if (y <= -9.8e-91) tmp = x + (t_1 * (-0.3333333333333333 / z)); elseif (y <= 1.92e-44) tmp = x + (0.3333333333333333 * ((t / z) / y)); else tmp = x + (-0.3333333333333333 / (z / t_1)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(y - N[(t / y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -9.8e-91], N[(x + N[(t$95$1 * N[(-0.3333333333333333 / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.92e-44], N[(x + N[(0.3333333333333333 * N[(N[(t / z), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(-0.3333333333333333 / N[(z / t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := y - \frac{t}{y}\\
\mathbf{if}\;y \leq -9.8 \cdot 10^{-91}:\\
\;\;\;\;x + t_1 \cdot \frac{-0.3333333333333333}{z}\\
\mathbf{elif}\;y \leq 1.92 \cdot 10^{-44}:\\
\;\;\;\;x + 0.3333333333333333 \cdot \frac{\frac{t}{z}}{y}\\
\mathbf{else}:\\
\;\;\;\;x + \frac{-0.3333333333333333}{\frac{z}{t_1}}\\
\end{array}
\end{array}
if y < -9.7999999999999996e-91Initial program 97.3%
Simplified99.8%
if -9.7999999999999996e-91 < y < 1.91999999999999992e-44Initial program 89.1%
sub-neg89.1%
distribute-frac-neg89.1%
neg-mul-189.1%
*-commutative89.1%
times-frac89.1%
metadata-eval89.1%
associate-/l/87.5%
associate-/l/87.5%
Simplified87.5%
Taylor expanded in y around 0 88.1%
expm1-log1p-u44.1%
expm1-udef41.2%
*-commutative41.2%
Applied egg-rr41.2%
expm1-def44.1%
expm1-log1p88.1%
associate-/r*98.9%
Simplified98.9%
if 1.91999999999999992e-44 < y Initial program 99.9%
Simplified99.7%
Taylor expanded in z around 0 99.7%
clear-num99.7%
un-div-inv99.8%
Applied egg-rr99.8%
Final simplification99.4%
(FPCore (x y z t)
:precision binary64
(if (<= y -2.1e-29)
(- x (* (/ y z) 0.3333333333333333))
(if (<= y 1.1e-39)
(+ x (* (/ t y) (/ 0.3333333333333333 z)))
(+ x (/ -0.3333333333333333 (/ z y))))))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -2.1e-29) {
tmp = x - ((y / z) * 0.3333333333333333);
} else if (y <= 1.1e-39) {
tmp = x + ((t / y) * (0.3333333333333333 / z));
} else {
tmp = x + (-0.3333333333333333 / (z / y));
}
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.1d-29)) then
tmp = x - ((y / z) * 0.3333333333333333d0)
else if (y <= 1.1d-39) then
tmp = x + ((t / y) * (0.3333333333333333d0 / z))
else
tmp = x + ((-0.3333333333333333d0) / (z / y))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (y <= -2.1e-29) {
tmp = x - ((y / z) * 0.3333333333333333);
} else if (y <= 1.1e-39) {
tmp = x + ((t / y) * (0.3333333333333333 / z));
} else {
tmp = x + (-0.3333333333333333 / (z / y));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= -2.1e-29: tmp = x - ((y / z) * 0.3333333333333333) elif y <= 1.1e-39: tmp = x + ((t / y) * (0.3333333333333333 / z)) else: tmp = x + (-0.3333333333333333 / (z / y)) return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= -2.1e-29) tmp = Float64(x - Float64(Float64(y / z) * 0.3333333333333333)); elseif (y <= 1.1e-39) tmp = Float64(x + Float64(Float64(t / y) * Float64(0.3333333333333333 / z))); else tmp = Float64(x + Float64(-0.3333333333333333 / Float64(z / y))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (y <= -2.1e-29) tmp = x - ((y / z) * 0.3333333333333333); elseif (y <= 1.1e-39) tmp = x + ((t / y) * (0.3333333333333333 / z)); else tmp = x + (-0.3333333333333333 / (z / y)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, -2.1e-29], N[(x - N[(N[(y / z), $MachinePrecision] * 0.3333333333333333), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.1e-39], N[(x + N[(N[(t / y), $MachinePrecision] * N[(0.3333333333333333 / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(-0.3333333333333333 / N[(z / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -2.1 \cdot 10^{-29}:\\
\;\;\;\;x - \frac{y}{z} \cdot 0.3333333333333333\\
\mathbf{elif}\;y \leq 1.1 \cdot 10^{-39}:\\
\;\;\;\;x + \frac{t}{y} \cdot \frac{0.3333333333333333}{z}\\
\mathbf{else}:\\
\;\;\;\;x + \frac{-0.3333333333333333}{\frac{z}{y}}\\
\end{array}
\end{array}
if y < -2.09999999999999989e-29Initial program 98.3%
Taylor expanded in t around 0 87.7%
if -2.09999999999999989e-29 < y < 1.1e-39Initial program 89.8%
Simplified89.2%
Taylor expanded in y around 0 86.6%
associate-/r*85.2%
associate-*r/85.2%
*-commutative85.2%
associate-*r/85.2%
Simplified85.2%
if 1.1e-39 < y Initial program 99.9%
Simplified99.7%
Taylor expanded in z around 0 99.7%
clear-num99.7%
un-div-inv99.8%
Applied egg-rr99.8%
Taylor expanded in y around inf 88.4%
Final simplification86.7%
(FPCore (x y z t)
:precision binary64
(if (<= y -2.4e-29)
(- x (* (/ y z) 0.3333333333333333))
(if (<= y 1.15e-39)
(+ x (* (/ t y) (/ 0.3333333333333333 z)))
(+ x (/ 1.0 (/ z (* -0.3333333333333333 y)))))))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -2.4e-29) {
tmp = x - ((y / z) * 0.3333333333333333);
} else if (y <= 1.15e-39) {
tmp = x + ((t / y) * (0.3333333333333333 / z));
} else {
tmp = x + (1.0 / (z / (-0.3333333333333333 * y)));
}
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-29)) then
tmp = x - ((y / z) * 0.3333333333333333d0)
else if (y <= 1.15d-39) then
tmp = x + ((t / y) * (0.3333333333333333d0 / z))
else
tmp = x + (1.0d0 / (z / ((-0.3333333333333333d0) * y)))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (y <= -2.4e-29) {
tmp = x - ((y / z) * 0.3333333333333333);
} else if (y <= 1.15e-39) {
tmp = x + ((t / y) * (0.3333333333333333 / z));
} else {
tmp = x + (1.0 / (z / (-0.3333333333333333 * y)));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= -2.4e-29: tmp = x - ((y / z) * 0.3333333333333333) elif y <= 1.15e-39: tmp = x + ((t / y) * (0.3333333333333333 / z)) else: tmp = x + (1.0 / (z / (-0.3333333333333333 * y))) return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= -2.4e-29) tmp = Float64(x - Float64(Float64(y / z) * 0.3333333333333333)); elseif (y <= 1.15e-39) tmp = Float64(x + Float64(Float64(t / y) * Float64(0.3333333333333333 / z))); else tmp = Float64(x + Float64(1.0 / Float64(z / Float64(-0.3333333333333333 * y)))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (y <= -2.4e-29) tmp = x - ((y / z) * 0.3333333333333333); elseif (y <= 1.15e-39) tmp = x + ((t / y) * (0.3333333333333333 / z)); else tmp = x + (1.0 / (z / (-0.3333333333333333 * y))); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, -2.4e-29], N[(x - N[(N[(y / z), $MachinePrecision] * 0.3333333333333333), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.15e-39], N[(x + N[(N[(t / y), $MachinePrecision] * N[(0.3333333333333333 / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(1.0 / N[(z / N[(-0.3333333333333333 * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -2.4 \cdot 10^{-29}:\\
\;\;\;\;x - \frac{y}{z} \cdot 0.3333333333333333\\
\mathbf{elif}\;y \leq 1.15 \cdot 10^{-39}:\\
\;\;\;\;x + \frac{t}{y} \cdot \frac{0.3333333333333333}{z}\\
\mathbf{else}:\\
\;\;\;\;x + \frac{1}{\frac{z}{-0.3333333333333333 \cdot y}}\\
\end{array}
\end{array}
if y < -2.39999999999999992e-29Initial program 98.3%
Taylor expanded in t around 0 87.7%
if -2.39999999999999992e-29 < y < 1.15000000000000004e-39Initial program 89.8%
Simplified89.2%
Taylor expanded in y around 0 86.6%
associate-/r*85.2%
associate-*r/85.2%
*-commutative85.2%
associate-*r/85.2%
Simplified85.2%
if 1.15000000000000004e-39 < y Initial program 99.9%
Simplified99.7%
Taylor expanded in y around inf 88.4%
associate-*l/88.4%
clear-num88.5%
Applied egg-rr88.5%
Final simplification86.7%
(FPCore (x y z t)
:precision binary64
(if (<= y -2.3e-29)
(- x (* (/ y z) 0.3333333333333333))
(if (<= y 1.05e-39)
(+ x (/ t (* y (/ z 0.3333333333333333))))
(+ x (/ 1.0 (/ z (* -0.3333333333333333 y)))))))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -2.3e-29) {
tmp = x - ((y / z) * 0.3333333333333333);
} else if (y <= 1.05e-39) {
tmp = x + (t / (y * (z / 0.3333333333333333)));
} else {
tmp = x + (1.0 / (z / (-0.3333333333333333 * y)));
}
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.3d-29)) then
tmp = x - ((y / z) * 0.3333333333333333d0)
else if (y <= 1.05d-39) then
tmp = x + (t / (y * (z / 0.3333333333333333d0)))
else
tmp = x + (1.0d0 / (z / ((-0.3333333333333333d0) * y)))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (y <= -2.3e-29) {
tmp = x - ((y / z) * 0.3333333333333333);
} else if (y <= 1.05e-39) {
tmp = x + (t / (y * (z / 0.3333333333333333)));
} else {
tmp = x + (1.0 / (z / (-0.3333333333333333 * y)));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= -2.3e-29: tmp = x - ((y / z) * 0.3333333333333333) elif y <= 1.05e-39: tmp = x + (t / (y * (z / 0.3333333333333333))) else: tmp = x + (1.0 / (z / (-0.3333333333333333 * y))) return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= -2.3e-29) tmp = Float64(x - Float64(Float64(y / z) * 0.3333333333333333)); elseif (y <= 1.05e-39) tmp = Float64(x + Float64(t / Float64(y * Float64(z / 0.3333333333333333)))); else tmp = Float64(x + Float64(1.0 / Float64(z / Float64(-0.3333333333333333 * y)))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (y <= -2.3e-29) tmp = x - ((y / z) * 0.3333333333333333); elseif (y <= 1.05e-39) tmp = x + (t / (y * (z / 0.3333333333333333))); else tmp = x + (1.0 / (z / (-0.3333333333333333 * y))); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, -2.3e-29], N[(x - N[(N[(y / z), $MachinePrecision] * 0.3333333333333333), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.05e-39], N[(x + N[(t / N[(y * N[(z / 0.3333333333333333), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(1.0 / N[(z / N[(-0.3333333333333333 * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -2.3 \cdot 10^{-29}:\\
\;\;\;\;x - \frac{y}{z} \cdot 0.3333333333333333\\
\mathbf{elif}\;y \leq 1.05 \cdot 10^{-39}:\\
\;\;\;\;x + \frac{t}{y \cdot \frac{z}{0.3333333333333333}}\\
\mathbf{else}:\\
\;\;\;\;x + \frac{1}{\frac{z}{-0.3333333333333333 \cdot y}}\\
\end{array}
\end{array}
if y < -2.29999999999999991e-29Initial program 98.3%
Taylor expanded in t around 0 87.7%
if -2.29999999999999991e-29 < y < 1.04999999999999997e-39Initial program 89.8%
Simplified89.2%
Taylor expanded in z around 0 89.2%
clear-num89.2%
un-div-inv89.2%
Applied egg-rr89.2%
Taylor expanded in y around 0 86.6%
associate-*r/86.5%
*-commutative86.5%
associate-/l/95.7%
associate-/l*95.8%
associate-/l/86.6%
Simplified86.6%
if 1.04999999999999997e-39 < y Initial program 99.9%
Simplified99.7%
Taylor expanded in y around inf 88.4%
associate-*l/88.4%
clear-num88.5%
Applied egg-rr88.5%
Final simplification87.4%
(FPCore (x y z t)
:precision binary64
(if (<= y -2.4e-29)
(- x (* (/ y z) 0.3333333333333333))
(if (<= y 1.05e-39)
(+ x (* 0.3333333333333333 (/ t (* y z))))
(+ x (/ 1.0 (/ z (* -0.3333333333333333 y)))))))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -2.4e-29) {
tmp = x - ((y / z) * 0.3333333333333333);
} else if (y <= 1.05e-39) {
tmp = x + (0.3333333333333333 * (t / (y * z)));
} else {
tmp = x + (1.0 / (z / (-0.3333333333333333 * y)));
}
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-29)) then
tmp = x - ((y / z) * 0.3333333333333333d0)
else if (y <= 1.05d-39) then
tmp = x + (0.3333333333333333d0 * (t / (y * z)))
else
tmp = x + (1.0d0 / (z / ((-0.3333333333333333d0) * y)))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (y <= -2.4e-29) {
tmp = x - ((y / z) * 0.3333333333333333);
} else if (y <= 1.05e-39) {
tmp = x + (0.3333333333333333 * (t / (y * z)));
} else {
tmp = x + (1.0 / (z / (-0.3333333333333333 * y)));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= -2.4e-29: tmp = x - ((y / z) * 0.3333333333333333) elif y <= 1.05e-39: tmp = x + (0.3333333333333333 * (t / (y * z))) else: tmp = x + (1.0 / (z / (-0.3333333333333333 * y))) return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= -2.4e-29) tmp = Float64(x - Float64(Float64(y / z) * 0.3333333333333333)); elseif (y <= 1.05e-39) tmp = Float64(x + Float64(0.3333333333333333 * Float64(t / Float64(y * z)))); else tmp = Float64(x + Float64(1.0 / Float64(z / Float64(-0.3333333333333333 * y)))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (y <= -2.4e-29) tmp = x - ((y / z) * 0.3333333333333333); elseif (y <= 1.05e-39) tmp = x + (0.3333333333333333 * (t / (y * z))); else tmp = x + (1.0 / (z / (-0.3333333333333333 * y))); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, -2.4e-29], N[(x - N[(N[(y / z), $MachinePrecision] * 0.3333333333333333), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.05e-39], N[(x + N[(0.3333333333333333 * N[(t / N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(1.0 / N[(z / N[(-0.3333333333333333 * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -2.4 \cdot 10^{-29}:\\
\;\;\;\;x - \frac{y}{z} \cdot 0.3333333333333333\\
\mathbf{elif}\;y \leq 1.05 \cdot 10^{-39}:\\
\;\;\;\;x + 0.3333333333333333 \cdot \frac{t}{y \cdot z}\\
\mathbf{else}:\\
\;\;\;\;x + \frac{1}{\frac{z}{-0.3333333333333333 \cdot y}}\\
\end{array}
\end{array}
if y < -2.39999999999999992e-29Initial program 98.3%
Taylor expanded in t around 0 87.7%
if -2.39999999999999992e-29 < y < 1.04999999999999997e-39Initial program 89.8%
sub-neg89.8%
distribute-frac-neg89.8%
neg-mul-189.8%
*-commutative89.8%
times-frac89.8%
metadata-eval89.8%
associate-/l/89.2%
associate-/l/89.2%
Simplified89.2%
Taylor expanded in y around 0 86.6%
if 1.04999999999999997e-39 < y Initial program 99.9%
Simplified99.7%
Taylor expanded in y around inf 88.4%
associate-*l/88.4%
clear-num88.5%
Applied egg-rr88.5%
Final simplification87.4%
(FPCore (x y z t)
:precision binary64
(if (<= y -2.2e-29)
(- x (* (/ y z) 0.3333333333333333))
(if (<= y 1.15e-39)
(+ x (* 0.3333333333333333 (/ (/ t z) y)))
(+ x (/ 1.0 (/ z (* -0.3333333333333333 y)))))))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -2.2e-29) {
tmp = x - ((y / z) * 0.3333333333333333);
} else if (y <= 1.15e-39) {
tmp = x + (0.3333333333333333 * ((t / z) / y));
} else {
tmp = x + (1.0 / (z / (-0.3333333333333333 * y)));
}
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.2d-29)) then
tmp = x - ((y / z) * 0.3333333333333333d0)
else if (y <= 1.15d-39) then
tmp = x + (0.3333333333333333d0 * ((t / z) / y))
else
tmp = x + (1.0d0 / (z / ((-0.3333333333333333d0) * y)))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (y <= -2.2e-29) {
tmp = x - ((y / z) * 0.3333333333333333);
} else if (y <= 1.15e-39) {
tmp = x + (0.3333333333333333 * ((t / z) / y));
} else {
tmp = x + (1.0 / (z / (-0.3333333333333333 * y)));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= -2.2e-29: tmp = x - ((y / z) * 0.3333333333333333) elif y <= 1.15e-39: tmp = x + (0.3333333333333333 * ((t / z) / y)) else: tmp = x + (1.0 / (z / (-0.3333333333333333 * y))) return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= -2.2e-29) tmp = Float64(x - Float64(Float64(y / z) * 0.3333333333333333)); elseif (y <= 1.15e-39) tmp = Float64(x + Float64(0.3333333333333333 * Float64(Float64(t / z) / y))); else tmp = Float64(x + Float64(1.0 / Float64(z / Float64(-0.3333333333333333 * y)))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (y <= -2.2e-29) tmp = x - ((y / z) * 0.3333333333333333); elseif (y <= 1.15e-39) tmp = x + (0.3333333333333333 * ((t / z) / y)); else tmp = x + (1.0 / (z / (-0.3333333333333333 * y))); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, -2.2e-29], N[(x - N[(N[(y / z), $MachinePrecision] * 0.3333333333333333), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.15e-39], N[(x + N[(0.3333333333333333 * N[(N[(t / z), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(1.0 / N[(z / N[(-0.3333333333333333 * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -2.2 \cdot 10^{-29}:\\
\;\;\;\;x - \frac{y}{z} \cdot 0.3333333333333333\\
\mathbf{elif}\;y \leq 1.15 \cdot 10^{-39}:\\
\;\;\;\;x + 0.3333333333333333 \cdot \frac{\frac{t}{z}}{y}\\
\mathbf{else}:\\
\;\;\;\;x + \frac{1}{\frac{z}{-0.3333333333333333 \cdot y}}\\
\end{array}
\end{array}
if y < -2.1999999999999999e-29Initial program 98.3%
Taylor expanded in t around 0 87.7%
if -2.1999999999999999e-29 < y < 1.15000000000000004e-39Initial program 89.8%
sub-neg89.8%
distribute-frac-neg89.8%
neg-mul-189.8%
*-commutative89.8%
times-frac89.8%
metadata-eval89.8%
associate-/l/89.2%
associate-/l/89.2%
Simplified89.2%
Taylor expanded in y around 0 86.6%
expm1-log1p-u46.1%
expm1-udef43.2%
*-commutative43.2%
Applied egg-rr43.2%
expm1-def46.1%
expm1-log1p86.6%
associate-/r*95.8%
Simplified95.8%
if 1.15000000000000004e-39 < y Initial program 99.9%
Simplified99.7%
Taylor expanded in y around inf 88.4%
associate-*l/88.4%
clear-num88.5%
Applied egg-rr88.5%
Final simplification91.6%
(FPCore (x y z t) :precision binary64 (if (<= x -7e+47) x (if (<= x 5.2e-37) (* -0.3333333333333333 (/ y z)) x)))
double code(double x, double y, double z, double t) {
double tmp;
if (x <= -7e+47) {
tmp = x;
} else if (x <= 5.2e-37) {
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 <= (-7d+47)) then
tmp = x
else if (x <= 5.2d-37) 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 <= -7e+47) {
tmp = x;
} else if (x <= 5.2e-37) {
tmp = -0.3333333333333333 * (y / z);
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if x <= -7e+47: tmp = x elif x <= 5.2e-37: tmp = -0.3333333333333333 * (y / z) else: tmp = x return tmp
function code(x, y, z, t) tmp = 0.0 if (x <= -7e+47) tmp = x; elseif (x <= 5.2e-37) 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 <= -7e+47) tmp = x; elseif (x <= 5.2e-37) tmp = -0.3333333333333333 * (y / z); else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[x, -7e+47], x, If[LessEqual[x, 5.2e-37], N[(-0.3333333333333333 * N[(y / z), $MachinePrecision]), $MachinePrecision], x]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -7 \cdot 10^{+47}:\\
\;\;\;\;x\\
\mathbf{elif}\;x \leq 5.2 \cdot 10^{-37}:\\
\;\;\;\;-0.3333333333333333 \cdot \frac{y}{z}\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if x < -7.00000000000000031e47 or 5.19999999999999959e-37 < x Initial program 93.4%
sub-neg93.4%
distribute-frac-neg93.4%
neg-mul-193.4%
*-commutative93.4%
times-frac93.3%
metadata-eval93.3%
associate-/l/93.3%
associate-/l/93.2%
Simplified93.2%
Taylor expanded in x around inf 51.3%
if -7.00000000000000031e47 < x < 5.19999999999999959e-37Initial program 96.4%
sub-neg96.4%
distribute-frac-neg96.4%
neg-mul-196.4%
*-commutative96.4%
times-frac96.4%
metadata-eval96.4%
associate-/l/95.9%
associate-/l/95.9%
Simplified95.9%
associate-/l/95.9%
div-inv95.9%
times-frac95.1%
Applied egg-rr95.1%
Taylor expanded in y around inf 53.5%
Final simplification52.4%
(FPCore (x y z t) :precision binary64 (if (<= x -7.6e+47) x (if (<= x 5.1e-37) (* y (/ -0.3333333333333333 z)) x)))
double code(double x, double y, double z, double t) {
double tmp;
if (x <= -7.6e+47) {
tmp = x;
} else if (x <= 5.1e-37) {
tmp = y * (-0.3333333333333333 / 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 <= (-7.6d+47)) then
tmp = x
else if (x <= 5.1d-37) then
tmp = y * ((-0.3333333333333333d0) / 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 <= -7.6e+47) {
tmp = x;
} else if (x <= 5.1e-37) {
tmp = y * (-0.3333333333333333 / z);
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if x <= -7.6e+47: tmp = x elif x <= 5.1e-37: tmp = y * (-0.3333333333333333 / z) else: tmp = x return tmp
function code(x, y, z, t) tmp = 0.0 if (x <= -7.6e+47) tmp = x; elseif (x <= 5.1e-37) tmp = Float64(y * Float64(-0.3333333333333333 / z)); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (x <= -7.6e+47) tmp = x; elseif (x <= 5.1e-37) tmp = y * (-0.3333333333333333 / z); else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[x, -7.6e+47], x, If[LessEqual[x, 5.1e-37], N[(y * N[(-0.3333333333333333 / z), $MachinePrecision]), $MachinePrecision], x]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -7.6 \cdot 10^{+47}:\\
\;\;\;\;x\\
\mathbf{elif}\;x \leq 5.1 \cdot 10^{-37}:\\
\;\;\;\;y \cdot \frac{-0.3333333333333333}{z}\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if x < -7.6000000000000007e47 or 5.1000000000000001e-37 < x Initial program 93.4%
sub-neg93.4%
distribute-frac-neg93.4%
neg-mul-193.4%
*-commutative93.4%
times-frac93.3%
metadata-eval93.3%
associate-/l/93.3%
associate-/l/93.2%
Simplified93.2%
Taylor expanded in x around inf 51.3%
if -7.6000000000000007e47 < x < 5.1000000000000001e-37Initial program 96.4%
sub-neg96.4%
distribute-frac-neg96.4%
neg-mul-196.4%
*-commutative96.4%
times-frac96.4%
metadata-eval96.4%
associate-/l/95.9%
associate-/l/95.9%
Simplified95.9%
associate-/l/95.9%
div-inv95.9%
times-frac95.1%
Applied egg-rr95.1%
Taylor expanded in y around inf 53.5%
*-commutative53.5%
associate-*l/53.4%
associate-*r/53.5%
Simplified53.5%
Final simplification52.4%
(FPCore (x y z t) :precision binary64 (+ x (* y (/ -0.3333333333333333 z))))
double code(double x, double y, double z, double t) {
return x + (y * (-0.3333333333333333 / 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 + (y * ((-0.3333333333333333d0) / z))
end function
public static double code(double x, double y, double z, double t) {
return x + (y * (-0.3333333333333333 / z));
}
def code(x, y, z, t): return x + (y * (-0.3333333333333333 / z))
function code(x, y, z, t) return Float64(x + Float64(y * Float64(-0.3333333333333333 / z))) end
function tmp = code(x, y, z, t) tmp = x + (y * (-0.3333333333333333 / z)); end
code[x_, y_, z_, t_] := N[(x + N[(y * N[(-0.3333333333333333 / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + y \cdot \frac{-0.3333333333333333}{z}
\end{array}
Initial program 94.8%
Simplified94.9%
Taylor expanded in y around inf 64.5%
Final simplification64.5%
(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 94.8%
sub-neg94.8%
distribute-frac-neg94.8%
neg-mul-194.8%
*-commutative94.8%
times-frac94.8%
metadata-eval94.8%
associate-/l/94.6%
associate-/l/94.5%
Simplified94.5%
Taylor expanded in x around inf 30.9%
Final simplification30.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 2023274
(FPCore (x y z t)
:name "Diagrams.Solve.Polynomial:cubForm from diagrams-solve-0.1, H"
:precision binary64
:herbie-target
(+ (- x (/ y (* z 3.0))) (/ (/ t (* z 3.0)) y))
(+ (- x (/ y (* z 3.0))) (/ t (* (* z 3.0) y))))