
(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-22) (not (<= (* z 3.0) 5e-49))) (+ (- x (/ y (* z 3.0))) (/ t (* 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-22) || !((z * 3.0) <= 5e-49)) {
tmp = (x - (y / (z * 3.0))) + (t / (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-22)) .or. (.not. ((z * 3.0d0) <= 5d-49))) then
tmp = (x - (y / (z * 3.0d0))) + (t / (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-22) || !((z * 3.0) <= 5e-49)) {
tmp = (x - (y / (z * 3.0))) + (t / (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-22) or not ((z * 3.0) <= 5e-49): tmp = (x - (y / (z * 3.0))) + (t / (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-22) || !(Float64(z * 3.0) <= 5e-49)) tmp = Float64(Float64(x - Float64(y / Float64(z * 3.0))) + Float64(t / Float64(y * Float64(z * 3.0)))); else tmp = Float64(x + Float64(Float64(-0.3333333333333333 / 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-22) || ~(((z * 3.0) <= 5e-49))) tmp = (x - (y / (z * 3.0))) + (t / (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-22], N[Not[LessEqual[N[(z * 3.0), $MachinePrecision], 5e-49]], $MachinePrecision]], N[(N[(x - N[(y / N[(z * 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(t / N[(y * N[(z * 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(N[(-0.3333333333333333 / z), $MachinePrecision] * N[(y - N[(t / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \cdot 3 \leq -1 \cdot 10^{-22} \lor \neg \left(z \cdot 3 \leq 5 \cdot 10^{-49}\right):\\
\;\;\;\;\left(x - \frac{y}{z \cdot 3}\right) + \frac{t}{y \cdot \left(z \cdot 3\right)}\\
\mathbf{else}:\\
\;\;\;\;x + \frac{-0.3333333333333333}{z} \cdot \left(y - \frac{t}{y}\right)\\
\end{array}
\end{array}
if (*.f64 z 3) < -1e-22 or 4.9999999999999999e-49 < (*.f64 z 3) Initial program 99.8%
if -1e-22 < (*.f64 z 3) < 4.9999999999999999e-49Initial program 86.3%
associate-+l-86.3%
sub-neg86.3%
sub-neg86.3%
distribute-neg-in86.3%
unsub-neg86.3%
neg-mul-186.3%
associate-*r/86.3%
associate-*l/86.3%
distribute-neg-frac86.3%
neg-mul-186.3%
times-frac97.9%
distribute-lft-out--99.8%
*-commutative99.8%
associate-/r*99.8%
metadata-eval99.8%
Simplified99.8%
Final simplification99.8%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (- x (/ y (* z 3.0)))))
(if (<= (+ t_1 (/ t (* y (* z 3.0)))) 5e+283)
(+ t_1 (/ (* 0.3333333333333333 (/ t z)) y))
(+ x (* (/ -0.3333333333333333 z) (- y (/ t y)))))))
double code(double x, double y, double z, double t) {
double t_1 = x - (y / (z * 3.0));
double tmp;
if ((t_1 + (t / (y * (z * 3.0)))) <= 5e+283) {
tmp = t_1 + ((0.3333333333333333 * (t / z)) / y);
} 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) :: t_1
real(8) :: tmp
t_1 = x - (y / (z * 3.0d0))
if ((t_1 + (t / (y * (z * 3.0d0)))) <= 5d+283) then
tmp = t_1 + ((0.3333333333333333d0 * (t / z)) / y)
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 t_1 = x - (y / (z * 3.0));
double tmp;
if ((t_1 + (t / (y * (z * 3.0)))) <= 5e+283) {
tmp = t_1 + ((0.3333333333333333 * (t / z)) / y);
} else {
tmp = x + ((-0.3333333333333333 / z) * (y - (t / y)));
}
return tmp;
}
def code(x, y, z, t): t_1 = x - (y / (z * 3.0)) tmp = 0 if (t_1 + (t / (y * (z * 3.0)))) <= 5e+283: tmp = t_1 + ((0.3333333333333333 * (t / z)) / y) else: tmp = x + ((-0.3333333333333333 / z) * (y - (t / y))) return tmp
function code(x, y, z, t) t_1 = Float64(x - Float64(y / Float64(z * 3.0))) tmp = 0.0 if (Float64(t_1 + Float64(t / Float64(y * Float64(z * 3.0)))) <= 5e+283) tmp = Float64(t_1 + Float64(Float64(0.3333333333333333 * Float64(t / z)) / y)); else tmp = Float64(x + Float64(Float64(-0.3333333333333333 / z) * Float64(y - Float64(t / y)))); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = x - (y / (z * 3.0)); tmp = 0.0; if ((t_1 + (t / (y * (z * 3.0)))) <= 5e+283) tmp = t_1 + ((0.3333333333333333 * (t / z)) / y); else tmp = x + ((-0.3333333333333333 / z) * (y - (t / y))); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(x - N[(y / N[(z * 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(t$95$1 + N[(t / N[(y * N[(z * 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 5e+283], N[(t$95$1 + N[(N[(0.3333333333333333 * N[(t / z), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision], N[(x + N[(N[(-0.3333333333333333 / z), $MachinePrecision] * N[(y - N[(t / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x - \frac{y}{z \cdot 3}\\
\mathbf{if}\;t_1 + \frac{t}{y \cdot \left(z \cdot 3\right)} \leq 5 \cdot 10^{+283}:\\
\;\;\;\;t_1 + \frac{0.3333333333333333 \cdot \frac{t}{z}}{y}\\
\mathbf{else}:\\
\;\;\;\;x + \frac{-0.3333333333333333}{z} \cdot \left(y - \frac{t}{y}\right)\\
\end{array}
\end{array}
if (+.f64 (-.f64 x (/.f64 y (*.f64 z 3))) (/.f64 t (*.f64 (*.f64 z 3) y))) < 5.0000000000000004e283Initial program 97.2%
associate-/r*98.9%
Simplified98.9%
Taylor expanded in t around 0 98.9%
if 5.0000000000000004e283 < (+.f64 (-.f64 x (/.f64 y (*.f64 z 3))) (/.f64 t (*.f64 (*.f64 z 3) y))) Initial program 82.7%
associate-+l-82.7%
sub-neg82.7%
sub-neg82.7%
distribute-neg-in82.7%
unsub-neg82.7%
neg-mul-182.7%
associate-*r/82.7%
associate-*l/82.7%
distribute-neg-frac82.7%
neg-mul-182.7%
times-frac96.4%
distribute-lft-out--99.9%
*-commutative99.9%
associate-/r*99.9%
metadata-eval99.9%
Simplified99.9%
Final simplification99.1%
(FPCore (x y z t)
:precision binary64
(if (<= (* z 3.0) -1e+57)
(- x (/ y (* z 3.0)))
(if (<= (* z 3.0) 5e+71)
(* (/ 0.3333333333333333 z) (- (/ t y) y))
(- x (/ (/ y z) 3.0)))))
double code(double x, double y, double z, double t) {
double tmp;
if ((z * 3.0) <= -1e+57) {
tmp = x - (y / (z * 3.0));
} else if ((z * 3.0) <= 5e+71) {
tmp = (0.3333333333333333 / z) * ((t / y) - y);
} else {
tmp = 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 ((z * 3.0d0) <= (-1d+57)) then
tmp = x - (y / (z * 3.0d0))
else if ((z * 3.0d0) <= 5d+71) then
tmp = (0.3333333333333333d0 / z) * ((t / y) - y)
else
tmp = 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 ((z * 3.0) <= -1e+57) {
tmp = x - (y / (z * 3.0));
} else if ((z * 3.0) <= 5e+71) {
tmp = (0.3333333333333333 / z) * ((t / y) - y);
} else {
tmp = x - ((y / z) / 3.0);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (z * 3.0) <= -1e+57: tmp = x - (y / (z * 3.0)) elif (z * 3.0) <= 5e+71: tmp = (0.3333333333333333 / z) * ((t / y) - y) else: tmp = x - ((y / z) / 3.0) return tmp
function code(x, y, z, t) tmp = 0.0 if (Float64(z * 3.0) <= -1e+57) tmp = Float64(x - Float64(y / Float64(z * 3.0))); elseif (Float64(z * 3.0) <= 5e+71) tmp = Float64(Float64(0.3333333333333333 / z) * Float64(Float64(t / y) - y)); else tmp = Float64(x - Float64(Float64(y / z) / 3.0)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((z * 3.0) <= -1e+57) tmp = x - (y / (z * 3.0)); elseif ((z * 3.0) <= 5e+71) tmp = (0.3333333333333333 / z) * ((t / y) - y); else tmp = x - ((y / z) / 3.0); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[N[(z * 3.0), $MachinePrecision], -1e+57], N[(x - N[(y / N[(z * 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(z * 3.0), $MachinePrecision], 5e+71], N[(N[(0.3333333333333333 / z), $MachinePrecision] * N[(N[(t / y), $MachinePrecision] - y), $MachinePrecision]), $MachinePrecision], N[(x - N[(N[(y / z), $MachinePrecision] / 3.0), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \cdot 3 \leq -1 \cdot 10^{+57}:\\
\;\;\;\;x - \frac{y}{z \cdot 3}\\
\mathbf{elif}\;z \cdot 3 \leq 5 \cdot 10^{+71}:\\
\;\;\;\;\frac{0.3333333333333333}{z} \cdot \left(\frac{t}{y} - y\right)\\
\mathbf{else}:\\
\;\;\;\;x - \frac{\frac{y}{z}}{3}\\
\end{array}
\end{array}
if (*.f64 z 3) < -1.00000000000000005e57Initial program 99.8%
associate-/r*99.9%
Simplified99.9%
Taylor expanded in t around 0 83.8%
metadata-eval83.8%
times-frac83.9%
*-un-lft-identity83.9%
*-commutative83.9%
Applied egg-rr83.9%
if -1.00000000000000005e57 < (*.f64 z 3) < 4.99999999999999972e71Initial program 90.7%
associate-/r*95.6%
Simplified95.6%
Taylor expanded in t around 0 95.6%
Taylor expanded in x around 0 79.7%
distribute-lft-out--79.7%
associate-/r*85.3%
div-sub86.6%
associate-*r/87.2%
*-commutative87.2%
associate-*r/87.1%
Simplified87.1%
if 4.99999999999999972e71 < (*.f64 z 3) Initial program 99.7%
associate-/r*99.8%
Simplified99.8%
Taylor expanded in t around 0 79.5%
metadata-eval79.5%
times-frac79.5%
*-un-lft-identity79.5%
*-commutative79.5%
associate-/r*79.5%
Applied egg-rr79.5%
Final simplification85.1%
(FPCore (x y z t)
:precision binary64
(if (<= y -6e+121)
(/ (* y -0.3333333333333333) z)
(if (<= y -8.8e-19)
x
(if (<= y 9e-73)
(* (/ t y) (/ 0.3333333333333333 z))
(if (<= y 2.2e+63) x (* y (/ -0.3333333333333333 z)))))))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -6e+121) {
tmp = (y * -0.3333333333333333) / z;
} else if (y <= -8.8e-19) {
tmp = x;
} else if (y <= 9e-73) {
tmp = (t / y) * (0.3333333333333333 / z);
} else if (y <= 2.2e+63) {
tmp = x;
} else {
tmp = 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 (y <= (-6d+121)) then
tmp = (y * (-0.3333333333333333d0)) / z
else if (y <= (-8.8d-19)) then
tmp = x
else if (y <= 9d-73) then
tmp = (t / y) * (0.3333333333333333d0 / z)
else if (y <= 2.2d+63) then
tmp = x
else
tmp = 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 (y <= -6e+121) {
tmp = (y * -0.3333333333333333) / z;
} else if (y <= -8.8e-19) {
tmp = x;
} else if (y <= 9e-73) {
tmp = (t / y) * (0.3333333333333333 / z);
} else if (y <= 2.2e+63) {
tmp = x;
} else {
tmp = y * (-0.3333333333333333 / z);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= -6e+121: tmp = (y * -0.3333333333333333) / z elif y <= -8.8e-19: tmp = x elif y <= 9e-73: tmp = (t / y) * (0.3333333333333333 / z) elif y <= 2.2e+63: tmp = x else: tmp = y * (-0.3333333333333333 / z) return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= -6e+121) tmp = Float64(Float64(y * -0.3333333333333333) / z); elseif (y <= -8.8e-19) tmp = x; elseif (y <= 9e-73) tmp = Float64(Float64(t / y) * Float64(0.3333333333333333 / z)); elseif (y <= 2.2e+63) tmp = x; else tmp = Float64(y * Float64(-0.3333333333333333 / z)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (y <= -6e+121) tmp = (y * -0.3333333333333333) / z; elseif (y <= -8.8e-19) tmp = x; elseif (y <= 9e-73) tmp = (t / y) * (0.3333333333333333 / z); elseif (y <= 2.2e+63) tmp = x; else tmp = y * (-0.3333333333333333 / z); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, -6e+121], N[(N[(y * -0.3333333333333333), $MachinePrecision] / z), $MachinePrecision], If[LessEqual[y, -8.8e-19], x, If[LessEqual[y, 9e-73], N[(N[(t / y), $MachinePrecision] * N[(0.3333333333333333 / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 2.2e+63], x, N[(y * N[(-0.3333333333333333 / z), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -6 \cdot 10^{+121}:\\
\;\;\;\;\frac{y \cdot -0.3333333333333333}{z}\\
\mathbf{elif}\;y \leq -8.8 \cdot 10^{-19}:\\
\;\;\;\;x\\
\mathbf{elif}\;y \leq 9 \cdot 10^{-73}:\\
\;\;\;\;\frac{t}{y} \cdot \frac{0.3333333333333333}{z}\\
\mathbf{elif}\;y \leq 2.2 \cdot 10^{+63}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;y \cdot \frac{-0.3333333333333333}{z}\\
\end{array}
\end{array}
if y < -6.0000000000000005e121Initial program 94.3%
associate-/r*91.5%
Simplified91.5%
Taylor expanded in x around 0 74.2%
associate-/r*74.2%
associate-*r/74.2%
associate-*r/74.3%
div-sub79.9%
distribute-lft-out--79.9%
Simplified79.9%
Taylor expanded in t around 0 79.9%
*-commutative79.9%
Simplified79.9%
if -6.0000000000000005e121 < y < -8.7999999999999994e-19 or 9e-73 < y < 2.1999999999999999e63Initial program 98.0%
associate-/r*94.8%
Simplified94.8%
Taylor expanded in x around inf 51.9%
if -8.7999999999999994e-19 < y < 9e-73Initial program 89.9%
associate-/r*99.8%
Simplified99.8%
Taylor expanded in x around 0 64.0%
associate-/r*66.2%
associate-*r/66.9%
associate-*r/67.0%
div-sub67.0%
distribute-lft-out--67.0%
Simplified67.0%
Taylor expanded in t around inf 64.8%
associate-*r/64.7%
associate-/l*64.7%
Simplified64.7%
associate-/l/64.7%
metadata-eval64.7%
frac-times64.7%
clear-num64.7%
Applied egg-rr64.7%
if 2.1999999999999999e63 < y Initial program 99.8%
associate-/r*97.6%
Simplified97.6%
Taylor expanded in x around 0 77.9%
associate-/r*77.9%
associate-*r/77.9%
associate-*r/77.9%
div-sub77.9%
distribute-lft-out--77.9%
Simplified77.9%
Taylor expanded in t around 0 77.9%
*-commutative77.9%
Simplified77.9%
Taylor expanded in y around 0 77.9%
associate-*r/77.9%
associate-*l/77.9%
*-commutative77.9%
Simplified77.9%
Final simplification66.4%
(FPCore (x y z t)
:precision binary64
(if (<= y -8.5e+123)
(/ (* y -0.3333333333333333) z)
(if (<= y -6.6e-18)
x
(if (<= y 3e-113)
(* (/ t z) (/ 0.3333333333333333 y))
(if (<= y 4.9e+53) x (* y (/ -0.3333333333333333 z)))))))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -8.5e+123) {
tmp = (y * -0.3333333333333333) / z;
} else if (y <= -6.6e-18) {
tmp = x;
} else if (y <= 3e-113) {
tmp = (t / z) * (0.3333333333333333 / y);
} else if (y <= 4.9e+53) {
tmp = x;
} else {
tmp = 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 (y <= (-8.5d+123)) then
tmp = (y * (-0.3333333333333333d0)) / z
else if (y <= (-6.6d-18)) then
tmp = x
else if (y <= 3d-113) then
tmp = (t / z) * (0.3333333333333333d0 / y)
else if (y <= 4.9d+53) then
tmp = x
else
tmp = 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 (y <= -8.5e+123) {
tmp = (y * -0.3333333333333333) / z;
} else if (y <= -6.6e-18) {
tmp = x;
} else if (y <= 3e-113) {
tmp = (t / z) * (0.3333333333333333 / y);
} else if (y <= 4.9e+53) {
tmp = x;
} else {
tmp = y * (-0.3333333333333333 / z);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= -8.5e+123: tmp = (y * -0.3333333333333333) / z elif y <= -6.6e-18: tmp = x elif y <= 3e-113: tmp = (t / z) * (0.3333333333333333 / y) elif y <= 4.9e+53: tmp = x else: tmp = y * (-0.3333333333333333 / z) return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= -8.5e+123) tmp = Float64(Float64(y * -0.3333333333333333) / z); elseif (y <= -6.6e-18) tmp = x; elseif (y <= 3e-113) tmp = Float64(Float64(t / z) * Float64(0.3333333333333333 / y)); elseif (y <= 4.9e+53) tmp = x; else tmp = Float64(y * Float64(-0.3333333333333333 / z)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (y <= -8.5e+123) tmp = (y * -0.3333333333333333) / z; elseif (y <= -6.6e-18) tmp = x; elseif (y <= 3e-113) tmp = (t / z) * (0.3333333333333333 / y); elseif (y <= 4.9e+53) tmp = x; else tmp = y * (-0.3333333333333333 / z); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, -8.5e+123], N[(N[(y * -0.3333333333333333), $MachinePrecision] / z), $MachinePrecision], If[LessEqual[y, -6.6e-18], x, If[LessEqual[y, 3e-113], N[(N[(t / z), $MachinePrecision] * N[(0.3333333333333333 / y), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 4.9e+53], x, N[(y * N[(-0.3333333333333333 / z), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -8.5 \cdot 10^{+123}:\\
\;\;\;\;\frac{y \cdot -0.3333333333333333}{z}\\
\mathbf{elif}\;y \leq -6.6 \cdot 10^{-18}:\\
\;\;\;\;x\\
\mathbf{elif}\;y \leq 3 \cdot 10^{-113}:\\
\;\;\;\;\frac{t}{z} \cdot \frac{0.3333333333333333}{y}\\
\mathbf{elif}\;y \leq 4.9 \cdot 10^{+53}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;y \cdot \frac{-0.3333333333333333}{z}\\
\end{array}
\end{array}
if y < -8.5e123Initial program 94.3%
associate-/r*91.5%
Simplified91.5%
Taylor expanded in x around 0 74.2%
associate-/r*74.2%
associate-*r/74.2%
associate-*r/74.3%
div-sub79.9%
distribute-lft-out--79.9%
Simplified79.9%
Taylor expanded in t around 0 79.9%
*-commutative79.9%
Simplified79.9%
if -8.5e123 < y < -6.6000000000000003e-18 or 3.0000000000000001e-113 < y < 4.90000000000000018e53Initial program 96.6%
associate-/r*95.3%
Simplified95.3%
Taylor expanded in x around inf 51.0%
if -6.6000000000000003e-18 < y < 3.0000000000000001e-113Initial program 90.2%
associate-/r*99.9%
Simplified99.9%
Taylor expanded in x around 0 65.2%
associate-/r*66.7%
associate-*r/67.5%
associate-*r/67.5%
div-sub67.5%
distribute-lft-out--67.5%
Simplified67.5%
Taylor expanded in t around inf 66.0%
associate-*r/66.0%
associate-/l*66.0%
Simplified66.0%
associate-/l/65.9%
metadata-eval65.9%
frac-times66.0%
clear-num66.0%
times-frac63.8%
*-commutative63.8%
times-frac70.8%
Applied egg-rr70.8%
if 4.90000000000000018e53 < y Initial program 99.8%
associate-/r*97.6%
Simplified97.6%
Taylor expanded in x around 0 77.9%
associate-/r*77.9%
associate-*r/77.9%
associate-*r/77.9%
div-sub77.9%
distribute-lft-out--77.9%
Simplified77.9%
Taylor expanded in t around 0 77.9%
*-commutative77.9%
Simplified77.9%
Taylor expanded in y around 0 77.9%
associate-*r/77.9%
associate-*l/77.9%
*-commutative77.9%
Simplified77.9%
Final simplification68.5%
(FPCore (x y z t)
:precision binary64
(if (<= y -1.7e+117)
(- x (/ y (* z 3.0)))
(if (<= y 9e+39)
(+ x (* 0.3333333333333333 (/ t (* y z))))
(- x (/ (/ y z) 3.0)))))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -1.7e+117) {
tmp = x - (y / (z * 3.0));
} else if (y <= 9e+39) {
tmp = x + (0.3333333333333333 * (t / (y * z)));
} else {
tmp = 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 (y <= (-1.7d+117)) then
tmp = x - (y / (z * 3.0d0))
else if (y <= 9d+39) then
tmp = x + (0.3333333333333333d0 * (t / (y * z)))
else
tmp = 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 (y <= -1.7e+117) {
tmp = x - (y / (z * 3.0));
} else if (y <= 9e+39) {
tmp = x + (0.3333333333333333 * (t / (y * z)));
} else {
tmp = x - ((y / z) / 3.0);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= -1.7e+117: tmp = x - (y / (z * 3.0)) elif y <= 9e+39: tmp = x + (0.3333333333333333 * (t / (y * z))) else: tmp = x - ((y / z) / 3.0) return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= -1.7e+117) tmp = Float64(x - Float64(y / Float64(z * 3.0))); elseif (y <= 9e+39) tmp = Float64(x + Float64(0.3333333333333333 * Float64(t / Float64(y * z)))); else tmp = Float64(x - Float64(Float64(y / z) / 3.0)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (y <= -1.7e+117) tmp = x - (y / (z * 3.0)); elseif (y <= 9e+39) tmp = x + (0.3333333333333333 * (t / (y * z))); else tmp = x - ((y / z) / 3.0); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, -1.7e+117], N[(x - N[(y / N[(z * 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 9e+39], N[(x + N[(0.3333333333333333 * N[(t / N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x - N[(N[(y / z), $MachinePrecision] / 3.0), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.7 \cdot 10^{+117}:\\
\;\;\;\;x - \frac{y}{z \cdot 3}\\
\mathbf{elif}\;y \leq 9 \cdot 10^{+39}:\\
\;\;\;\;x + 0.3333333333333333 \cdot \frac{t}{y \cdot z}\\
\mathbf{else}:\\
\;\;\;\;x - \frac{\frac{y}{z}}{3}\\
\end{array}
\end{array}
if y < -1.7e117Initial program 94.3%
associate-/r*91.5%
Simplified91.5%
Taylor expanded in t around 0 99.7%
metadata-eval99.7%
times-frac99.9%
*-un-lft-identity99.9%
*-commutative99.9%
Applied egg-rr99.9%
if -1.7e117 < y < 8.99999999999999991e39Initial program 92.4%
associate-/r*98.2%
Simplified98.2%
Taylor expanded in y around 0 86.3%
if 8.99999999999999991e39 < y Initial program 99.8%
associate-/r*97.7%
Simplified97.7%
Taylor expanded in t around 0 99.7%
metadata-eval99.7%
times-frac99.8%
*-un-lft-identity99.8%
*-commutative99.8%
associate-/r*99.8%
Applied egg-rr99.8%
Final simplification90.7%
(FPCore (x y z t)
:precision binary64
(if (<= y -1.7e+117)
(- x (/ y (* z 3.0)))
(if (<= y 7e+39)
(+ x (/ (* t 0.3333333333333333) (* y z)))
(- x (/ (/ y z) 3.0)))))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -1.7e+117) {
tmp = x - (y / (z * 3.0));
} else if (y <= 7e+39) {
tmp = x + ((t * 0.3333333333333333) / (y * z));
} else {
tmp = 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 (y <= (-1.7d+117)) then
tmp = x - (y / (z * 3.0d0))
else if (y <= 7d+39) then
tmp = x + ((t * 0.3333333333333333d0) / (y * z))
else
tmp = 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 (y <= -1.7e+117) {
tmp = x - (y / (z * 3.0));
} else if (y <= 7e+39) {
tmp = x + ((t * 0.3333333333333333) / (y * z));
} else {
tmp = x - ((y / z) / 3.0);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= -1.7e+117: tmp = x - (y / (z * 3.0)) elif y <= 7e+39: tmp = x + ((t * 0.3333333333333333) / (y * z)) else: tmp = x - ((y / z) / 3.0) return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= -1.7e+117) tmp = Float64(x - Float64(y / Float64(z * 3.0))); elseif (y <= 7e+39) tmp = Float64(x + Float64(Float64(t * 0.3333333333333333) / Float64(y * z))); else tmp = Float64(x - Float64(Float64(y / z) / 3.0)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (y <= -1.7e+117) tmp = x - (y / (z * 3.0)); elseif (y <= 7e+39) tmp = x + ((t * 0.3333333333333333) / (y * z)); else tmp = x - ((y / z) / 3.0); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, -1.7e+117], N[(x - N[(y / N[(z * 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 7e+39], N[(x + N[(N[(t * 0.3333333333333333), $MachinePrecision] / N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x - N[(N[(y / z), $MachinePrecision] / 3.0), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.7 \cdot 10^{+117}:\\
\;\;\;\;x - \frac{y}{z \cdot 3}\\
\mathbf{elif}\;y \leq 7 \cdot 10^{+39}:\\
\;\;\;\;x + \frac{t \cdot 0.3333333333333333}{y \cdot z}\\
\mathbf{else}:\\
\;\;\;\;x - \frac{\frac{y}{z}}{3}\\
\end{array}
\end{array}
if y < -1.7e117Initial program 94.3%
associate-/r*91.5%
Simplified91.5%
Taylor expanded in t around 0 99.7%
metadata-eval99.7%
times-frac99.9%
*-un-lft-identity99.9%
*-commutative99.9%
Applied egg-rr99.9%
if -1.7e117 < y < 7.0000000000000003e39Initial program 92.4%
associate-/r*98.2%
Simplified98.2%
Taylor expanded in y around 0 86.3%
associate-*r/86.3%
*-commutative86.3%
Applied egg-rr86.3%
if 7.0000000000000003e39 < y Initial program 99.8%
associate-/r*97.7%
Simplified97.7%
Taylor expanded in t around 0 99.7%
metadata-eval99.7%
times-frac99.8%
*-un-lft-identity99.8%
*-commutative99.8%
associate-/r*99.8%
Applied egg-rr99.8%
Final simplification90.8%
(FPCore (x y z t)
:precision binary64
(if (<= y -1.7e+117)
(- x (/ y (* z 3.0)))
(if (<= y 1.22e+41)
(+ x (/ (/ 0.3333333333333333 z) (/ y t)))
(- x (/ (/ y z) 3.0)))))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -1.7e+117) {
tmp = x - (y / (z * 3.0));
} else if (y <= 1.22e+41) {
tmp = x + ((0.3333333333333333 / z) / (y / t));
} else {
tmp = 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 (y <= (-1.7d+117)) then
tmp = x - (y / (z * 3.0d0))
else if (y <= 1.22d+41) then
tmp = x + ((0.3333333333333333d0 / z) / (y / t))
else
tmp = 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 (y <= -1.7e+117) {
tmp = x - (y / (z * 3.0));
} else if (y <= 1.22e+41) {
tmp = x + ((0.3333333333333333 / z) / (y / t));
} else {
tmp = x - ((y / z) / 3.0);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= -1.7e+117: tmp = x - (y / (z * 3.0)) elif y <= 1.22e+41: tmp = x + ((0.3333333333333333 / z) / (y / t)) else: tmp = x - ((y / z) / 3.0) return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= -1.7e+117) tmp = Float64(x - Float64(y / Float64(z * 3.0))); elseif (y <= 1.22e+41) tmp = Float64(x + Float64(Float64(0.3333333333333333 / z) / Float64(y / t))); else tmp = Float64(x - Float64(Float64(y / z) / 3.0)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (y <= -1.7e+117) tmp = x - (y / (z * 3.0)); elseif (y <= 1.22e+41) tmp = x + ((0.3333333333333333 / z) / (y / t)); else tmp = x - ((y / z) / 3.0); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, -1.7e+117], N[(x - N[(y / N[(z * 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.22e+41], N[(x + N[(N[(0.3333333333333333 / z), $MachinePrecision] / N[(y / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x - N[(N[(y / z), $MachinePrecision] / 3.0), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.7 \cdot 10^{+117}:\\
\;\;\;\;x - \frac{y}{z \cdot 3}\\
\mathbf{elif}\;y \leq 1.22 \cdot 10^{+41}:\\
\;\;\;\;x + \frac{\frac{0.3333333333333333}{z}}{\frac{y}{t}}\\
\mathbf{else}:\\
\;\;\;\;x - \frac{\frac{y}{z}}{3}\\
\end{array}
\end{array}
if y < -1.7e117Initial program 94.3%
associate-/r*91.5%
Simplified91.5%
Taylor expanded in t around 0 99.7%
metadata-eval99.7%
times-frac99.9%
*-un-lft-identity99.9%
*-commutative99.9%
Applied egg-rr99.9%
if -1.7e117 < y < 1.22e41Initial program 92.4%
associate-/r*98.2%
Simplified98.2%
Taylor expanded in y around 0 86.3%
*-un-lft-identity86.3%
*-commutative86.3%
times-frac86.7%
Applied egg-rr86.7%
associate-*r*87.2%
div-inv87.2%
clear-num87.2%
un-div-inv87.7%
Applied egg-rr87.7%
if 1.22e41 < y Initial program 99.8%
associate-/r*97.7%
Simplified97.7%
Taylor expanded in t around 0 99.7%
metadata-eval99.7%
times-frac99.8%
*-un-lft-identity99.8%
*-commutative99.8%
associate-/r*99.8%
Applied egg-rr99.8%
Final simplification91.7%
(FPCore (x y z t) :precision binary64 (if (or (<= y -1.55e-17) (not (<= y 3.4e-113))) (- x (* 0.3333333333333333 (/ y z))) (* (/ t z) (/ 0.3333333333333333 y))))
double code(double x, double y, double z, double t) {
double tmp;
if ((y <= -1.55e-17) || !(y <= 3.4e-113)) {
tmp = x - (0.3333333333333333 * (y / z));
} else {
tmp = (t / 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 <= (-1.55d-17)) .or. (.not. (y <= 3.4d-113))) then
tmp = x - (0.3333333333333333d0 * (y / z))
else
tmp = (t / 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 <= -1.55e-17) || !(y <= 3.4e-113)) {
tmp = x - (0.3333333333333333 * (y / z));
} else {
tmp = (t / z) * (0.3333333333333333 / y);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (y <= -1.55e-17) or not (y <= 3.4e-113): tmp = x - (0.3333333333333333 * (y / z)) else: tmp = (t / z) * (0.3333333333333333 / y) return tmp
function code(x, y, z, t) tmp = 0.0 if ((y <= -1.55e-17) || !(y <= 3.4e-113)) tmp = Float64(x - Float64(0.3333333333333333 * Float64(y / z))); else tmp = Float64(Float64(t / z) * Float64(0.3333333333333333 / y)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((y <= -1.55e-17) || ~((y <= 3.4e-113))) tmp = x - (0.3333333333333333 * (y / z)); else tmp = (t / z) * (0.3333333333333333 / y); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[y, -1.55e-17], N[Not[LessEqual[y, 3.4e-113]], $MachinePrecision]], N[(x - N[(0.3333333333333333 * N[(y / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(t / z), $MachinePrecision] * N[(0.3333333333333333 / y), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.55 \cdot 10^{-17} \lor \neg \left(y \leq 3.4 \cdot 10^{-113}\right):\\
\;\;\;\;x - 0.3333333333333333 \cdot \frac{y}{z}\\
\mathbf{else}:\\
\;\;\;\;\frac{t}{z} \cdot \frac{0.3333333333333333}{y}\\
\end{array}
\end{array}
if y < -1.5499999999999999e-17 or 3.4000000000000002e-113 < y Initial program 97.0%
associate-/r*95.1%
Simplified95.1%
Taylor expanded in t around 0 87.3%
if -1.5499999999999999e-17 < y < 3.4000000000000002e-113Initial program 90.2%
associate-/r*99.9%
Simplified99.9%
Taylor expanded in x around 0 65.2%
associate-/r*66.7%
associate-*r/67.5%
associate-*r/67.5%
div-sub67.5%
distribute-lft-out--67.5%
Simplified67.5%
Taylor expanded in t around inf 66.0%
associate-*r/66.0%
associate-/l*66.0%
Simplified66.0%
associate-/l/65.9%
metadata-eval65.9%
frac-times66.0%
clear-num66.0%
times-frac63.8%
*-commutative63.8%
times-frac70.8%
Applied egg-rr70.8%
Final simplification80.2%
(FPCore (x y z t) :precision binary64 (if (or (<= y -1.02e-18) (not (<= y 2.8e-113))) (- x (/ y (* z 3.0))) (* (/ t z) (/ 0.3333333333333333 y))))
double code(double x, double y, double z, double t) {
double tmp;
if ((y <= -1.02e-18) || !(y <= 2.8e-113)) {
tmp = x - (y / (z * 3.0));
} else {
tmp = (t / 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 <= (-1.02d-18)) .or. (.not. (y <= 2.8d-113))) then
tmp = x - (y / (z * 3.0d0))
else
tmp = (t / 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 <= -1.02e-18) || !(y <= 2.8e-113)) {
tmp = x - (y / (z * 3.0));
} else {
tmp = (t / z) * (0.3333333333333333 / y);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (y <= -1.02e-18) or not (y <= 2.8e-113): tmp = x - (y / (z * 3.0)) else: tmp = (t / z) * (0.3333333333333333 / y) return tmp
function code(x, y, z, t) tmp = 0.0 if ((y <= -1.02e-18) || !(y <= 2.8e-113)) tmp = Float64(x - Float64(y / Float64(z * 3.0))); else tmp = Float64(Float64(t / z) * Float64(0.3333333333333333 / y)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((y <= -1.02e-18) || ~((y <= 2.8e-113))) tmp = x - (y / (z * 3.0)); else tmp = (t / z) * (0.3333333333333333 / y); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[y, -1.02e-18], N[Not[LessEqual[y, 2.8e-113]], $MachinePrecision]], N[(x - N[(y / N[(z * 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(t / z), $MachinePrecision] * N[(0.3333333333333333 / y), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.02 \cdot 10^{-18} \lor \neg \left(y \leq 2.8 \cdot 10^{-113}\right):\\
\;\;\;\;x - \frac{y}{z \cdot 3}\\
\mathbf{else}:\\
\;\;\;\;\frac{t}{z} \cdot \frac{0.3333333333333333}{y}\\
\end{array}
\end{array}
if y < -1.02e-18 or 2.8e-113 < y Initial program 97.0%
associate-/r*95.1%
Simplified95.1%
Taylor expanded in t around 0 87.3%
metadata-eval87.3%
times-frac87.4%
*-un-lft-identity87.4%
*-commutative87.4%
Applied egg-rr87.4%
if -1.02e-18 < y < 2.8e-113Initial program 90.2%
associate-/r*99.9%
Simplified99.9%
Taylor expanded in x around 0 65.2%
associate-/r*66.7%
associate-*r/67.5%
associate-*r/67.5%
div-sub67.5%
distribute-lft-out--67.5%
Simplified67.5%
Taylor expanded in t around inf 66.0%
associate-*r/66.0%
associate-/l*66.0%
Simplified66.0%
associate-/l/65.9%
metadata-eval65.9%
frac-times66.0%
clear-num66.0%
times-frac63.8%
*-commutative63.8%
times-frac70.8%
Applied egg-rr70.8%
Final simplification80.2%
(FPCore (x y z t) :precision binary64 (if (or (<= y -8.4e-19) (not (<= y 1.6e-113))) (- x (/ y (* z 3.0))) (/ (/ t z) (* y 3.0))))
double code(double x, double y, double z, double t) {
double tmp;
if ((y <= -8.4e-19) || !(y <= 1.6e-113)) {
tmp = x - (y / (z * 3.0));
} else {
tmp = (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) :: tmp
if ((y <= (-8.4d-19)) .or. (.not. (y <= 1.6d-113))) then
tmp = x - (y / (z * 3.0d0))
else
tmp = (t / z) / (y * 3.0d0)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((y <= -8.4e-19) || !(y <= 1.6e-113)) {
tmp = x - (y / (z * 3.0));
} else {
tmp = (t / z) / (y * 3.0);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (y <= -8.4e-19) or not (y <= 1.6e-113): tmp = x - (y / (z * 3.0)) else: tmp = (t / z) / (y * 3.0) return tmp
function code(x, y, z, t) tmp = 0.0 if ((y <= -8.4e-19) || !(y <= 1.6e-113)) tmp = Float64(x - Float64(y / Float64(z * 3.0))); else tmp = Float64(Float64(t / z) / Float64(y * 3.0)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((y <= -8.4e-19) || ~((y <= 1.6e-113))) tmp = x - (y / (z * 3.0)); else tmp = (t / z) / (y * 3.0); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[y, -8.4e-19], N[Not[LessEqual[y, 1.6e-113]], $MachinePrecision]], N[(x - N[(y / N[(z * 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(t / z), $MachinePrecision] / N[(y * 3.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -8.4 \cdot 10^{-19} \lor \neg \left(y \leq 1.6 \cdot 10^{-113}\right):\\
\;\;\;\;x - \frac{y}{z \cdot 3}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{t}{z}}{y \cdot 3}\\
\end{array}
\end{array}
if y < -8.3999999999999996e-19 or 1.6000000000000001e-113 < y Initial program 97.0%
associate-/r*95.1%
Simplified95.1%
Taylor expanded in t around 0 87.3%
metadata-eval87.3%
times-frac87.4%
*-un-lft-identity87.4%
*-commutative87.4%
Applied egg-rr87.4%
if -8.3999999999999996e-19 < y < 1.6000000000000001e-113Initial program 90.2%
associate-/r*99.9%
Simplified99.9%
Taylor expanded in x around 0 65.2%
associate-/r*66.7%
associate-*r/67.5%
associate-*r/67.5%
div-sub67.5%
distribute-lft-out--67.5%
Simplified67.5%
Taylor expanded in t around inf 66.0%
associate-*r/66.0%
associate-/l*66.0%
Simplified66.0%
associate-/l/65.9%
metadata-eval65.9%
frac-times66.0%
clear-num66.0%
times-frac63.8%
*-commutative63.8%
times-frac70.8%
Applied egg-rr70.8%
clear-num70.7%
un-div-inv70.8%
div-inv70.9%
metadata-eval70.9%
Applied egg-rr70.9%
Final simplification80.3%
(FPCore (x y z t) :precision binary64 (+ x (* (/ -0.3333333333333333 z) (- y (/ t y)))))
double code(double x, double y, double z, double t) {
return x + ((-0.3333333333333333 / z) * (y - (t / 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 + (((-0.3333333333333333d0) / z) * (y - (t / y)))
end function
public static double code(double x, double y, double z, double t) {
return x + ((-0.3333333333333333 / z) * (y - (t / y)));
}
def code(x, y, z, t): return x + ((-0.3333333333333333 / z) * (y - (t / y)))
function code(x, y, z, t) return Float64(x + Float64(Float64(-0.3333333333333333 / z) * Float64(y - Float64(t / y)))) end
function tmp = code(x, y, z, t) tmp = x + ((-0.3333333333333333 / z) * (y - (t / y))); end
code[x_, y_, z_, t_] := N[(x + N[(N[(-0.3333333333333333 / z), $MachinePrecision] * N[(y - N[(t / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \frac{-0.3333333333333333}{z} \cdot \left(y - \frac{t}{y}\right)
\end{array}
Initial program 94.1%
associate-+l-94.1%
sub-neg94.1%
sub-neg94.1%
distribute-neg-in94.1%
unsub-neg94.1%
neg-mul-194.1%
associate-*r/94.1%
associate-*l/94.0%
distribute-neg-frac94.0%
neg-mul-194.0%
times-frac95.3%
distribute-lft-out--96.1%
*-commutative96.1%
associate-/r*96.1%
metadata-eval96.1%
Simplified96.1%
Final simplification96.1%
(FPCore (x y z t) :precision binary64 (if (or (<= y -7.5e+118) (not (<= y 2.85e+62))) (* y (/ -0.3333333333333333 z)) x))
double code(double x, double y, double z, double t) {
double tmp;
if ((y <= -7.5e+118) || !(y <= 2.85e+62)) {
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 ((y <= (-7.5d+118)) .or. (.not. (y <= 2.85d+62))) 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 ((y <= -7.5e+118) || !(y <= 2.85e+62)) {
tmp = y * (-0.3333333333333333 / z);
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (y <= -7.5e+118) or not (y <= 2.85e+62): tmp = y * (-0.3333333333333333 / z) else: tmp = x return tmp
function code(x, y, z, t) tmp = 0.0 if ((y <= -7.5e+118) || !(y <= 2.85e+62)) 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 ((y <= -7.5e+118) || ~((y <= 2.85e+62))) tmp = y * (-0.3333333333333333 / z); else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[y, -7.5e+118], N[Not[LessEqual[y, 2.85e+62]], $MachinePrecision]], N[(y * N[(-0.3333333333333333 / z), $MachinePrecision]), $MachinePrecision], x]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -7.5 \cdot 10^{+118} \lor \neg \left(y \leq 2.85 \cdot 10^{+62}\right):\\
\;\;\;\;y \cdot \frac{-0.3333333333333333}{z}\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if y < -7.50000000000000003e118 or 2.84999999999999999e62 < y Initial program 97.4%
associate-/r*94.9%
Simplified94.9%
Taylor expanded in x around 0 76.3%
associate-/r*76.3%
associate-*r/76.3%
associate-*r/76.3%
div-sub78.8%
distribute-lft-out--78.8%
Simplified78.8%
Taylor expanded in t around 0 78.8%
*-commutative78.8%
Simplified78.8%
Taylor expanded in y around 0 78.7%
associate-*r/78.8%
associate-*l/78.7%
*-commutative78.7%
Simplified78.7%
if -7.50000000000000003e118 < y < 2.84999999999999999e62Initial program 92.5%
associate-/r*98.2%
Simplified98.2%
Taylor expanded in x around inf 36.7%
Final simplification50.1%
(FPCore (x y z t) :precision binary64 (if (<= y -1.7e+117) (* -0.3333333333333333 (/ y z)) (if (<= y 1.65e+64) x (* y (/ -0.3333333333333333 z)))))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -1.7e+117) {
tmp = -0.3333333333333333 * (y / z);
} else if (y <= 1.65e+64) {
tmp = x;
} else {
tmp = 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 (y <= (-1.7d+117)) then
tmp = (-0.3333333333333333d0) * (y / z)
else if (y <= 1.65d+64) then
tmp = x
else
tmp = 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 (y <= -1.7e+117) {
tmp = -0.3333333333333333 * (y / z);
} else if (y <= 1.65e+64) {
tmp = x;
} else {
tmp = y * (-0.3333333333333333 / z);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= -1.7e+117: tmp = -0.3333333333333333 * (y / z) elif y <= 1.65e+64: tmp = x else: tmp = y * (-0.3333333333333333 / z) return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= -1.7e+117) tmp = Float64(-0.3333333333333333 * Float64(y / z)); elseif (y <= 1.65e+64) tmp = x; else tmp = Float64(y * Float64(-0.3333333333333333 / z)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (y <= -1.7e+117) tmp = -0.3333333333333333 * (y / z); elseif (y <= 1.65e+64) tmp = x; else tmp = y * (-0.3333333333333333 / z); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, -1.7e+117], N[(-0.3333333333333333 * N[(y / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.65e+64], x, N[(y * N[(-0.3333333333333333 / z), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.7 \cdot 10^{+117}:\\
\;\;\;\;-0.3333333333333333 \cdot \frac{y}{z}\\
\mathbf{elif}\;y \leq 1.65 \cdot 10^{+64}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;y \cdot \frac{-0.3333333333333333}{z}\\
\end{array}
\end{array}
if y < -1.7e117Initial program 94.3%
associate-/r*91.5%
Simplified91.5%
Taylor expanded in y around inf 79.7%
*-commutative79.7%
Simplified79.7%
if -1.7e117 < y < 1.64999999999999994e64Initial program 92.5%
associate-/r*98.2%
Simplified98.2%
Taylor expanded in x around inf 36.7%
if 1.64999999999999994e64 < y Initial program 99.8%
associate-/r*97.6%
Simplified97.6%
Taylor expanded in x around 0 77.9%
associate-/r*77.9%
associate-*r/77.9%
associate-*r/77.9%
div-sub77.9%
distribute-lft-out--77.9%
Simplified77.9%
Taylor expanded in t around 0 77.9%
*-commutative77.9%
Simplified77.9%
Taylor expanded in y around 0 77.9%
associate-*r/77.9%
associate-*l/77.9%
*-commutative77.9%
Simplified77.9%
Final simplification50.1%
(FPCore (x y z t) :precision binary64 (if (<= y -8e+119) (/ (* y -0.3333333333333333) z) (if (<= y 2.85e+63) x (* y (/ -0.3333333333333333 z)))))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -8e+119) {
tmp = (y * -0.3333333333333333) / z;
} else if (y <= 2.85e+63) {
tmp = x;
} else {
tmp = 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 (y <= (-8d+119)) then
tmp = (y * (-0.3333333333333333d0)) / z
else if (y <= 2.85d+63) then
tmp = x
else
tmp = 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 (y <= -8e+119) {
tmp = (y * -0.3333333333333333) / z;
} else if (y <= 2.85e+63) {
tmp = x;
} else {
tmp = y * (-0.3333333333333333 / z);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= -8e+119: tmp = (y * -0.3333333333333333) / z elif y <= 2.85e+63: tmp = x else: tmp = y * (-0.3333333333333333 / z) return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= -8e+119) tmp = Float64(Float64(y * -0.3333333333333333) / z); elseif (y <= 2.85e+63) tmp = x; else tmp = Float64(y * Float64(-0.3333333333333333 / z)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (y <= -8e+119) tmp = (y * -0.3333333333333333) / z; elseif (y <= 2.85e+63) tmp = x; else tmp = y * (-0.3333333333333333 / z); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, -8e+119], N[(N[(y * -0.3333333333333333), $MachinePrecision] / z), $MachinePrecision], If[LessEqual[y, 2.85e+63], x, N[(y * N[(-0.3333333333333333 / z), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -8 \cdot 10^{+119}:\\
\;\;\;\;\frac{y \cdot -0.3333333333333333}{z}\\
\mathbf{elif}\;y \leq 2.85 \cdot 10^{+63}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;y \cdot \frac{-0.3333333333333333}{z}\\
\end{array}
\end{array}
if y < -7.99999999999999955e119Initial program 94.3%
associate-/r*91.5%
Simplified91.5%
Taylor expanded in x around 0 74.2%
associate-/r*74.2%
associate-*r/74.2%
associate-*r/74.3%
div-sub79.9%
distribute-lft-out--79.9%
Simplified79.9%
Taylor expanded in t around 0 79.9%
*-commutative79.9%
Simplified79.9%
if -7.99999999999999955e119 < y < 2.8500000000000001e63Initial program 92.5%
associate-/r*98.2%
Simplified98.2%
Taylor expanded in x around inf 36.7%
if 2.8500000000000001e63 < y Initial program 99.8%
associate-/r*97.6%
Simplified97.6%
Taylor expanded in x around 0 77.9%
associate-/r*77.9%
associate-*r/77.9%
associate-*r/77.9%
div-sub77.9%
distribute-lft-out--77.9%
Simplified77.9%
Taylor expanded in t around 0 77.9%
*-commutative77.9%
Simplified77.9%
Taylor expanded in y around 0 77.9%
associate-*r/77.9%
associate-*l/77.9%
*-commutative77.9%
Simplified77.9%
Final simplification50.2%
(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.1%
associate-/r*97.2%
Simplified97.2%
Taylor expanded in x around inf 32.2%
Final simplification32.2%
(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 2023228
(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))))