
(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) -5e+149) (not (<= (* z 3.0) 5e-22)))
(+
x
(+ (/ -0.3333333333333333 (/ z y)) (* (/ t (* y z)) 0.3333333333333333)))
(+ x (/ (/ (- y (/ t y)) -3.0) z))))
double code(double x, double y, double z, double t) {
double tmp;
if (((z * 3.0) <= -5e+149) || !((z * 3.0) <= 5e-22)) {
tmp = x + ((-0.3333333333333333 / (z / y)) + ((t / (y * z)) * 0.3333333333333333));
} else {
tmp = x + (((y - (t / y)) / -3.0) / z);
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (((z * 3.0d0) <= (-5d+149)) .or. (.not. ((z * 3.0d0) <= 5d-22))) then
tmp = x + (((-0.3333333333333333d0) / (z / y)) + ((t / (y * z)) * 0.3333333333333333d0))
else
tmp = x + (((y - (t / y)) / (-3.0d0)) / z)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (((z * 3.0) <= -5e+149) || !((z * 3.0) <= 5e-22)) {
tmp = x + ((-0.3333333333333333 / (z / y)) + ((t / (y * z)) * 0.3333333333333333));
} else {
tmp = x + (((y - (t / y)) / -3.0) / z);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if ((z * 3.0) <= -5e+149) or not ((z * 3.0) <= 5e-22): tmp = x + ((-0.3333333333333333 / (z / y)) + ((t / (y * z)) * 0.3333333333333333)) else: tmp = x + (((y - (t / y)) / -3.0) / z) return tmp
function code(x, y, z, t) tmp = 0.0 if ((Float64(z * 3.0) <= -5e+149) || !(Float64(z * 3.0) <= 5e-22)) tmp = Float64(x + Float64(Float64(-0.3333333333333333 / Float64(z / y)) + Float64(Float64(t / Float64(y * z)) * 0.3333333333333333))); else tmp = Float64(x + Float64(Float64(Float64(y - Float64(t / y)) / -3.0) / z)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (((z * 3.0) <= -5e+149) || ~(((z * 3.0) <= 5e-22))) tmp = x + ((-0.3333333333333333 / (z / y)) + ((t / (y * z)) * 0.3333333333333333)); else tmp = x + (((y - (t / y)) / -3.0) / z); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[N[(z * 3.0), $MachinePrecision], -5e+149], N[Not[LessEqual[N[(z * 3.0), $MachinePrecision], 5e-22]], $MachinePrecision]], N[(x + N[(N[(-0.3333333333333333 / N[(z / y), $MachinePrecision]), $MachinePrecision] + N[(N[(t / N[(y * z), $MachinePrecision]), $MachinePrecision] * 0.3333333333333333), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(N[(N[(y - N[(t / y), $MachinePrecision]), $MachinePrecision] / -3.0), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \cdot 3 \leq -5 \cdot 10^{+149} \lor \neg \left(z \cdot 3 \leq 5 \cdot 10^{-22}\right):\\
\;\;\;\;x + \left(\frac{-0.3333333333333333}{\frac{z}{y}} + \frac{t}{y \cdot z} \cdot 0.3333333333333333\right)\\
\mathbf{else}:\\
\;\;\;\;x + \frac{\frac{y - \frac{t}{y}}{-3}}{z}\\
\end{array}
\end{array}
if (*.f64 z 3) < -4.9999999999999999e149 or 4.99999999999999954e-22 < (*.f64 z 3) Initial program 99.8%
associate-+l-99.8%
sub-neg99.8%
sub-neg99.8%
distribute-neg-in99.8%
distribute-neg-frac99.8%
neg-mul-199.8%
*-commutative99.8%
times-frac99.8%
remove-double-neg99.8%
fma-def99.8%
metadata-eval99.8%
associate-*l*99.7%
associate-/r*97.0%
associate-/l/97.0%
Simplified97.0%
fma-udef97.0%
clear-num96.9%
un-div-inv97.0%
div-inv96.9%
associate-/l/99.6%
metadata-eval99.6%
Applied egg-rr99.6%
if -4.9999999999999999e149 < (*.f64 z 3) < 4.99999999999999954e-22Initial program 94.3%
associate-+l-94.3%
sub-neg94.3%
sub-neg94.3%
distribute-neg-in94.3%
unsub-neg94.3%
neg-mul-194.3%
associate-*r/94.3%
associate-*l/94.2%
distribute-neg-frac94.2%
neg-mul-194.2%
times-frac99.2%
distribute-lft-out--99.7%
*-commutative99.7%
associate-/r*99.7%
metadata-eval99.7%
Simplified99.7%
associate-*l/99.7%
clear-num99.7%
Applied egg-rr99.7%
associate-/r/99.7%
Simplified99.7%
*-commutative99.7%
associate-*l*99.6%
metadata-eval99.6%
div-inv99.7%
times-frac99.8%
*-un-lft-identity99.8%
associate-/r*99.8%
Applied egg-rr99.8%
Final simplification99.7%
(FPCore (x y z t) :precision binary64 (let* ((t_1 (+ (- x (/ y (* z 3.0))) (/ t (* y (* z 3.0)))))) (if (<= t_1 2.2e+278) t_1 (+ x (/ (/ (- y (/ t y)) z) -3.0)))))
double code(double x, double y, double z, double t) {
double t_1 = (x - (y / (z * 3.0))) + (t / (y * (z * 3.0)));
double tmp;
if (t_1 <= 2.2e+278) {
tmp = t_1;
} else {
tmp = x + (((y - (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) :: t_1
real(8) :: tmp
t_1 = (x - (y / (z * 3.0d0))) + (t / (y * (z * 3.0d0)))
if (t_1 <= 2.2d+278) then
tmp = t_1
else
tmp = x + (((y - (t / y)) / z) / (-3.0d0))
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))) + (t / (y * (z * 3.0)));
double tmp;
if (t_1 <= 2.2e+278) {
tmp = t_1;
} else {
tmp = x + (((y - (t / y)) / z) / -3.0);
}
return tmp;
}
def code(x, y, z, t): t_1 = (x - (y / (z * 3.0))) + (t / (y * (z * 3.0))) tmp = 0 if t_1 <= 2.2e+278: tmp = t_1 else: tmp = x + (((y - (t / y)) / z) / -3.0) return tmp
function code(x, y, z, t) t_1 = Float64(Float64(x - Float64(y / Float64(z * 3.0))) + Float64(t / Float64(y * Float64(z * 3.0)))) tmp = 0.0 if (t_1 <= 2.2e+278) tmp = t_1; else tmp = Float64(x + Float64(Float64(Float64(y - Float64(t / y)) / z) / -3.0)); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = (x - (y / (z * 3.0))) + (t / (y * (z * 3.0))); tmp = 0.0; if (t_1 <= 2.2e+278) tmp = t_1; else tmp = x + (((y - (t / y)) / z) / -3.0); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(x - N[(y / N[(z * 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(t / N[(y * N[(z * 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, 2.2e+278], t$95$1, N[(x + N[(N[(N[(y - N[(t / y), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision] / -3.0), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(x - \frac{y}{z \cdot 3}\right) + \frac{t}{y \cdot \left(z \cdot 3\right)}\\
\mathbf{if}\;t_1 \leq 2.2 \cdot 10^{+278}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;x + \frac{\frac{y - \frac{t}{y}}{z}}{-3}\\
\end{array}
\end{array}
if (+.f64 (-.f64 x (/.f64 y (*.f64 z 3))) (/.f64 t (*.f64 (*.f64 z 3) y))) < 2.19999999999999989e278Initial program 98.3%
if 2.19999999999999989e278 < (+.f64 (-.f64 x (/.f64 y (*.f64 z 3))) (/.f64 t (*.f64 (*.f64 z 3) y))) Initial program 88.7%
associate-+l-88.7%
sub-neg88.7%
sub-neg88.7%
distribute-neg-in88.7%
unsub-neg88.7%
neg-mul-188.7%
associate-*r/88.7%
associate-*l/88.7%
distribute-neg-frac88.7%
neg-mul-188.7%
times-frac98.1%
distribute-lft-out--99.9%
*-commutative99.9%
associate-/r*99.9%
metadata-eval99.9%
Simplified99.9%
associate-*l/99.9%
clear-num99.9%
Applied egg-rr99.9%
associate-/r/99.9%
Simplified99.9%
*-commutative99.9%
associate-*l*99.8%
metadata-eval99.8%
div-inv99.9%
times-frac99.9%
*-un-lft-identity99.9%
associate-/l/99.9%
Applied egg-rr99.9%
Final simplification98.7%
(FPCore (x y z t) :precision binary64 (if (or (<= y -1e-80) (not (<= y 2.45e-231))) (+ x (/ (/ (- y (/ t y)) -3.0) z)) (+ x (* 0.3333333333333333 (* (/ 1.0 y) (/ t z))))))
double code(double x, double y, double z, double t) {
double tmp;
if ((y <= -1e-80) || !(y <= 2.45e-231)) {
tmp = x + (((y - (t / y)) / -3.0) / z);
} else {
tmp = x + (0.3333333333333333 * ((1.0 / y) * (t / z)));
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if ((y <= (-1d-80)) .or. (.not. (y <= 2.45d-231))) then
tmp = x + (((y - (t / y)) / (-3.0d0)) / z)
else
tmp = x + (0.3333333333333333d0 * ((1.0d0 / y) * (t / z)))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((y <= -1e-80) || !(y <= 2.45e-231)) {
tmp = x + (((y - (t / y)) / -3.0) / z);
} else {
tmp = x + (0.3333333333333333 * ((1.0 / y) * (t / z)));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (y <= -1e-80) or not (y <= 2.45e-231): tmp = x + (((y - (t / y)) / -3.0) / z) else: tmp = x + (0.3333333333333333 * ((1.0 / y) * (t / z))) return tmp
function code(x, y, z, t) tmp = 0.0 if ((y <= -1e-80) || !(y <= 2.45e-231)) tmp = Float64(x + Float64(Float64(Float64(y - Float64(t / y)) / -3.0) / z)); else tmp = Float64(x + Float64(0.3333333333333333 * Float64(Float64(1.0 / y) * Float64(t / z)))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((y <= -1e-80) || ~((y <= 2.45e-231))) tmp = x + (((y - (t / y)) / -3.0) / z); else tmp = x + (0.3333333333333333 * ((1.0 / y) * (t / z))); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[y, -1e-80], N[Not[LessEqual[y, 2.45e-231]], $MachinePrecision]], N[(x + N[(N[(N[(y - N[(t / y), $MachinePrecision]), $MachinePrecision] / -3.0), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision], N[(x + N[(0.3333333333333333 * N[(N[(1.0 / y), $MachinePrecision] * N[(t / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1 \cdot 10^{-80} \lor \neg \left(y \leq 2.45 \cdot 10^{-231}\right):\\
\;\;\;\;x + \frac{\frac{y - \frac{t}{y}}{-3}}{z}\\
\mathbf{else}:\\
\;\;\;\;x + 0.3333333333333333 \cdot \left(\frac{1}{y} \cdot \frac{t}{z}\right)\\
\end{array}
\end{array}
if y < -9.99999999999999961e-81 or 2.45000000000000002e-231 < y Initial program 98.4%
associate-+l-98.4%
sub-neg98.4%
sub-neg98.4%
distribute-neg-in98.4%
unsub-neg98.4%
neg-mul-198.4%
associate-*r/98.4%
associate-*l/98.4%
distribute-neg-frac98.4%
neg-mul-198.4%
times-frac98.7%
distribute-lft-out--99.2%
*-commutative99.2%
associate-/r*99.2%
metadata-eval99.2%
Simplified99.2%
associate-*l/99.2%
clear-num99.2%
Applied egg-rr99.2%
associate-/r/99.2%
Simplified99.2%
*-commutative99.2%
associate-*l*99.1%
metadata-eval99.1%
div-inv99.2%
times-frac99.3%
*-un-lft-identity99.3%
associate-/r*99.3%
Applied egg-rr99.3%
if -9.99999999999999961e-81 < y < 2.45000000000000002e-231Initial program 89.2%
Taylor expanded in y around 0 89.0%
*-un-lft-identity89.0%
times-frac96.2%
Applied egg-rr96.2%
Final simplification98.6%
(FPCore (x y z t)
:precision binary64
(if (<= y -1.45e+49)
(+ x (/ y (* z -3.0)))
(if (<= y 7.2e+84)
(+ 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.45e+49) {
tmp = x + (y / (z * -3.0));
} else if (y <= 7.2e+84) {
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.45d+49)) then
tmp = x + (y / (z * (-3.0d0)))
else if (y <= 7.2d+84) 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.45e+49) {
tmp = x + (y / (z * -3.0));
} else if (y <= 7.2e+84) {
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.45e+49: tmp = x + (y / (z * -3.0)) elif y <= 7.2e+84: 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.45e+49) tmp = Float64(x + Float64(y / Float64(z * -3.0))); elseif (y <= 7.2e+84) tmp = Float64(x + Float64(t * Float64(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.45e+49) tmp = x + (y / (z * -3.0)); elseif (y <= 7.2e+84) 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.45e+49], N[(x + N[(y / N[(z * -3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 7.2e+84], N[(x + N[(t * N[(0.3333333333333333 / 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.45 \cdot 10^{+49}:\\
\;\;\;\;x + \frac{y}{z \cdot -3}\\
\mathbf{elif}\;y \leq 7.2 \cdot 10^{+84}:\\
\;\;\;\;x + t \cdot \frac{0.3333333333333333}{y \cdot z}\\
\mathbf{else}:\\
\;\;\;\;x + \frac{\frac{y}{z}}{-3}\\
\end{array}
\end{array}
if y < -1.45e49Initial program 99.7%
associate-+l-99.7%
sub-neg99.7%
sub-neg99.7%
distribute-neg-in99.7%
unsub-neg99.7%
neg-mul-199.7%
associate-*r/99.7%
associate-*l/99.6%
distribute-neg-frac99.6%
neg-mul-199.6%
times-frac99.7%
distribute-lft-out--99.7%
*-commutative99.7%
associate-/r*99.6%
metadata-eval99.6%
Simplified99.6%
associate-*l/99.7%
clear-num99.7%
Applied egg-rr99.7%
associate-/r/99.7%
Simplified99.7%
Taylor expanded in y around inf 96.4%
*-commutative96.4%
metadata-eval96.4%
div-inv96.5%
frac-times96.5%
*-un-lft-identity96.5%
Applied egg-rr96.5%
if -1.45e49 < y < 7.1999999999999999e84Initial program 94.5%
associate-+l-94.5%
sub-neg94.5%
sub-neg94.5%
distribute-neg-in94.5%
unsub-neg94.5%
neg-mul-194.5%
associate-*r/94.5%
associate-*l/94.5%
distribute-neg-frac94.5%
neg-mul-194.5%
times-frac92.4%
distribute-lft-out--92.4%
*-commutative92.4%
associate-/r*92.5%
metadata-eval92.5%
Simplified92.5%
associate-*l/92.5%
clear-num92.5%
Applied egg-rr92.5%
associate-/r/92.4%
Simplified92.4%
*-commutative92.4%
associate-*l*92.4%
metadata-eval92.4%
div-inv92.4%
times-frac92.5%
*-un-lft-identity92.5%
associate-/r*92.5%
Applied egg-rr92.5%
Taylor expanded in y around 0 90.1%
associate-*r/90.0%
associate-/l*90.0%
associate-/r/90.0%
associate-/l/90.0%
*-commutative90.0%
associate-/l/90.0%
Simplified90.0%
if 7.1999999999999999e84 < y Initial program 97.4%
associate-+l-97.4%
sub-neg97.4%
sub-neg97.4%
distribute-neg-in97.4%
unsub-neg97.4%
neg-mul-197.4%
associate-*r/97.4%
associate-*l/97.4%
distribute-neg-frac97.4%
neg-mul-197.4%
times-frac97.4%
distribute-lft-out--99.7%
*-commutative99.7%
associate-/r*99.6%
metadata-eval99.6%
Simplified99.6%
associate-*l/99.6%
clear-num99.6%
Applied egg-rr99.6%
associate-/r/99.6%
Simplified99.6%
Taylor expanded in y around inf 97.0%
*-commutative97.0%
*-commutative97.0%
metadata-eval97.0%
div-inv96.9%
associate-*l/97.1%
div-inv97.2%
Applied egg-rr97.2%
Final simplification92.6%
(FPCore (x y z t)
:precision binary64
(if (<= y -1.25e+54)
(+ x (* (/ 1.0 z) (/ y -3.0)))
(if (<= y 7.2e+84)
(+ 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.25e+54) {
tmp = x + ((1.0 / z) * (y / -3.0));
} else if (y <= 7.2e+84) {
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.25d+54)) then
tmp = x + ((1.0d0 / z) * (y / (-3.0d0)))
else if (y <= 7.2d+84) 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.25e+54) {
tmp = x + ((1.0 / z) * (y / -3.0));
} else if (y <= 7.2e+84) {
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.25e+54: tmp = x + ((1.0 / z) * (y / -3.0)) elif y <= 7.2e+84: 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.25e+54) tmp = Float64(x + Float64(Float64(1.0 / z) * Float64(y / -3.0))); elseif (y <= 7.2e+84) tmp = Float64(x + Float64(t * Float64(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.25e+54) tmp = x + ((1.0 / z) * (y / -3.0)); elseif (y <= 7.2e+84) 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.25e+54], N[(x + N[(N[(1.0 / z), $MachinePrecision] * N[(y / -3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 7.2e+84], N[(x + N[(t * N[(0.3333333333333333 / 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.25 \cdot 10^{+54}:\\
\;\;\;\;x + \frac{1}{z} \cdot \frac{y}{-3}\\
\mathbf{elif}\;y \leq 7.2 \cdot 10^{+84}:\\
\;\;\;\;x + t \cdot \frac{0.3333333333333333}{y \cdot z}\\
\mathbf{else}:\\
\;\;\;\;x + \frac{\frac{y}{z}}{-3}\\
\end{array}
\end{array}
if y < -1.25000000000000001e54Initial program 99.7%
associate-+l-99.7%
sub-neg99.7%
sub-neg99.7%
distribute-neg-in99.7%
unsub-neg99.7%
neg-mul-199.7%
associate-*r/99.7%
associate-*l/99.6%
distribute-neg-frac99.6%
neg-mul-199.6%
times-frac99.7%
distribute-lft-out--99.7%
*-commutative99.7%
associate-/r*99.6%
metadata-eval99.6%
Simplified99.6%
associate-*l/99.7%
clear-num99.7%
Applied egg-rr99.7%
associate-/r/99.7%
Simplified99.7%
Taylor expanded in y around inf 96.4%
*-commutative96.4%
metadata-eval96.4%
div-inv96.5%
Applied egg-rr96.5%
if -1.25000000000000001e54 < y < 7.1999999999999999e84Initial program 94.5%
associate-+l-94.5%
sub-neg94.5%
sub-neg94.5%
distribute-neg-in94.5%
unsub-neg94.5%
neg-mul-194.5%
associate-*r/94.5%
associate-*l/94.5%
distribute-neg-frac94.5%
neg-mul-194.5%
times-frac92.4%
distribute-lft-out--92.4%
*-commutative92.4%
associate-/r*92.5%
metadata-eval92.5%
Simplified92.5%
associate-*l/92.5%
clear-num92.5%
Applied egg-rr92.5%
associate-/r/92.4%
Simplified92.4%
*-commutative92.4%
associate-*l*92.4%
metadata-eval92.4%
div-inv92.4%
times-frac92.5%
*-un-lft-identity92.5%
associate-/r*92.5%
Applied egg-rr92.5%
Taylor expanded in y around 0 90.1%
associate-*r/90.0%
associate-/l*90.0%
associate-/r/90.0%
associate-/l/90.0%
*-commutative90.0%
associate-/l/90.0%
Simplified90.0%
if 7.1999999999999999e84 < y Initial program 97.4%
associate-+l-97.4%
sub-neg97.4%
sub-neg97.4%
distribute-neg-in97.4%
unsub-neg97.4%
neg-mul-197.4%
associate-*r/97.4%
associate-*l/97.4%
distribute-neg-frac97.4%
neg-mul-197.4%
times-frac97.4%
distribute-lft-out--99.7%
*-commutative99.7%
associate-/r*99.6%
metadata-eval99.6%
Simplified99.6%
associate-*l/99.6%
clear-num99.6%
Applied egg-rr99.6%
associate-/r/99.6%
Simplified99.6%
Taylor expanded in y around inf 97.0%
*-commutative97.0%
*-commutative97.0%
metadata-eval97.0%
div-inv96.9%
associate-*l/97.1%
div-inv97.2%
Applied egg-rr97.2%
Final simplification92.7%
(FPCore (x y z t) :precision binary64 (if (<= y -5.5e+50) (+ x (* (/ 1.0 z) (/ y -3.0))) (if (<= y 7.2e+84) (+ x (/ t (* 3.0 (* y z)))) (+ x (/ (/ y z) -3.0)))))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -5.5e+50) {
tmp = x + ((1.0 / z) * (y / -3.0));
} else if (y <= 7.2e+84) {
tmp = x + (t / (3.0 * (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 <= (-5.5d+50)) then
tmp = x + ((1.0d0 / z) * (y / (-3.0d0)))
else if (y <= 7.2d+84) then
tmp = x + (t / (3.0d0 * (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 <= -5.5e+50) {
tmp = x + ((1.0 / z) * (y / -3.0));
} else if (y <= 7.2e+84) {
tmp = x + (t / (3.0 * (y * z)));
} else {
tmp = x + ((y / z) / -3.0);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= -5.5e+50: tmp = x + ((1.0 / z) * (y / -3.0)) elif y <= 7.2e+84: tmp = x + (t / (3.0 * (y * z))) else: tmp = x + ((y / z) / -3.0) return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= -5.5e+50) tmp = Float64(x + Float64(Float64(1.0 / z) * Float64(y / -3.0))); elseif (y <= 7.2e+84) tmp = Float64(x + Float64(t / Float64(3.0 * 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 <= -5.5e+50) tmp = x + ((1.0 / z) * (y / -3.0)); elseif (y <= 7.2e+84) tmp = x + (t / (3.0 * (y * z))); else tmp = x + ((y / z) / -3.0); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, -5.5e+50], N[(x + N[(N[(1.0 / z), $MachinePrecision] * N[(y / -3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 7.2e+84], N[(x + N[(t / N[(3.0 * 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 -5.5 \cdot 10^{+50}:\\
\;\;\;\;x + \frac{1}{z} \cdot \frac{y}{-3}\\
\mathbf{elif}\;y \leq 7.2 \cdot 10^{+84}:\\
\;\;\;\;x + \frac{t}{3 \cdot \left(y \cdot z\right)}\\
\mathbf{else}:\\
\;\;\;\;x + \frac{\frac{y}{z}}{-3}\\
\end{array}
\end{array}
if y < -5.4999999999999998e50Initial program 99.7%
associate-+l-99.7%
sub-neg99.7%
sub-neg99.7%
distribute-neg-in99.7%
unsub-neg99.7%
neg-mul-199.7%
associate-*r/99.7%
associate-*l/99.6%
distribute-neg-frac99.6%
neg-mul-199.6%
times-frac99.7%
distribute-lft-out--99.7%
*-commutative99.7%
associate-/r*99.6%
metadata-eval99.6%
Simplified99.6%
associate-*l/99.7%
clear-num99.7%
Applied egg-rr99.7%
associate-/r/99.7%
Simplified99.7%
Taylor expanded in y around inf 96.4%
*-commutative96.4%
metadata-eval96.4%
div-inv96.5%
Applied egg-rr96.5%
if -5.4999999999999998e50 < y < 7.1999999999999999e84Initial program 94.5%
associate-+l-94.5%
sub-neg94.5%
sub-neg94.5%
distribute-neg-in94.5%
unsub-neg94.5%
neg-mul-194.5%
associate-*r/94.5%
associate-*l/94.5%
distribute-neg-frac94.5%
neg-mul-194.5%
times-frac92.4%
distribute-lft-out--92.4%
*-commutative92.4%
associate-/r*92.5%
metadata-eval92.5%
Simplified92.5%
associate-*l/92.5%
clear-num92.5%
Applied egg-rr92.5%
associate-/r/92.4%
Simplified92.4%
*-commutative92.4%
associate-*l*92.4%
metadata-eval92.4%
div-inv92.4%
times-frac92.5%
*-un-lft-identity92.5%
associate-/r*92.5%
Applied egg-rr92.5%
Taylor expanded in y around 0 90.1%
*-commutative90.1%
associate-/r*87.7%
associate-/r/87.7%
associate-/l/90.1%
Simplified90.1%
Taylor expanded in z around 0 90.1%
if 7.1999999999999999e84 < y Initial program 97.4%
associate-+l-97.4%
sub-neg97.4%
sub-neg97.4%
distribute-neg-in97.4%
unsub-neg97.4%
neg-mul-197.4%
associate-*r/97.4%
associate-*l/97.4%
distribute-neg-frac97.4%
neg-mul-197.4%
times-frac97.4%
distribute-lft-out--99.7%
*-commutative99.7%
associate-/r*99.6%
metadata-eval99.6%
Simplified99.6%
associate-*l/99.6%
clear-num99.6%
Applied egg-rr99.6%
associate-/r/99.6%
Simplified99.6%
Taylor expanded in y around inf 97.0%
*-commutative97.0%
*-commutative97.0%
metadata-eval97.0%
div-inv96.9%
associate-*l/97.1%
div-inv97.2%
Applied egg-rr97.2%
Final simplification92.8%
(FPCore (x y z t) :precision binary64 (if (<= y -2.35e+49) (+ x (* (/ 1.0 z) (/ y -3.0))) (if (<= y 7.5e+84) (+ x (/ t (* y (* z 3.0)))) (+ x (/ (/ y z) -3.0)))))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -2.35e+49) {
tmp = x + ((1.0 / z) * (y / -3.0));
} else if (y <= 7.5e+84) {
tmp = x + (t / (y * (z * 3.0)));
} 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 <= (-2.35d+49)) then
tmp = x + ((1.0d0 / z) * (y / (-3.0d0)))
else if (y <= 7.5d+84) then
tmp = x + (t / (y * (z * 3.0d0)))
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 <= -2.35e+49) {
tmp = x + ((1.0 / z) * (y / -3.0));
} else if (y <= 7.5e+84) {
tmp = x + (t / (y * (z * 3.0)));
} else {
tmp = x + ((y / z) / -3.0);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= -2.35e+49: tmp = x + ((1.0 / z) * (y / -3.0)) elif y <= 7.5e+84: tmp = x + (t / (y * (z * 3.0))) else: tmp = x + ((y / z) / -3.0) return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= -2.35e+49) tmp = Float64(x + Float64(Float64(1.0 / z) * Float64(y / -3.0))); elseif (y <= 7.5e+84) tmp = Float64(x + Float64(t / Float64(y * Float64(z * 3.0)))); 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 <= -2.35e+49) tmp = x + ((1.0 / z) * (y / -3.0)); elseif (y <= 7.5e+84) tmp = x + (t / (y * (z * 3.0))); else tmp = x + ((y / z) / -3.0); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, -2.35e+49], N[(x + N[(N[(1.0 / z), $MachinePrecision] * N[(y / -3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 7.5e+84], N[(x + N[(t / N[(y * N[(z * 3.0), $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 -2.35 \cdot 10^{+49}:\\
\;\;\;\;x + \frac{1}{z} \cdot \frac{y}{-3}\\
\mathbf{elif}\;y \leq 7.5 \cdot 10^{+84}:\\
\;\;\;\;x + \frac{t}{y \cdot \left(z \cdot 3\right)}\\
\mathbf{else}:\\
\;\;\;\;x + \frac{\frac{y}{z}}{-3}\\
\end{array}
\end{array}
if y < -2.3499999999999999e49Initial program 99.7%
associate-+l-99.7%
sub-neg99.7%
sub-neg99.7%
distribute-neg-in99.7%
unsub-neg99.7%
neg-mul-199.7%
associate-*r/99.7%
associate-*l/99.6%
distribute-neg-frac99.6%
neg-mul-199.6%
times-frac99.7%
distribute-lft-out--99.7%
*-commutative99.7%
associate-/r*99.6%
metadata-eval99.6%
Simplified99.6%
associate-*l/99.7%
clear-num99.7%
Applied egg-rr99.7%
associate-/r/99.7%
Simplified99.7%
Taylor expanded in y around inf 96.4%
*-commutative96.4%
metadata-eval96.4%
div-inv96.5%
Applied egg-rr96.5%
if -2.3499999999999999e49 < y < 7.5000000000000001e84Initial program 94.5%
associate-+l-94.5%
sub-neg94.5%
sub-neg94.5%
distribute-neg-in94.5%
unsub-neg94.5%
neg-mul-194.5%
associate-*r/94.5%
associate-*l/94.5%
distribute-neg-frac94.5%
neg-mul-194.5%
times-frac92.4%
distribute-lft-out--92.4%
*-commutative92.4%
associate-/r*92.5%
metadata-eval92.5%
Simplified92.5%
associate-*l/92.5%
clear-num92.5%
Applied egg-rr92.5%
associate-/r/92.4%
Simplified92.4%
*-commutative92.4%
associate-*l*92.4%
metadata-eval92.4%
div-inv92.4%
times-frac92.5%
*-un-lft-identity92.5%
associate-/r*92.5%
Applied egg-rr92.5%
Taylor expanded in y around 0 90.1%
*-commutative90.1%
associate-/r*87.7%
associate-/r/87.7%
associate-/l/90.1%
Simplified90.1%
Taylor expanded in z around 0 90.2%
*-commutative90.2%
Simplified90.2%
if 7.5000000000000001e84 < y Initial program 97.4%
associate-+l-97.4%
sub-neg97.4%
sub-neg97.4%
distribute-neg-in97.4%
unsub-neg97.4%
neg-mul-197.4%
associate-*r/97.4%
associate-*l/97.4%
distribute-neg-frac97.4%
neg-mul-197.4%
times-frac97.4%
distribute-lft-out--99.7%
*-commutative99.7%
associate-/r*99.6%
metadata-eval99.6%
Simplified99.6%
associate-*l/99.6%
clear-num99.6%
Applied egg-rr99.6%
associate-/r/99.6%
Simplified99.6%
Taylor expanded in y around inf 97.0%
*-commutative97.0%
*-commutative97.0%
metadata-eval97.0%
div-inv96.9%
associate-*l/97.1%
div-inv97.2%
Applied egg-rr97.2%
Final simplification92.8%
(FPCore (x y z t) :precision binary64 (+ x (* (- y (/ t y)) (/ -0.3333333333333333 z))))
double code(double x, double y, double z, double t) {
return x + ((y - (t / 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 - (t / y)) * ((-0.3333333333333333d0) / z))
end function
public static double code(double x, double y, double z, double t) {
return x + ((y - (t / y)) * (-0.3333333333333333 / z));
}
def code(x, y, z, t): return x + ((y - (t / y)) * (-0.3333333333333333 / z))
function code(x, y, z, t) return Float64(x + Float64(Float64(y - Float64(t / y)) * Float64(-0.3333333333333333 / z))) end
function tmp = code(x, y, z, t) tmp = x + ((y - (t / y)) * (-0.3333333333333333 / z)); end
code[x_, y_, z_, t_] := N[(x + N[(N[(y - N[(t / y), $MachinePrecision]), $MachinePrecision] * N[(-0.3333333333333333 / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \left(y - \frac{t}{y}\right) \cdot \frac{-0.3333333333333333}{z}
\end{array}
Initial program 96.2%
associate-+l-96.2%
sub-neg96.2%
sub-neg96.2%
distribute-neg-in96.2%
unsub-neg96.2%
neg-mul-196.2%
associate-*r/96.2%
associate-*l/96.2%
distribute-neg-frac96.2%
neg-mul-196.2%
times-frac94.9%
distribute-lft-out--95.3%
*-commutative95.3%
associate-/r*95.3%
metadata-eval95.3%
Simplified95.3%
Final simplification95.3%
(FPCore (x y z t) :precision binary64 (+ x (/ (* 0.3333333333333333 (- (/ t y) y)) z)))
double code(double x, double y, double z, double t) {
return x + ((0.3333333333333333 * ((t / y) - y)) / z);
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = x + ((0.3333333333333333d0 * ((t / y) - y)) / z)
end function
public static double code(double x, double y, double z, double t) {
return x + ((0.3333333333333333 * ((t / y) - y)) / z);
}
def code(x, y, z, t): return x + ((0.3333333333333333 * ((t / y) - y)) / z)
function code(x, y, z, t) return Float64(x + Float64(Float64(0.3333333333333333 * Float64(Float64(t / y) - y)) / z)) end
function tmp = code(x, y, z, t) tmp = x + ((0.3333333333333333 * ((t / y) - y)) / z); end
code[x_, y_, z_, t_] := N[(x + N[(N[(0.3333333333333333 * N[(N[(t / y), $MachinePrecision] - y), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \frac{0.3333333333333333 \cdot \left(\frac{t}{y} - y\right)}{z}
\end{array}
Initial program 96.2%
associate-+l-96.2%
sub-neg96.2%
sub-neg96.2%
distribute-neg-in96.2%
unsub-neg96.2%
neg-mul-196.2%
associate-*r/96.2%
associate-*l/96.2%
distribute-neg-frac96.2%
neg-mul-196.2%
times-frac94.9%
distribute-lft-out--95.3%
*-commutative95.3%
associate-/r*95.3%
metadata-eval95.3%
Simplified95.3%
Taylor expanded in y around 0 96.1%
+-commutative96.1%
metadata-eval96.1%
cancel-sign-sub-inv96.1%
associate-/r*94.9%
associate-*r/94.9%
associate-*r/94.9%
div-sub95.3%
distribute-lft-out--95.3%
Simplified95.3%
Final simplification95.3%
(FPCore (x y z t) :precision binary64 (+ x (/ (- y (/ t y)) (* z -3.0))))
double code(double x, double y, double z, double t) {
return x + ((y - (t / y)) / (z * -3.0));
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = x + ((y - (t / y)) / (z * (-3.0d0)))
end function
public static double code(double x, double y, double z, double t) {
return x + ((y - (t / y)) / (z * -3.0));
}
def code(x, y, z, t): return x + ((y - (t / y)) / (z * -3.0))
function code(x, y, z, t) return Float64(x + Float64(Float64(y - Float64(t / y)) / Float64(z * -3.0))) end
function tmp = code(x, y, z, t) tmp = x + ((y - (t / y)) / (z * -3.0)); end
code[x_, y_, z_, t_] := N[(x + N[(N[(y - N[(t / y), $MachinePrecision]), $MachinePrecision] / N[(z * -3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \frac{y - \frac{t}{y}}{z \cdot -3}
\end{array}
Initial program 96.2%
associate-+l-96.2%
sub-neg96.2%
sub-neg96.2%
distribute-neg-in96.2%
unsub-neg96.2%
neg-mul-196.2%
associate-*r/96.2%
associate-*l/96.2%
distribute-neg-frac96.2%
neg-mul-196.2%
times-frac94.9%
distribute-lft-out--95.3%
*-commutative95.3%
associate-/r*95.3%
metadata-eval95.3%
Simplified95.3%
*-commutative95.3%
clear-num95.3%
un-div-inv95.3%
div-inv95.3%
metadata-eval95.3%
Applied egg-rr95.3%
Final simplification95.3%
(FPCore (x y z t) :precision binary64 (+ x (/ (/ (- y (/ t y)) -3.0) z)))
double code(double x, double y, double z, double t) {
return x + (((y - (t / y)) / -3.0) / 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 - (t / y)) / (-3.0d0)) / z)
end function
public static double code(double x, double y, double z, double t) {
return x + (((y - (t / y)) / -3.0) / z);
}
def code(x, y, z, t): return x + (((y - (t / y)) / -3.0) / z)
function code(x, y, z, t) return Float64(x + Float64(Float64(Float64(y - Float64(t / y)) / -3.0) / z)) end
function tmp = code(x, y, z, t) tmp = x + (((y - (t / y)) / -3.0) / z); end
code[x_, y_, z_, t_] := N[(x + N[(N[(N[(y - N[(t / y), $MachinePrecision]), $MachinePrecision] / -3.0), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \frac{\frac{y - \frac{t}{y}}{-3}}{z}
\end{array}
Initial program 96.2%
associate-+l-96.2%
sub-neg96.2%
sub-neg96.2%
distribute-neg-in96.2%
unsub-neg96.2%
neg-mul-196.2%
associate-*r/96.2%
associate-*l/96.2%
distribute-neg-frac96.2%
neg-mul-196.2%
times-frac94.9%
distribute-lft-out--95.3%
*-commutative95.3%
associate-/r*95.3%
metadata-eval95.3%
Simplified95.3%
associate-*l/95.3%
clear-num95.3%
Applied egg-rr95.3%
associate-/r/95.3%
Simplified95.3%
*-commutative95.3%
associate-*l*95.2%
metadata-eval95.2%
div-inv95.3%
times-frac95.3%
*-un-lft-identity95.3%
associate-/r*95.4%
Applied egg-rr95.4%
Final simplification95.4%
(FPCore (x y z t) :precision binary64 (if (or (<= y -4.2e+79) (not (<= y 4.7e+86))) (/ -0.3333333333333333 (/ z y)) x))
double code(double x, double y, double z, double t) {
double tmp;
if ((y <= -4.2e+79) || !(y <= 4.7e+86)) {
tmp = -0.3333333333333333 / (z / y);
} else {
tmp = x;
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if ((y <= (-4.2d+79)) .or. (.not. (y <= 4.7d+86))) then
tmp = (-0.3333333333333333d0) / (z / y)
else
tmp = x
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((y <= -4.2e+79) || !(y <= 4.7e+86)) {
tmp = -0.3333333333333333 / (z / y);
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (y <= -4.2e+79) or not (y <= 4.7e+86): tmp = -0.3333333333333333 / (z / y) else: tmp = x return tmp
function code(x, y, z, t) tmp = 0.0 if ((y <= -4.2e+79) || !(y <= 4.7e+86)) tmp = Float64(-0.3333333333333333 / Float64(z / y)); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((y <= -4.2e+79) || ~((y <= 4.7e+86))) tmp = -0.3333333333333333 / (z / y); else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[y, -4.2e+79], N[Not[LessEqual[y, 4.7e+86]], $MachinePrecision]], N[(-0.3333333333333333 / N[(z / y), $MachinePrecision]), $MachinePrecision], x]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -4.2 \cdot 10^{+79} \lor \neg \left(y \leq 4.7 \cdot 10^{+86}\right):\\
\;\;\;\;\frac{-0.3333333333333333}{\frac{z}{y}}\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if y < -4.20000000000000016e79 or 4.7000000000000002e86 < y Initial program 98.7%
Taylor expanded in t around 0 97.3%
add-sqr-sqrt52.5%
sqrt-unprod47.9%
swap-sqr47.9%
metadata-eval47.9%
metadata-eval47.9%
swap-sqr47.9%
clear-num47.9%
div-inv47.9%
clear-num47.9%
div-inv47.9%
sqrt-unprod8.9%
add-sqr-sqrt18.3%
Applied egg-rr18.3%
Taylor expanded in x around 0 1.4%
add-sqr-sqrt52.5%
sqrt-unprod47.9%
swap-sqr47.9%
metadata-eval47.9%
metadata-eval47.9%
swap-sqr47.9%
clear-num47.9%
div-inv47.9%
clear-num47.9%
div-inv47.9%
sqrt-unprod8.9%
add-sqr-sqrt18.3%
Applied egg-rr79.0%
if -4.20000000000000016e79 < y < 4.7000000000000002e86Initial program 94.8%
Taylor expanded in x around inf 32.8%
Final simplification49.2%
(FPCore (x y z t) :precision binary64 (if (or (<= y -3e+80) (not (<= y 5.1e+89))) (/ (/ y -3.0) z) x))
double code(double x, double y, double z, double t) {
double tmp;
if ((y <= -3e+80) || !(y <= 5.1e+89)) {
tmp = (y / -3.0) / 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 <= (-3d+80)) .or. (.not. (y <= 5.1d+89))) then
tmp = (y / (-3.0d0)) / 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 <= -3e+80) || !(y <= 5.1e+89)) {
tmp = (y / -3.0) / z;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (y <= -3e+80) or not (y <= 5.1e+89): tmp = (y / -3.0) / z else: tmp = x return tmp
function code(x, y, z, t) tmp = 0.0 if ((y <= -3e+80) || !(y <= 5.1e+89)) tmp = Float64(Float64(y / -3.0) / z); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((y <= -3e+80) || ~((y <= 5.1e+89))) tmp = (y / -3.0) / z; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[y, -3e+80], N[Not[LessEqual[y, 5.1e+89]], $MachinePrecision]], N[(N[(y / -3.0), $MachinePrecision] / z), $MachinePrecision], x]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -3 \cdot 10^{+80} \lor \neg \left(y \leq 5.1 \cdot 10^{+89}\right):\\
\;\;\;\;\frac{\frac{y}{-3}}{z}\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if y < -2.99999999999999987e80 or 5.10000000000000027e89 < y Initial program 98.7%
Taylor expanded in t around 0 97.3%
add-sqr-sqrt52.5%
sqrt-unprod47.9%
swap-sqr47.9%
metadata-eval47.9%
metadata-eval47.9%
swap-sqr47.9%
clear-num47.9%
div-inv47.9%
clear-num47.9%
div-inv47.9%
sqrt-unprod8.9%
add-sqr-sqrt18.3%
Applied egg-rr18.3%
Taylor expanded in x around 0 1.4%
add-sqr-sqrt0.9%
sqrt-unprod25.0%
swap-sqr25.0%
metadata-eval25.0%
metadata-eval25.0%
swap-sqr25.0%
clear-num25.0%
div-inv25.0%
clear-num25.0%
div-inv25.0%
sqrt-unprod36.1%
add-sqr-sqrt79.0%
div-inv79.1%
metadata-eval79.1%
clear-num79.0%
times-frac79.2%
*-un-lft-identity79.2%
associate-/r*79.2%
Applied egg-rr79.2%
if -2.99999999999999987e80 < y < 5.10000000000000027e89Initial program 94.8%
Taylor expanded in x around inf 32.8%
Final simplification49.3%
(FPCore (x y z t) :precision binary64 (if (<= y -3e+80) (/ (* y -0.3333333333333333) z) (if (<= y 4.7e+86) x (/ -0.3333333333333333 (/ z y)))))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -3e+80) {
tmp = (y * -0.3333333333333333) / z;
} else if (y <= 4.7e+86) {
tmp = x;
} else {
tmp = -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 <= (-3d+80)) then
tmp = (y * (-0.3333333333333333d0)) / z
else if (y <= 4.7d+86) then
tmp = x
else
tmp = (-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 <= -3e+80) {
tmp = (y * -0.3333333333333333) / z;
} else if (y <= 4.7e+86) {
tmp = x;
} else {
tmp = -0.3333333333333333 / (z / y);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= -3e+80: tmp = (y * -0.3333333333333333) / z elif y <= 4.7e+86: tmp = x else: tmp = -0.3333333333333333 / (z / y) return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= -3e+80) tmp = Float64(Float64(y * -0.3333333333333333) / z); elseif (y <= 4.7e+86) tmp = x; else tmp = Float64(-0.3333333333333333 / Float64(z / y)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (y <= -3e+80) tmp = (y * -0.3333333333333333) / z; elseif (y <= 4.7e+86) tmp = x; else tmp = -0.3333333333333333 / (z / y); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, -3e+80], N[(N[(y * -0.3333333333333333), $MachinePrecision] / z), $MachinePrecision], If[LessEqual[y, 4.7e+86], x, N[(-0.3333333333333333 / N[(z / y), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -3 \cdot 10^{+80}:\\
\;\;\;\;\frac{y \cdot -0.3333333333333333}{z}\\
\mathbf{elif}\;y \leq 4.7 \cdot 10^{+86}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;\frac{-0.3333333333333333}{\frac{z}{y}}\\
\end{array}
\end{array}
if y < -2.99999999999999987e80Initial program 99.8%
Taylor expanded in t around 0 97.7%
add-sqr-sqrt63.7%
sqrt-unprod53.0%
swap-sqr53.1%
metadata-eval53.1%
metadata-eval53.1%
swap-sqr53.0%
clear-num53.0%
div-inv53.0%
clear-num53.0%
div-inv53.0%
sqrt-unprod10.1%
add-sqr-sqrt21.0%
Applied egg-rr21.0%
Taylor expanded in x around 0 1.8%
add-sqr-sqrt1.2%
sqrt-unprod17.6%
swap-sqr17.6%
metadata-eval17.6%
metadata-eval17.6%
swap-sqr17.6%
clear-num17.7%
div-inv17.6%
clear-num17.7%
div-inv17.6%
sqrt-unprod24.0%
add-sqr-sqrt76.0%
associate-/r/76.0%
associate-*l/76.1%
Applied egg-rr76.1%
if -2.99999999999999987e80 < y < 4.7000000000000002e86Initial program 94.8%
Taylor expanded in x around inf 32.8%
if 4.7000000000000002e86 < y Initial program 97.3%
Taylor expanded in t around 0 96.9%
add-sqr-sqrt38.8%
sqrt-unprod41.7%
swap-sqr41.7%
metadata-eval41.7%
metadata-eval41.7%
swap-sqr41.7%
clear-num41.7%
div-inv41.7%
clear-num41.7%
div-inv41.7%
sqrt-unprod7.5%
add-sqr-sqrt15.0%
Applied egg-rr15.0%
Taylor expanded in x around 0 0.9%
add-sqr-sqrt38.8%
sqrt-unprod41.7%
swap-sqr41.7%
metadata-eval41.7%
metadata-eval41.7%
swap-sqr41.7%
clear-num41.7%
div-inv41.7%
clear-num41.7%
div-inv41.7%
sqrt-unprod7.5%
add-sqr-sqrt15.0%
Applied egg-rr82.7%
Final simplification49.3%
(FPCore (x y z t) :precision binary64 (+ x (/ y (* z -3.0))))
double code(double x, double y, double z, double t) {
return x + (y / (z * -3.0));
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = x + (y / (z * (-3.0d0)))
end function
public static double code(double x, double y, double z, double t) {
return x + (y / (z * -3.0));
}
def code(x, y, z, t): return x + (y / (z * -3.0))
function code(x, y, z, t) return Float64(x + Float64(y / Float64(z * -3.0))) end
function tmp = code(x, y, z, t) tmp = x + (y / (z * -3.0)); end
code[x_, y_, z_, t_] := N[(x + N[(y / N[(z * -3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \frac{y}{z \cdot -3}
\end{array}
Initial program 96.2%
associate-+l-96.2%
sub-neg96.2%
sub-neg96.2%
distribute-neg-in96.2%
unsub-neg96.2%
neg-mul-196.2%
associate-*r/96.2%
associate-*l/96.2%
distribute-neg-frac96.2%
neg-mul-196.2%
times-frac94.9%
distribute-lft-out--95.3%
*-commutative95.3%
associate-/r*95.3%
metadata-eval95.3%
Simplified95.3%
associate-*l/95.3%
clear-num95.3%
Applied egg-rr95.3%
associate-/r/95.3%
Simplified95.3%
Taylor expanded in y around inf 60.6%
*-commutative60.6%
metadata-eval60.6%
div-inv60.6%
frac-times60.6%
*-un-lft-identity60.6%
Applied egg-rr60.6%
Final simplification60.6%
(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 96.2%
Taylor expanded in x around inf 28.2%
Final simplification28.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 2023200
(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))))