
(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 17 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t) :precision binary64 (+ (- x (/ y (* z 3.0))) (/ t (* (* z 3.0) y))))
double code(double x, double y, double z, double t) {
return (x - (y / (z * 3.0))) + (t / ((z * 3.0) * y));
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = (x - (y / (z * 3.0d0))) + (t / ((z * 3.0d0) * y))
end function
public static double code(double x, double y, double z, double t) {
return (x - (y / (z * 3.0))) + (t / ((z * 3.0) * y));
}
def code(x, y, z, t): return (x - (y / (z * 3.0))) + (t / ((z * 3.0) * y))
function code(x, y, z, t) return Float64(Float64(x - Float64(y / Float64(z * 3.0))) + Float64(t / Float64(Float64(z * 3.0) * y))) end
function tmp = code(x, y, z, t) tmp = (x - (y / (z * 3.0))) + (t / ((z * 3.0) * y)); end
code[x_, y_, z_, t_] := N[(N[(x - N[(y / N[(z * 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(t / N[(N[(z * 3.0), $MachinePrecision] * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(x - \frac{y}{z \cdot 3}\right) + \frac{t}{\left(z \cdot 3\right) \cdot y}
\end{array}
(FPCore (x y z t) :precision binary64 (if (<= t -1.65e-10) (+ x (fma -0.3333333333333333 (/ y z) (/ t (* z (* y 3.0))))) (+ x (/ (- (/ t y) y) (* z 3.0)))))
double code(double x, double y, double z, double t) {
double tmp;
if (t <= -1.65e-10) {
tmp = x + fma(-0.3333333333333333, (y / z), (t / (z * (y * 3.0))));
} else {
tmp = x + (((t / y) - y) / (z * 3.0));
}
return tmp;
}
function code(x, y, z, t) tmp = 0.0 if (t <= -1.65e-10) tmp = Float64(x + fma(-0.3333333333333333, Float64(y / z), Float64(t / Float64(z * Float64(y * 3.0))))); else tmp = Float64(x + Float64(Float64(Float64(t / y) - y) / Float64(z * 3.0))); end return tmp end
code[x_, y_, z_, t_] := If[LessEqual[t, -1.65e-10], N[(x + N[(-0.3333333333333333 * N[(y / z), $MachinePrecision] + N[(t / N[(z * N[(y * 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(N[(N[(t / y), $MachinePrecision] - y), $MachinePrecision] / N[(z * 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.65 \cdot 10^{-10}:\\
\;\;\;\;x + \mathsf{fma}\left(-0.3333333333333333, \frac{y}{z}, \frac{t}{z \cdot \left(y \cdot 3\right)}\right)\\
\mathbf{else}:\\
\;\;\;\;x + \frac{\frac{t}{y} - y}{z \cdot 3}\\
\end{array}
\end{array}
if t < -1.65e-10Initial program 98.7%
sub-neg98.7%
associate-+l+98.7%
distribute-frac-neg98.7%
neg-mul-198.7%
*-commutative98.7%
times-frac98.7%
fma-define98.7%
metadata-eval98.7%
associate-*l*99.9%
*-commutative99.9%
Simplified99.9%
if -1.65e-10 < t Initial program 95.0%
+-commutative95.0%
associate-+r-95.0%
+-commutative95.0%
associate--l+95.0%
sub-neg95.0%
remove-double-neg95.0%
distribute-frac-neg95.0%
distribute-neg-in95.0%
remove-double-neg95.0%
sub-neg95.0%
neg-mul-195.0%
times-frac97.1%
distribute-frac-neg97.1%
neg-mul-197.1%
*-commutative97.1%
associate-/l*97.1%
*-commutative97.1%
Simplified98.1%
div-inv98.1%
Applied egg-rr98.1%
div-inv98.1%
*-commutative98.1%
clear-num98.1%
un-div-inv98.1%
div-inv98.2%
metadata-eval98.2%
Applied egg-rr98.2%
(FPCore (x y z t) :precision binary64 (if (<= t -4.5e+108) (+ (/ y (* z -3.0)) (+ x (/ t (* z (* y 3.0))))) (+ x (/ (- (/ t y) y) (* z 3.0)))))
double code(double x, double y, double z, double t) {
double tmp;
if (t <= -4.5e+108) {
tmp = (y / (z * -3.0)) + (x + (t / (z * (y * 3.0))));
} else {
tmp = x + (((t / y) - y) / (z * 3.0));
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (t <= (-4.5d+108)) then
tmp = (y / (z * (-3.0d0))) + (x + (t / (z * (y * 3.0d0))))
else
tmp = x + (((t / y) - y) / (z * 3.0d0))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (t <= -4.5e+108) {
tmp = (y / (z * -3.0)) + (x + (t / (z * (y * 3.0))));
} else {
tmp = x + (((t / y) - y) / (z * 3.0));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if t <= -4.5e+108: tmp = (y / (z * -3.0)) + (x + (t / (z * (y * 3.0)))) else: tmp = x + (((t / y) - y) / (z * 3.0)) return tmp
function code(x, y, z, t) tmp = 0.0 if (t <= -4.5e+108) tmp = Float64(Float64(y / Float64(z * -3.0)) + Float64(x + Float64(t / Float64(z * Float64(y * 3.0))))); else tmp = Float64(x + Float64(Float64(Float64(t / y) - y) / Float64(z * 3.0))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (t <= -4.5e+108) tmp = (y / (z * -3.0)) + (x + (t / (z * (y * 3.0)))); else tmp = x + (((t / y) - y) / (z * 3.0)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[t, -4.5e+108], N[(N[(y / N[(z * -3.0), $MachinePrecision]), $MachinePrecision] + N[(x + N[(t / N[(z * N[(y * 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(N[(N[(t / y), $MachinePrecision] - y), $MachinePrecision] / N[(z * 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -4.5 \cdot 10^{+108}:\\
\;\;\;\;\frac{y}{z \cdot -3} + \left(x + \frac{t}{z \cdot \left(y \cdot 3\right)}\right)\\
\mathbf{else}:\\
\;\;\;\;x + \frac{\frac{t}{y} - y}{z \cdot 3}\\
\end{array}
\end{array}
if t < -4.5e108Initial program 98.1%
+-commutative98.1%
associate-+r-98.1%
sub-neg98.1%
associate-*l*99.9%
*-commutative99.9%
distribute-frac-neg299.9%
distribute-rgt-neg-in99.9%
metadata-eval99.9%
Simplified99.9%
if -4.5e108 < t Initial program 95.6%
+-commutative95.6%
associate-+r-95.6%
+-commutative95.6%
associate--l+95.6%
sub-neg95.6%
remove-double-neg95.6%
distribute-frac-neg95.6%
distribute-neg-in95.6%
remove-double-neg95.6%
sub-neg95.6%
neg-mul-195.6%
times-frac97.5%
distribute-frac-neg97.5%
neg-mul-197.5%
*-commutative97.5%
associate-/l*97.5%
*-commutative97.5%
Simplified98.3%
div-inv98.4%
Applied egg-rr98.4%
div-inv98.3%
*-commutative98.3%
clear-num98.3%
un-div-inv98.4%
div-inv98.4%
metadata-eval98.4%
Applied egg-rr98.4%
Final simplification98.7%
(FPCore (x y z t)
:precision binary64
(if (<= y -1.1e+57)
(+ x (* y (/ -0.3333333333333333 z)))
(if (<= y 2.8e+53)
(+ x (/ t (* z (* y 3.0))))
(+ x (* -0.3333333333333333 (/ 1.0 (/ z y)))))))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -1.1e+57) {
tmp = x + (y * (-0.3333333333333333 / z));
} else if (y <= 2.8e+53) {
tmp = x + (t / (z * (y * 3.0)));
} else {
tmp = x + (-0.3333333333333333 * (1.0 / (z / y)));
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (y <= (-1.1d+57)) then
tmp = x + (y * ((-0.3333333333333333d0) / z))
else if (y <= 2.8d+53) then
tmp = x + (t / (z * (y * 3.0d0)))
else
tmp = x + ((-0.3333333333333333d0) * (1.0d0 / (z / y)))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (y <= -1.1e+57) {
tmp = x + (y * (-0.3333333333333333 / z));
} else if (y <= 2.8e+53) {
tmp = x + (t / (z * (y * 3.0)));
} else {
tmp = x + (-0.3333333333333333 * (1.0 / (z / y)));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= -1.1e+57: tmp = x + (y * (-0.3333333333333333 / z)) elif y <= 2.8e+53: tmp = x + (t / (z * (y * 3.0))) else: tmp = x + (-0.3333333333333333 * (1.0 / (z / y))) return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= -1.1e+57) tmp = Float64(x + Float64(y * Float64(-0.3333333333333333 / z))); elseif (y <= 2.8e+53) tmp = Float64(x + Float64(t / Float64(z * Float64(y * 3.0)))); else tmp = Float64(x + Float64(-0.3333333333333333 * Float64(1.0 / Float64(z / y)))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (y <= -1.1e+57) tmp = x + (y * (-0.3333333333333333 / z)); elseif (y <= 2.8e+53) tmp = x + (t / (z * (y * 3.0))); else tmp = x + (-0.3333333333333333 * (1.0 / (z / y))); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, -1.1e+57], N[(x + N[(y * N[(-0.3333333333333333 / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 2.8e+53], N[(x + N[(t / N[(z * N[(y * 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(-0.3333333333333333 * N[(1.0 / N[(z / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.1 \cdot 10^{+57}:\\
\;\;\;\;x + y \cdot \frac{-0.3333333333333333}{z}\\
\mathbf{elif}\;y \leq 2.8 \cdot 10^{+53}:\\
\;\;\;\;x + \frac{t}{z \cdot \left(y \cdot 3\right)}\\
\mathbf{else}:\\
\;\;\;\;x + -0.3333333333333333 \cdot \frac{1}{\frac{z}{y}}\\
\end{array}
\end{array}
if y < -1.1e57Initial program 98.2%
+-commutative98.2%
associate-+r-98.2%
+-commutative98.2%
associate--l+98.2%
sub-neg98.2%
remove-double-neg98.2%
distribute-frac-neg98.2%
distribute-neg-in98.2%
remove-double-neg98.2%
sub-neg98.2%
neg-mul-198.2%
times-frac98.3%
distribute-frac-neg98.3%
neg-mul-198.3%
*-commutative98.3%
associate-/l*98.3%
*-commutative98.3%
Simplified99.9%
div-inv99.8%
Applied egg-rr99.8%
Taylor expanded in t around 0 98.3%
associate-*r/98.3%
associate-*l/98.3%
*-commutative98.3%
Simplified98.3%
if -1.1e57 < y < 2.8e53Initial program 94.5%
+-commutative94.5%
associate-+r-94.5%
+-commutative94.5%
associate--l+94.5%
sub-neg94.5%
remove-double-neg94.5%
distribute-frac-neg94.5%
distribute-neg-in94.5%
remove-double-neg94.5%
sub-neg94.5%
neg-mul-194.5%
times-frac93.8%
distribute-frac-neg93.8%
neg-mul-193.8%
*-commutative93.8%
associate-/l*93.8%
*-commutative93.8%
Simplified93.7%
Taylor expanded in t around inf 90.0%
associate-*r/90.1%
*-commutative90.1%
times-frac88.7%
Simplified88.7%
clear-num88.7%
frac-times89.4%
*-un-lft-identity89.4%
div-inv89.5%
metadata-eval89.5%
Applied egg-rr89.5%
Taylor expanded in z around 0 90.1%
associate-*r*90.2%
*-commutative90.2%
*-commutative90.2%
Simplified90.2%
if 2.8e53 < y Initial program 98.0%
Taylor expanded in t around 0 91.5%
clear-num91.6%
un-div-inv91.5%
Applied egg-rr91.5%
frac-2neg91.5%
metadata-eval91.5%
div-inv91.6%
distribute-neg-frac291.6%
Applied egg-rr91.6%
Final simplification92.4%
(FPCore (x y z t)
:precision binary64
(if (<= y -4.8e+49)
(+ x (* y (/ -0.3333333333333333 z)))
(if (<= y 2.8e+53)
(+ x (/ t (* z (* y 3.0))))
(- x (/ 0.3333333333333333 (/ z y))))))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -4.8e+49) {
tmp = x + (y * (-0.3333333333333333 / z));
} else if (y <= 2.8e+53) {
tmp = x + (t / (z * (y * 3.0)));
} else {
tmp = x - (0.3333333333333333 / (z / y));
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (y <= (-4.8d+49)) then
tmp = x + (y * ((-0.3333333333333333d0) / z))
else if (y <= 2.8d+53) then
tmp = x + (t / (z * (y * 3.0d0)))
else
tmp = x - (0.3333333333333333d0 / (z / y))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (y <= -4.8e+49) {
tmp = x + (y * (-0.3333333333333333 / z));
} else if (y <= 2.8e+53) {
tmp = x + (t / (z * (y * 3.0)));
} else {
tmp = x - (0.3333333333333333 / (z / y));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= -4.8e+49: tmp = x + (y * (-0.3333333333333333 / z)) elif y <= 2.8e+53: tmp = x + (t / (z * (y * 3.0))) else: tmp = x - (0.3333333333333333 / (z / y)) return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= -4.8e+49) tmp = Float64(x + Float64(y * Float64(-0.3333333333333333 / z))); elseif (y <= 2.8e+53) tmp = Float64(x + Float64(t / Float64(z * Float64(y * 3.0)))); else tmp = Float64(x - Float64(0.3333333333333333 / Float64(z / y))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (y <= -4.8e+49) tmp = x + (y * (-0.3333333333333333 / z)); elseif (y <= 2.8e+53) tmp = x + (t / (z * (y * 3.0))); else tmp = x - (0.3333333333333333 / (z / y)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, -4.8e+49], N[(x + N[(y * N[(-0.3333333333333333 / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 2.8e+53], N[(x + N[(t / N[(z * N[(y * 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x - N[(0.3333333333333333 / N[(z / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -4.8 \cdot 10^{+49}:\\
\;\;\;\;x + y \cdot \frac{-0.3333333333333333}{z}\\
\mathbf{elif}\;y \leq 2.8 \cdot 10^{+53}:\\
\;\;\;\;x + \frac{t}{z \cdot \left(y \cdot 3\right)}\\
\mathbf{else}:\\
\;\;\;\;x - \frac{0.3333333333333333}{\frac{z}{y}}\\
\end{array}
\end{array}
if y < -4.8e49Initial program 98.2%
+-commutative98.2%
associate-+r-98.2%
+-commutative98.2%
associate--l+98.2%
sub-neg98.2%
remove-double-neg98.2%
distribute-frac-neg98.2%
distribute-neg-in98.2%
remove-double-neg98.2%
sub-neg98.2%
neg-mul-198.2%
times-frac98.3%
distribute-frac-neg98.3%
neg-mul-198.3%
*-commutative98.3%
associate-/l*98.3%
*-commutative98.3%
Simplified99.9%
div-inv99.8%
Applied egg-rr99.8%
Taylor expanded in t around 0 98.3%
associate-*r/98.3%
associate-*l/98.3%
*-commutative98.3%
Simplified98.3%
if -4.8e49 < y < 2.8e53Initial program 94.5%
+-commutative94.5%
associate-+r-94.5%
+-commutative94.5%
associate--l+94.5%
sub-neg94.5%
remove-double-neg94.5%
distribute-frac-neg94.5%
distribute-neg-in94.5%
remove-double-neg94.5%
sub-neg94.5%
neg-mul-194.5%
times-frac93.8%
distribute-frac-neg93.8%
neg-mul-193.8%
*-commutative93.8%
associate-/l*93.8%
*-commutative93.8%
Simplified93.7%
Taylor expanded in t around inf 90.0%
associate-*r/90.1%
*-commutative90.1%
times-frac88.7%
Simplified88.7%
clear-num88.7%
frac-times89.4%
*-un-lft-identity89.4%
div-inv89.5%
metadata-eval89.5%
Applied egg-rr89.5%
Taylor expanded in z around 0 90.1%
associate-*r*90.2%
*-commutative90.2%
*-commutative90.2%
Simplified90.2%
if 2.8e53 < y Initial program 98.0%
Taylor expanded in t around 0 91.5%
clear-num91.6%
un-div-inv91.5%
Applied egg-rr91.5%
(FPCore (x y z t)
:precision binary64
(if (<= y -1.4e+53)
(+ x (* y (/ -0.3333333333333333 z)))
(if (<= y 1.7e+53)
(+ x (* 0.3333333333333333 (/ t (* y z))))
(- x (/ 0.3333333333333333 (/ z y))))))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -1.4e+53) {
tmp = x + (y * (-0.3333333333333333 / z));
} else if (y <= 1.7e+53) {
tmp = x + (0.3333333333333333 * (t / (y * z)));
} else {
tmp = x - (0.3333333333333333 / (z / y));
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (y <= (-1.4d+53)) then
tmp = x + (y * ((-0.3333333333333333d0) / z))
else if (y <= 1.7d+53) then
tmp = x + (0.3333333333333333d0 * (t / (y * z)))
else
tmp = x - (0.3333333333333333d0 / (z / y))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (y <= -1.4e+53) {
tmp = x + (y * (-0.3333333333333333 / z));
} else if (y <= 1.7e+53) {
tmp = x + (0.3333333333333333 * (t / (y * z)));
} else {
tmp = x - (0.3333333333333333 / (z / y));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= -1.4e+53: tmp = x + (y * (-0.3333333333333333 / z)) elif y <= 1.7e+53: tmp = x + (0.3333333333333333 * (t / (y * z))) else: tmp = x - (0.3333333333333333 / (z / y)) return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= -1.4e+53) tmp = Float64(x + Float64(y * Float64(-0.3333333333333333 / z))); elseif (y <= 1.7e+53) tmp = Float64(x + Float64(0.3333333333333333 * Float64(t / Float64(y * z)))); else tmp = Float64(x - Float64(0.3333333333333333 / Float64(z / y))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (y <= -1.4e+53) tmp = x + (y * (-0.3333333333333333 / z)); elseif (y <= 1.7e+53) tmp = x + (0.3333333333333333 * (t / (y * z))); else tmp = x - (0.3333333333333333 / (z / y)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, -1.4e+53], N[(x + N[(y * N[(-0.3333333333333333 / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.7e+53], N[(x + N[(0.3333333333333333 * N[(t / N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x - N[(0.3333333333333333 / N[(z / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.4 \cdot 10^{+53}:\\
\;\;\;\;x + y \cdot \frac{-0.3333333333333333}{z}\\
\mathbf{elif}\;y \leq 1.7 \cdot 10^{+53}:\\
\;\;\;\;x + 0.3333333333333333 \cdot \frac{t}{y \cdot z}\\
\mathbf{else}:\\
\;\;\;\;x - \frac{0.3333333333333333}{\frac{z}{y}}\\
\end{array}
\end{array}
if y < -1.4e53Initial program 98.2%
+-commutative98.2%
associate-+r-98.2%
+-commutative98.2%
associate--l+98.2%
sub-neg98.2%
remove-double-neg98.2%
distribute-frac-neg98.2%
distribute-neg-in98.2%
remove-double-neg98.2%
sub-neg98.2%
neg-mul-198.2%
times-frac98.3%
distribute-frac-neg98.3%
neg-mul-198.3%
*-commutative98.3%
associate-/l*98.3%
*-commutative98.3%
Simplified99.9%
div-inv99.8%
Applied egg-rr99.8%
Taylor expanded in t around 0 98.3%
associate-*r/98.3%
associate-*l/98.3%
*-commutative98.3%
Simplified98.3%
if -1.4e53 < y < 1.69999999999999999e53Initial program 94.5%
+-commutative94.5%
associate-+r-94.5%
+-commutative94.5%
associate--l+94.5%
sub-neg94.5%
remove-double-neg94.5%
distribute-frac-neg94.5%
distribute-neg-in94.5%
remove-double-neg94.5%
sub-neg94.5%
neg-mul-194.5%
times-frac93.8%
distribute-frac-neg93.8%
neg-mul-193.8%
*-commutative93.8%
associate-/l*93.8%
*-commutative93.8%
Simplified93.7%
Taylor expanded in t around inf 90.0%
if 1.69999999999999999e53 < y Initial program 98.0%
Taylor expanded in t around 0 91.5%
clear-num91.6%
un-div-inv91.5%
Applied egg-rr91.5%
(FPCore (x y z t) :precision binary64 (if (or (<= y -1.16e-101) (not (<= y 1.4e-40))) (- x (* (/ y z) 0.3333333333333333)) (* t (/ (/ 0.3333333333333333 z) y))))
double code(double x, double y, double z, double t) {
double tmp;
if ((y <= -1.16e-101) || !(y <= 1.4e-40)) {
tmp = x - ((y / z) * 0.3333333333333333);
} else {
tmp = t * ((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 <= (-1.16d-101)) .or. (.not. (y <= 1.4d-40))) then
tmp = x - ((y / z) * 0.3333333333333333d0)
else
tmp = t * ((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 <= -1.16e-101) || !(y <= 1.4e-40)) {
tmp = x - ((y / z) * 0.3333333333333333);
} else {
tmp = t * ((0.3333333333333333 / z) / y);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (y <= -1.16e-101) or not (y <= 1.4e-40): tmp = x - ((y / z) * 0.3333333333333333) else: tmp = t * ((0.3333333333333333 / z) / y) return tmp
function code(x, y, z, t) tmp = 0.0 if ((y <= -1.16e-101) || !(y <= 1.4e-40)) tmp = Float64(x - Float64(Float64(y / z) * 0.3333333333333333)); else tmp = Float64(t * Float64(Float64(0.3333333333333333 / z) / y)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((y <= -1.16e-101) || ~((y <= 1.4e-40))) tmp = x - ((y / z) * 0.3333333333333333); else tmp = t * ((0.3333333333333333 / z) / y); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[y, -1.16e-101], N[Not[LessEqual[y, 1.4e-40]], $MachinePrecision]], N[(x - N[(N[(y / z), $MachinePrecision] * 0.3333333333333333), $MachinePrecision]), $MachinePrecision], N[(t * N[(N[(0.3333333333333333 / z), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.16 \cdot 10^{-101} \lor \neg \left(y \leq 1.4 \cdot 10^{-40}\right):\\
\;\;\;\;x - \frac{y}{z} \cdot 0.3333333333333333\\
\mathbf{else}:\\
\;\;\;\;t \cdot \frac{\frac{0.3333333333333333}{z}}{y}\\
\end{array}
\end{array}
if y < -1.15999999999999995e-101 or 1.4e-40 < y Initial program 98.0%
Taylor expanded in t around 0 86.2%
if -1.15999999999999995e-101 < y < 1.4e-40Initial program 93.2%
+-commutative93.2%
associate-+r-93.2%
+-commutative93.2%
associate--l+93.2%
sub-neg93.2%
remove-double-neg93.2%
distribute-frac-neg93.2%
distribute-neg-in93.2%
remove-double-neg93.2%
sub-neg93.2%
neg-mul-193.2%
times-frac92.3%
distribute-frac-neg92.3%
neg-mul-192.3%
*-commutative92.3%
associate-/l*92.3%
*-commutative92.3%
Simplified92.2%
Taylor expanded in y around 0 98.8%
Taylor expanded in t around inf 73.7%
*-commutative73.7%
associate-*l/73.8%
associate-*r/73.8%
*-commutative73.8%
associate-/r*73.7%
Simplified73.7%
Final simplification81.4%
(FPCore (x y z t) :precision binary64 (if (or (<= y -9.8e-98) (not (<= y 1.35e-40))) (+ x (* y (/ -0.3333333333333333 z))) (* t (/ (/ 0.3333333333333333 z) y))))
double code(double x, double y, double z, double t) {
double tmp;
if ((y <= -9.8e-98) || !(y <= 1.35e-40)) {
tmp = x + (y * (-0.3333333333333333 / z));
} else {
tmp = t * ((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 <= (-9.8d-98)) .or. (.not. (y <= 1.35d-40))) then
tmp = x + (y * ((-0.3333333333333333d0) / z))
else
tmp = t * ((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 <= -9.8e-98) || !(y <= 1.35e-40)) {
tmp = x + (y * (-0.3333333333333333 / z));
} else {
tmp = t * ((0.3333333333333333 / z) / y);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (y <= -9.8e-98) or not (y <= 1.35e-40): tmp = x + (y * (-0.3333333333333333 / z)) else: tmp = t * ((0.3333333333333333 / z) / y) return tmp
function code(x, y, z, t) tmp = 0.0 if ((y <= -9.8e-98) || !(y <= 1.35e-40)) tmp = Float64(x + Float64(y * Float64(-0.3333333333333333 / z))); else tmp = Float64(t * Float64(Float64(0.3333333333333333 / z) / y)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((y <= -9.8e-98) || ~((y <= 1.35e-40))) tmp = x + (y * (-0.3333333333333333 / z)); else tmp = t * ((0.3333333333333333 / z) / y); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[y, -9.8e-98], N[Not[LessEqual[y, 1.35e-40]], $MachinePrecision]], N[(x + N[(y * N[(-0.3333333333333333 / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t * N[(N[(0.3333333333333333 / z), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -9.8 \cdot 10^{-98} \lor \neg \left(y \leq 1.35 \cdot 10^{-40}\right):\\
\;\;\;\;x + y \cdot \frac{-0.3333333333333333}{z}\\
\mathbf{else}:\\
\;\;\;\;t \cdot \frac{\frac{0.3333333333333333}{z}}{y}\\
\end{array}
\end{array}
if y < -9.80000000000000028e-98 or 1.35e-40 < y Initial program 98.0%
+-commutative98.0%
associate-+r-98.0%
+-commutative98.0%
associate--l+98.0%
sub-neg98.0%
remove-double-neg98.0%
distribute-frac-neg98.0%
distribute-neg-in98.0%
remove-double-neg98.0%
sub-neg98.0%
neg-mul-198.0%
times-frac97.9%
distribute-frac-neg97.9%
neg-mul-197.9%
*-commutative97.9%
associate-/l*97.9%
*-commutative97.9%
Simplified99.1%
div-inv99.1%
Applied egg-rr99.1%
Taylor expanded in t around 0 86.2%
associate-*r/86.2%
associate-*l/86.1%
*-commutative86.1%
Simplified86.1%
if -9.80000000000000028e-98 < y < 1.35e-40Initial program 93.2%
+-commutative93.2%
associate-+r-93.2%
+-commutative93.2%
associate--l+93.2%
sub-neg93.2%
remove-double-neg93.2%
distribute-frac-neg93.2%
distribute-neg-in93.2%
remove-double-neg93.2%
sub-neg93.2%
neg-mul-193.2%
times-frac92.3%
distribute-frac-neg92.3%
neg-mul-192.3%
*-commutative92.3%
associate-/l*92.3%
*-commutative92.3%
Simplified92.2%
Taylor expanded in y around 0 98.8%
Taylor expanded in t around inf 73.7%
*-commutative73.7%
associate-*l/73.8%
associate-*r/73.8%
*-commutative73.8%
associate-/r*73.7%
Simplified73.7%
Final simplification81.3%
(FPCore (x y z t)
:precision binary64
(if (<= y -1.85e-100)
(- x (* (/ y z) 0.3333333333333333))
(if (<= y 1.4e-40)
(/ (* 0.3333333333333333 (/ t z)) y)
(- x (/ 0.3333333333333333 (/ z y))))))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -1.85e-100) {
tmp = x - ((y / z) * 0.3333333333333333);
} else if (y <= 1.4e-40) {
tmp = (0.3333333333333333 * (t / z)) / y;
} else {
tmp = x - (0.3333333333333333 / (z / y));
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (y <= (-1.85d-100)) then
tmp = x - ((y / z) * 0.3333333333333333d0)
else if (y <= 1.4d-40) then
tmp = (0.3333333333333333d0 * (t / z)) / y
else
tmp = x - (0.3333333333333333d0 / (z / y))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (y <= -1.85e-100) {
tmp = x - ((y / z) * 0.3333333333333333);
} else if (y <= 1.4e-40) {
tmp = (0.3333333333333333 * (t / z)) / y;
} else {
tmp = x - (0.3333333333333333 / (z / y));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= -1.85e-100: tmp = x - ((y / z) * 0.3333333333333333) elif y <= 1.4e-40: tmp = (0.3333333333333333 * (t / z)) / y else: tmp = x - (0.3333333333333333 / (z / y)) return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= -1.85e-100) tmp = Float64(x - Float64(Float64(y / z) * 0.3333333333333333)); elseif (y <= 1.4e-40) tmp = Float64(Float64(0.3333333333333333 * Float64(t / z)) / y); else tmp = Float64(x - Float64(0.3333333333333333 / Float64(z / y))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (y <= -1.85e-100) tmp = x - ((y / z) * 0.3333333333333333); elseif (y <= 1.4e-40) tmp = (0.3333333333333333 * (t / z)) / y; else tmp = x - (0.3333333333333333 / (z / y)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, -1.85e-100], N[(x - N[(N[(y / z), $MachinePrecision] * 0.3333333333333333), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.4e-40], N[(N[(0.3333333333333333 * N[(t / z), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision], N[(x - N[(0.3333333333333333 / N[(z / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.85 \cdot 10^{-100}:\\
\;\;\;\;x - \frac{y}{z} \cdot 0.3333333333333333\\
\mathbf{elif}\;y \leq 1.4 \cdot 10^{-40}:\\
\;\;\;\;\frac{0.3333333333333333 \cdot \frac{t}{z}}{y}\\
\mathbf{else}:\\
\;\;\;\;x - \frac{0.3333333333333333}{\frac{z}{y}}\\
\end{array}
\end{array}
if y < -1.85000000000000009e-100Initial program 97.5%
Taylor expanded in t around 0 90.4%
if -1.85000000000000009e-100 < y < 1.4e-40Initial program 93.2%
+-commutative93.2%
associate-+r-93.2%
+-commutative93.2%
associate--l+93.2%
sub-neg93.2%
remove-double-neg93.2%
distribute-frac-neg93.2%
distribute-neg-in93.2%
remove-double-neg93.2%
sub-neg93.2%
neg-mul-193.2%
times-frac92.3%
distribute-frac-neg92.3%
neg-mul-192.3%
*-commutative92.3%
associate-/l*92.3%
*-commutative92.3%
Simplified92.2%
Taylor expanded in y around 0 98.8%
Taylor expanded in t around inf 80.4%
if 1.4e-40 < y Initial program 98.5%
Taylor expanded in t around 0 81.7%
clear-num81.8%
un-div-inv81.8%
Applied egg-rr81.8%
Final simplification84.0%
(FPCore (x y z t)
:precision binary64
(if (<= y -9.5e-98)
(- x (* (/ y z) 0.3333333333333333))
(if (<= y 1.4e-40)
(/ (* t 0.3333333333333333) (* y z))
(- x (/ 0.3333333333333333 (/ z y))))))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -9.5e-98) {
tmp = x - ((y / z) * 0.3333333333333333);
} else if (y <= 1.4e-40) {
tmp = (t * 0.3333333333333333) / (y * z);
} else {
tmp = x - (0.3333333333333333 / (z / y));
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (y <= (-9.5d-98)) then
tmp = x - ((y / z) * 0.3333333333333333d0)
else if (y <= 1.4d-40) then
tmp = (t * 0.3333333333333333d0) / (y * z)
else
tmp = x - (0.3333333333333333d0 / (z / y))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (y <= -9.5e-98) {
tmp = x - ((y / z) * 0.3333333333333333);
} else if (y <= 1.4e-40) {
tmp = (t * 0.3333333333333333) / (y * z);
} else {
tmp = x - (0.3333333333333333 / (z / y));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= -9.5e-98: tmp = x - ((y / z) * 0.3333333333333333) elif y <= 1.4e-40: tmp = (t * 0.3333333333333333) / (y * z) else: tmp = x - (0.3333333333333333 / (z / y)) return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= -9.5e-98) tmp = Float64(x - Float64(Float64(y / z) * 0.3333333333333333)); elseif (y <= 1.4e-40) tmp = Float64(Float64(t * 0.3333333333333333) / Float64(y * z)); else tmp = Float64(x - Float64(0.3333333333333333 / Float64(z / y))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (y <= -9.5e-98) tmp = x - ((y / z) * 0.3333333333333333); elseif (y <= 1.4e-40) tmp = (t * 0.3333333333333333) / (y * z); else tmp = x - (0.3333333333333333 / (z / y)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, -9.5e-98], N[(x - N[(N[(y / z), $MachinePrecision] * 0.3333333333333333), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.4e-40], N[(N[(t * 0.3333333333333333), $MachinePrecision] / N[(y * z), $MachinePrecision]), $MachinePrecision], N[(x - N[(0.3333333333333333 / N[(z / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -9.5 \cdot 10^{-98}:\\
\;\;\;\;x - \frac{y}{z} \cdot 0.3333333333333333\\
\mathbf{elif}\;y \leq 1.4 \cdot 10^{-40}:\\
\;\;\;\;\frac{t \cdot 0.3333333333333333}{y \cdot z}\\
\mathbf{else}:\\
\;\;\;\;x - \frac{0.3333333333333333}{\frac{z}{y}}\\
\end{array}
\end{array}
if y < -9.5000000000000001e-98Initial program 97.5%
Taylor expanded in t around 0 90.4%
if -9.5000000000000001e-98 < y < 1.4e-40Initial program 93.2%
+-commutative93.2%
associate-+r-93.2%
+-commutative93.2%
associate--l+93.2%
sub-neg93.2%
remove-double-neg93.2%
distribute-frac-neg93.2%
distribute-neg-in93.2%
remove-double-neg93.2%
sub-neg93.2%
neg-mul-193.2%
times-frac92.3%
distribute-frac-neg92.3%
neg-mul-192.3%
*-commutative92.3%
associate-/l*92.3%
*-commutative92.3%
Simplified92.2%
Taylor expanded in y around 0 98.8%
Taylor expanded in t around inf 73.7%
associate-*r/73.8%
Simplified73.8%
if 1.4e-40 < y Initial program 98.5%
Taylor expanded in t around 0 81.7%
clear-num81.8%
un-div-inv81.8%
Applied egg-rr81.8%
Final simplification81.4%
(FPCore (x y z t)
:precision binary64
(if (<= y -1.32e-97)
(- x (* (/ y z) 0.3333333333333333))
(if (<= y 1.35e-40)
(* t (/ (/ 0.3333333333333333 z) y))
(- x (/ 0.3333333333333333 (/ z y))))))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -1.32e-97) {
tmp = x - ((y / z) * 0.3333333333333333);
} else if (y <= 1.35e-40) {
tmp = t * ((0.3333333333333333 / z) / y);
} else {
tmp = x - (0.3333333333333333 / (z / y));
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (y <= (-1.32d-97)) then
tmp = x - ((y / z) * 0.3333333333333333d0)
else if (y <= 1.35d-40) then
tmp = t * ((0.3333333333333333d0 / z) / y)
else
tmp = x - (0.3333333333333333d0 / (z / y))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (y <= -1.32e-97) {
tmp = x - ((y / z) * 0.3333333333333333);
} else if (y <= 1.35e-40) {
tmp = t * ((0.3333333333333333 / z) / y);
} else {
tmp = x - (0.3333333333333333 / (z / y));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= -1.32e-97: tmp = x - ((y / z) * 0.3333333333333333) elif y <= 1.35e-40: tmp = t * ((0.3333333333333333 / z) / y) else: tmp = x - (0.3333333333333333 / (z / y)) return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= -1.32e-97) tmp = Float64(x - Float64(Float64(y / z) * 0.3333333333333333)); elseif (y <= 1.35e-40) tmp = Float64(t * Float64(Float64(0.3333333333333333 / z) / y)); else tmp = Float64(x - Float64(0.3333333333333333 / Float64(z / y))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (y <= -1.32e-97) tmp = x - ((y / z) * 0.3333333333333333); elseif (y <= 1.35e-40) tmp = t * ((0.3333333333333333 / z) / y); else tmp = x - (0.3333333333333333 / (z / y)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, -1.32e-97], N[(x - N[(N[(y / z), $MachinePrecision] * 0.3333333333333333), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.35e-40], N[(t * N[(N[(0.3333333333333333 / z), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision], N[(x - N[(0.3333333333333333 / N[(z / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.32 \cdot 10^{-97}:\\
\;\;\;\;x - \frac{y}{z} \cdot 0.3333333333333333\\
\mathbf{elif}\;y \leq 1.35 \cdot 10^{-40}:\\
\;\;\;\;t \cdot \frac{\frac{0.3333333333333333}{z}}{y}\\
\mathbf{else}:\\
\;\;\;\;x - \frac{0.3333333333333333}{\frac{z}{y}}\\
\end{array}
\end{array}
if y < -1.32e-97Initial program 97.5%
Taylor expanded in t around 0 90.4%
if -1.32e-97 < y < 1.35e-40Initial program 93.2%
+-commutative93.2%
associate-+r-93.2%
+-commutative93.2%
associate--l+93.2%
sub-neg93.2%
remove-double-neg93.2%
distribute-frac-neg93.2%
distribute-neg-in93.2%
remove-double-neg93.2%
sub-neg93.2%
neg-mul-193.2%
times-frac92.3%
distribute-frac-neg92.3%
neg-mul-192.3%
*-commutative92.3%
associate-/l*92.3%
*-commutative92.3%
Simplified92.2%
Taylor expanded in y around 0 98.8%
Taylor expanded in t around inf 73.7%
*-commutative73.7%
associate-*l/73.8%
associate-*r/73.8%
*-commutative73.8%
associate-/r*73.7%
Simplified73.7%
if 1.35e-40 < y Initial program 98.5%
Taylor expanded in t around 0 81.7%
clear-num81.8%
un-div-inv81.8%
Applied egg-rr81.8%
Final simplification81.4%
(FPCore (x y z t)
:precision binary64
(if (<= y -9e+49)
(/ y (* z -3.0))
(if (<= y 1.15e+53)
(* t (/ (/ 0.3333333333333333 z) y))
(/ (* -0.3333333333333333 y) z))))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -9e+49) {
tmp = y / (z * -3.0);
} else if (y <= 1.15e+53) {
tmp = t * ((0.3333333333333333 / z) / y);
} else {
tmp = (-0.3333333333333333 * y) / z;
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (y <= (-9d+49)) then
tmp = y / (z * (-3.0d0))
else if (y <= 1.15d+53) then
tmp = t * ((0.3333333333333333d0 / z) / y)
else
tmp = ((-0.3333333333333333d0) * y) / z
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (y <= -9e+49) {
tmp = y / (z * -3.0);
} else if (y <= 1.15e+53) {
tmp = t * ((0.3333333333333333 / z) / y);
} else {
tmp = (-0.3333333333333333 * y) / z;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= -9e+49: tmp = y / (z * -3.0) elif y <= 1.15e+53: tmp = t * ((0.3333333333333333 / z) / y) else: tmp = (-0.3333333333333333 * y) / z return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= -9e+49) tmp = Float64(y / Float64(z * -3.0)); elseif (y <= 1.15e+53) tmp = Float64(t * Float64(Float64(0.3333333333333333 / z) / y)); else tmp = Float64(Float64(-0.3333333333333333 * y) / z); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (y <= -9e+49) tmp = y / (z * -3.0); elseif (y <= 1.15e+53) tmp = t * ((0.3333333333333333 / z) / y); else tmp = (-0.3333333333333333 * y) / z; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, -9e+49], N[(y / N[(z * -3.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.15e+53], N[(t * N[(N[(0.3333333333333333 / z), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision], N[(N[(-0.3333333333333333 * y), $MachinePrecision] / z), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -9 \cdot 10^{+49}:\\
\;\;\;\;\frac{y}{z \cdot -3}\\
\mathbf{elif}\;y \leq 1.15 \cdot 10^{+53}:\\
\;\;\;\;t \cdot \frac{\frac{0.3333333333333333}{z}}{y}\\
\mathbf{else}:\\
\;\;\;\;\frac{-0.3333333333333333 \cdot y}{z}\\
\end{array}
\end{array}
if y < -8.99999999999999965e49Initial program 98.2%
+-commutative98.2%
associate-+r-98.2%
+-commutative98.2%
associate--l+98.2%
sub-neg98.2%
remove-double-neg98.2%
distribute-frac-neg98.2%
distribute-neg-in98.2%
remove-double-neg98.2%
sub-neg98.2%
neg-mul-198.2%
times-frac98.3%
distribute-frac-neg98.3%
neg-mul-198.3%
*-commutative98.3%
associate-/l*98.3%
*-commutative98.3%
Simplified99.9%
Taylor expanded in y around inf 98.2%
associate-*r/98.3%
metadata-eval98.3%
Simplified98.3%
Taylor expanded in x around 0 75.8%
clear-num75.8%
un-div-inv75.8%
div-inv75.9%
metadata-eval75.9%
Applied egg-rr75.9%
if -8.99999999999999965e49 < y < 1.1500000000000001e53Initial program 94.5%
+-commutative94.5%
associate-+r-94.5%
+-commutative94.5%
associate--l+94.5%
sub-neg94.5%
remove-double-neg94.5%
distribute-frac-neg94.5%
distribute-neg-in94.5%
remove-double-neg94.5%
sub-neg94.5%
neg-mul-194.5%
times-frac93.8%
distribute-frac-neg93.8%
neg-mul-193.8%
*-commutative93.8%
associate-/l*93.8%
*-commutative93.8%
Simplified93.7%
Taylor expanded in y around 0 94.7%
Taylor expanded in t around inf 63.4%
*-commutative63.4%
associate-*l/63.5%
associate-*r/63.4%
*-commutative63.4%
associate-/r*63.4%
Simplified63.4%
if 1.1500000000000001e53 < y Initial program 98.0%
+-commutative98.0%
associate-+r-98.0%
+-commutative98.0%
associate--l+98.0%
sub-neg98.0%
remove-double-neg98.0%
distribute-frac-neg98.0%
distribute-neg-in98.0%
remove-double-neg98.0%
sub-neg98.0%
neg-mul-198.0%
times-frac98.0%
distribute-frac-neg98.0%
neg-mul-198.0%
*-commutative98.0%
associate-/l*98.0%
*-commutative98.0%
Simplified99.6%
Taylor expanded in y around inf 91.3%
associate-*r/91.3%
metadata-eval91.3%
Simplified91.3%
Taylor expanded in x around 0 68.4%
associate-*r/68.7%
Applied egg-rr68.7%
Final simplification67.4%
(FPCore (x y z t) :precision binary64 (if (<= z -2.7e-7) x (if (<= z 3e+52) (/ y (* z -3.0)) x)))
double code(double x, double y, double z, double t) {
double tmp;
if (z <= -2.7e-7) {
tmp = x;
} else if (z <= 3e+52) {
tmp = y / (z * -3.0);
} else {
tmp = x;
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (z <= (-2.7d-7)) then
tmp = x
else if (z <= 3d+52) then
tmp = y / (z * (-3.0d0))
else
tmp = x
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (z <= -2.7e-7) {
tmp = x;
} else if (z <= 3e+52) {
tmp = y / (z * -3.0);
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if z <= -2.7e-7: tmp = x elif z <= 3e+52: tmp = y / (z * -3.0) else: tmp = x return tmp
function code(x, y, z, t) tmp = 0.0 if (z <= -2.7e-7) tmp = x; elseif (z <= 3e+52) tmp = Float64(y / Float64(z * -3.0)); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (z <= -2.7e-7) tmp = x; elseif (z <= 3e+52) tmp = y / (z * -3.0); else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[z, -2.7e-7], x, If[LessEqual[z, 3e+52], N[(y / N[(z * -3.0), $MachinePrecision]), $MachinePrecision], x]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.7 \cdot 10^{-7}:\\
\;\;\;\;x\\
\mathbf{elif}\;z \leq 3 \cdot 10^{+52}:\\
\;\;\;\;\frac{y}{z \cdot -3}\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if z < -2.70000000000000009e-7 or 3e52 < z Initial program 99.0%
+-commutative99.0%
associate-+r-99.0%
+-commutative99.0%
associate--l+99.0%
sub-neg99.0%
remove-double-neg99.0%
distribute-frac-neg99.0%
distribute-neg-in99.0%
remove-double-neg99.0%
sub-neg99.0%
neg-mul-199.0%
times-frac92.0%
distribute-frac-neg92.0%
neg-mul-192.0%
*-commutative92.0%
associate-/l*92.1%
*-commutative92.1%
Simplified92.1%
Taylor expanded in x around inf 56.5%
if -2.70000000000000009e-7 < z < 3e52Initial program 94.0%
+-commutative94.0%
associate-+r-94.0%
+-commutative94.0%
associate--l+94.0%
sub-neg94.0%
remove-double-neg94.0%
distribute-frac-neg94.0%
distribute-neg-in94.0%
remove-double-neg94.0%
sub-neg94.0%
neg-mul-194.0%
times-frac98.5%
distribute-frac-neg98.5%
neg-mul-198.5%
*-commutative98.5%
associate-/l*98.5%
*-commutative98.5%
Simplified99.7%
Taylor expanded in y around inf 56.2%
associate-*r/56.2%
metadata-eval56.2%
Simplified56.2%
Taylor expanded in x around 0 48.8%
clear-num48.8%
un-div-inv48.8%
div-inv48.9%
metadata-eval48.9%
Applied egg-rr48.9%
(FPCore (x y z t) :precision binary64 (if (<= z -5.2e-8) x (if (<= z 2.7e+50) (* -0.3333333333333333 (/ y z)) x)))
double code(double x, double y, double z, double t) {
double tmp;
if (z <= -5.2e-8) {
tmp = x;
} else if (z <= 2.7e+50) {
tmp = -0.3333333333333333 * (y / z);
} else {
tmp = x;
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (z <= (-5.2d-8)) then
tmp = x
else if (z <= 2.7d+50) then
tmp = (-0.3333333333333333d0) * (y / z)
else
tmp = x
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (z <= -5.2e-8) {
tmp = x;
} else if (z <= 2.7e+50) {
tmp = -0.3333333333333333 * (y / z);
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if z <= -5.2e-8: tmp = x elif z <= 2.7e+50: tmp = -0.3333333333333333 * (y / z) else: tmp = x return tmp
function code(x, y, z, t) tmp = 0.0 if (z <= -5.2e-8) tmp = x; elseif (z <= 2.7e+50) tmp = Float64(-0.3333333333333333 * Float64(y / z)); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (z <= -5.2e-8) tmp = x; elseif (z <= 2.7e+50) tmp = -0.3333333333333333 * (y / z); else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[z, -5.2e-8], x, If[LessEqual[z, 2.7e+50], N[(-0.3333333333333333 * N[(y / z), $MachinePrecision]), $MachinePrecision], x]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -5.2 \cdot 10^{-8}:\\
\;\;\;\;x\\
\mathbf{elif}\;z \leq 2.7 \cdot 10^{+50}:\\
\;\;\;\;-0.3333333333333333 \cdot \frac{y}{z}\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if z < -5.2000000000000002e-8 or 2.7e50 < z Initial program 99.0%
+-commutative99.0%
associate-+r-99.0%
+-commutative99.0%
associate--l+99.0%
sub-neg99.0%
remove-double-neg99.0%
distribute-frac-neg99.0%
distribute-neg-in99.0%
remove-double-neg99.0%
sub-neg99.0%
neg-mul-199.0%
times-frac92.0%
distribute-frac-neg92.0%
neg-mul-192.0%
*-commutative92.0%
associate-/l*92.1%
*-commutative92.1%
Simplified92.1%
Taylor expanded in x around inf 56.5%
if -5.2000000000000002e-8 < z < 2.7e50Initial program 94.0%
+-commutative94.0%
associate-+r-94.0%
+-commutative94.0%
associate--l+94.0%
sub-neg94.0%
remove-double-neg94.0%
distribute-frac-neg94.0%
distribute-neg-in94.0%
remove-double-neg94.0%
sub-neg94.0%
neg-mul-194.0%
times-frac98.5%
distribute-frac-neg98.5%
neg-mul-198.5%
*-commutative98.5%
associate-/l*98.5%
*-commutative98.5%
Simplified99.7%
Taylor expanded in y around inf 56.2%
associate-*r/56.2%
metadata-eval56.2%
Simplified56.2%
Taylor expanded in x around 0 48.8%
associate-*r/48.8%
Applied egg-rr48.8%
Taylor expanded in y around 0 48.8%
(FPCore (x y z t) :precision binary64 (+ x (/ (- (/ t y) y) (* z 3.0))))
double code(double x, double y, double z, double t) {
return x + (((t / y) - 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 + (((t / y) - y) / (z * 3.0d0))
end function
public static double code(double x, double y, double z, double t) {
return x + (((t / y) - y) / (z * 3.0));
}
def code(x, y, z, t): return x + (((t / y) - y) / (z * 3.0))
function code(x, y, z, t) return Float64(x + Float64(Float64(Float64(t / y) - y) / Float64(z * 3.0))) end
function tmp = code(x, y, z, t) tmp = x + (((t / y) - y) / (z * 3.0)); end
code[x_, y_, z_, t_] := N[(x + N[(N[(N[(t / y), $MachinePrecision] - y), $MachinePrecision] / N[(z * 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \frac{\frac{t}{y} - y}{z \cdot 3}
\end{array}
Initial program 96.1%
+-commutative96.1%
associate-+r-96.1%
+-commutative96.1%
associate--l+96.1%
sub-neg96.1%
remove-double-neg96.1%
distribute-frac-neg96.1%
distribute-neg-in96.1%
remove-double-neg96.1%
sub-neg96.1%
neg-mul-196.1%
times-frac95.7%
distribute-frac-neg95.7%
neg-mul-195.7%
*-commutative95.7%
associate-/l*95.7%
*-commutative95.7%
Simplified96.4%
div-inv96.5%
Applied egg-rr96.5%
div-inv96.4%
*-commutative96.4%
clear-num96.4%
un-div-inv96.4%
div-inv96.5%
metadata-eval96.5%
Applied egg-rr96.5%
(FPCore (x y z t) :precision binary64 (+ x (* (- (/ t y) y) (/ 0.3333333333333333 z))))
double code(double x, double y, double z, double t) {
return x + (((t / y) - 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 + (((t / y) - y) * (0.3333333333333333d0 / z))
end function
public static double code(double x, double y, double z, double t) {
return x + (((t / y) - y) * (0.3333333333333333 / z));
}
def code(x, y, z, t): return x + (((t / y) - y) * (0.3333333333333333 / z))
function code(x, y, z, t) return Float64(x + Float64(Float64(Float64(t / y) - y) * Float64(0.3333333333333333 / z))) end
function tmp = code(x, y, z, t) tmp = x + (((t / y) - y) * (0.3333333333333333 / z)); end
code[x_, y_, z_, t_] := N[(x + N[(N[(N[(t / y), $MachinePrecision] - y), $MachinePrecision] * N[(0.3333333333333333 / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \left(\frac{t}{y} - y\right) \cdot \frac{0.3333333333333333}{z}
\end{array}
Initial program 96.1%
+-commutative96.1%
associate-+r-96.1%
+-commutative96.1%
associate--l+96.1%
sub-neg96.1%
remove-double-neg96.1%
distribute-frac-neg96.1%
distribute-neg-in96.1%
remove-double-neg96.1%
sub-neg96.1%
neg-mul-196.1%
times-frac95.7%
distribute-frac-neg95.7%
neg-mul-195.7%
*-commutative95.7%
associate-/l*95.7%
*-commutative95.7%
Simplified96.4%
Final simplification96.4%
(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(0.3333333333333333 * Float64(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[(0.3333333333333333 * N[(N[(N[(t / y), $MachinePrecision] - y), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + 0.3333333333333333 \cdot \frac{\frac{t}{y} - y}{z}
\end{array}
Initial program 96.1%
+-commutative96.1%
associate-+r-96.1%
+-commutative96.1%
associate--l+96.1%
sub-neg96.1%
remove-double-neg96.1%
distribute-frac-neg96.1%
distribute-neg-in96.1%
remove-double-neg96.1%
sub-neg96.1%
neg-mul-196.1%
times-frac95.7%
distribute-frac-neg95.7%
neg-mul-195.7%
*-commutative95.7%
associate-/l*95.7%
*-commutative95.7%
Simplified96.4%
Taylor expanded in z around 0 96.4%
(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.1%
+-commutative96.1%
associate-+r-96.1%
+-commutative96.1%
associate--l+96.1%
sub-neg96.1%
remove-double-neg96.1%
distribute-frac-neg96.1%
distribute-neg-in96.1%
remove-double-neg96.1%
sub-neg96.1%
neg-mul-196.1%
times-frac95.7%
distribute-frac-neg95.7%
neg-mul-195.7%
*-commutative95.7%
associate-/l*95.7%
*-commutative95.7%
Simplified96.4%
Taylor expanded in x around inf 27.4%
(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 2024100
(FPCore (x y z t)
:name "Diagrams.Solve.Polynomial:cubForm from diagrams-solve-0.1, H"
:precision binary64
:alt
(+ (- x (/ y (* z 3.0))) (/ (/ t (* z 3.0)) y))
(+ (- x (/ y (* z 3.0))) (/ t (* (* z 3.0) y))))