
(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 13 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 (<= (+ (- x (/ y (* z 3.0))) (/ t (* y (* z 3.0)))) 2e+290) (+ x (fma -0.3333333333333333 (/ y z) (/ t (* z (* y 3.0))))) (+ x (* (/ 0.3333333333333333 z) (- (/ t y) y)))))
double code(double x, double y, double z, double t) {
double tmp;
if (((x - (y / (z * 3.0))) + (t / (y * (z * 3.0)))) <= 2e+290) {
tmp = x + fma(-0.3333333333333333, (y / z), (t / (z * (y * 3.0))));
} else {
tmp = x + ((0.3333333333333333 / z) * ((t / y) - y));
}
return tmp;
}
function code(x, y, z, t) tmp = 0.0 if (Float64(Float64(x - Float64(y / Float64(z * 3.0))) + Float64(t / Float64(y * Float64(z * 3.0)))) <= 2e+290) tmp = Float64(x + fma(-0.3333333333333333, Float64(y / z), Float64(t / Float64(z * Float64(y * 3.0))))); else tmp = Float64(x + Float64(Float64(0.3333333333333333 / z) * Float64(Float64(t / y) - y))); end return tmp end
code[x_, y_, z_, t_] := If[LessEqual[N[(N[(x - N[(y / N[(z * 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(t / N[(y * N[(z * 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 2e+290], 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[(0.3333333333333333 / z), $MachinePrecision] * N[(N[(t / y), $MachinePrecision] - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\left(x - \frac{y}{z \cdot 3}\right) + \frac{t}{y \cdot \left(z \cdot 3\right)} \leq 2 \cdot 10^{+290}:\\
\;\;\;\;x + \mathsf{fma}\left(-0.3333333333333333, \frac{y}{z}, \frac{t}{z \cdot \left(y \cdot 3\right)}\right)\\
\mathbf{else}:\\
\;\;\;\;x + \frac{0.3333333333333333}{z} \cdot \left(\frac{t}{y} - y\right)\\
\end{array}
\end{array}
if (+.f64 (-.f64 x (/.f64 y (*.f64 z #s(literal 3 binary64)))) (/.f64 t (*.f64 (*.f64 z #s(literal 3 binary64)) y))) < 2.00000000000000012e290Initial program 97.9%
sub-neg97.9%
associate-+l+97.9%
distribute-frac-neg97.9%
neg-mul-197.9%
*-commutative97.9%
times-frac97.9%
fma-define97.9%
metadata-eval97.9%
associate-*l*97.9%
*-commutative97.9%
Simplified97.9%
if 2.00000000000000012e290 < (+.f64 (-.f64 x (/.f64 y (*.f64 z #s(literal 3 binary64)))) (/.f64 t (*.f64 (*.f64 z #s(literal 3 binary64)) y))) Initial program 90.8%
+-commutative90.8%
associate-+r-90.8%
+-commutative90.8%
associate--l+90.8%
sub-neg90.8%
remove-double-neg90.8%
distribute-frac-neg90.8%
distribute-neg-in90.8%
remove-double-neg90.8%
sub-neg90.8%
neg-mul-190.8%
times-frac96.2%
distribute-frac-neg96.2%
neg-mul-196.2%
*-commutative96.2%
associate-/l*96.2%
*-commutative96.2%
Simplified100.0%
Final simplification98.4%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* y (/ -0.3333333333333333 z)))
(t_2 (* t (/ 0.3333333333333333 (* y z)))))
(if (<= y -1.7e+101)
t_1
(if (<= y -3e+39)
x
(if (<= y -1820000000000.0)
t_1
(if (<= y -4e-158)
x
(if (<= y 2.5e-116)
t_2
(if (<= y 4.5e-93)
x
(if (<= y 1.75e+14) t_2 (* -0.3333333333333333 (/ y z)))))))))))
double code(double x, double y, double z, double t) {
double t_1 = y * (-0.3333333333333333 / z);
double t_2 = t * (0.3333333333333333 / (y * z));
double tmp;
if (y <= -1.7e+101) {
tmp = t_1;
} else if (y <= -3e+39) {
tmp = x;
} else if (y <= -1820000000000.0) {
tmp = t_1;
} else if (y <= -4e-158) {
tmp = x;
} else if (y <= 2.5e-116) {
tmp = t_2;
} else if (y <= 4.5e-93) {
tmp = x;
} else if (y <= 1.75e+14) {
tmp = t_2;
} 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) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = y * ((-0.3333333333333333d0) / z)
t_2 = t * (0.3333333333333333d0 / (y * z))
if (y <= (-1.7d+101)) then
tmp = t_1
else if (y <= (-3d+39)) then
tmp = x
else if (y <= (-1820000000000.0d0)) then
tmp = t_1
else if (y <= (-4d-158)) then
tmp = x
else if (y <= 2.5d-116) then
tmp = t_2
else if (y <= 4.5d-93) then
tmp = x
else if (y <= 1.75d+14) then
tmp = t_2
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 t_1 = y * (-0.3333333333333333 / z);
double t_2 = t * (0.3333333333333333 / (y * z));
double tmp;
if (y <= -1.7e+101) {
tmp = t_1;
} else if (y <= -3e+39) {
tmp = x;
} else if (y <= -1820000000000.0) {
tmp = t_1;
} else if (y <= -4e-158) {
tmp = x;
} else if (y <= 2.5e-116) {
tmp = t_2;
} else if (y <= 4.5e-93) {
tmp = x;
} else if (y <= 1.75e+14) {
tmp = t_2;
} else {
tmp = -0.3333333333333333 * (y / z);
}
return tmp;
}
def code(x, y, z, t): t_1 = y * (-0.3333333333333333 / z) t_2 = t * (0.3333333333333333 / (y * z)) tmp = 0 if y <= -1.7e+101: tmp = t_1 elif y <= -3e+39: tmp = x elif y <= -1820000000000.0: tmp = t_1 elif y <= -4e-158: tmp = x elif y <= 2.5e-116: tmp = t_2 elif y <= 4.5e-93: tmp = x elif y <= 1.75e+14: tmp = t_2 else: tmp = -0.3333333333333333 * (y / z) return tmp
function code(x, y, z, t) t_1 = Float64(y * Float64(-0.3333333333333333 / z)) t_2 = Float64(t * Float64(0.3333333333333333 / Float64(y * z))) tmp = 0.0 if (y <= -1.7e+101) tmp = t_1; elseif (y <= -3e+39) tmp = x; elseif (y <= -1820000000000.0) tmp = t_1; elseif (y <= -4e-158) tmp = x; elseif (y <= 2.5e-116) tmp = t_2; elseif (y <= 4.5e-93) tmp = x; elseif (y <= 1.75e+14) tmp = t_2; else tmp = Float64(-0.3333333333333333 * Float64(y / z)); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = y * (-0.3333333333333333 / z); t_2 = t * (0.3333333333333333 / (y * z)); tmp = 0.0; if (y <= -1.7e+101) tmp = t_1; elseif (y <= -3e+39) tmp = x; elseif (y <= -1820000000000.0) tmp = t_1; elseif (y <= -4e-158) tmp = x; elseif (y <= 2.5e-116) tmp = t_2; elseif (y <= 4.5e-93) tmp = x; elseif (y <= 1.75e+14) tmp = t_2; else tmp = -0.3333333333333333 * (y / z); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(y * N[(-0.3333333333333333 / z), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(t * N[(0.3333333333333333 / N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -1.7e+101], t$95$1, If[LessEqual[y, -3e+39], x, If[LessEqual[y, -1820000000000.0], t$95$1, If[LessEqual[y, -4e-158], x, If[LessEqual[y, 2.5e-116], t$95$2, If[LessEqual[y, 4.5e-93], x, If[LessEqual[y, 1.75e+14], t$95$2, N[(-0.3333333333333333 * N[(y / z), $MachinePrecision]), $MachinePrecision]]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := y \cdot \frac{-0.3333333333333333}{z}\\
t_2 := t \cdot \frac{0.3333333333333333}{y \cdot z}\\
\mathbf{if}\;y \leq -1.7 \cdot 10^{+101}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq -3 \cdot 10^{+39}:\\
\;\;\;\;x\\
\mathbf{elif}\;y \leq -1820000000000:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq -4 \cdot 10^{-158}:\\
\;\;\;\;x\\
\mathbf{elif}\;y \leq 2.5 \cdot 10^{-116}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;y \leq 4.5 \cdot 10^{-93}:\\
\;\;\;\;x\\
\mathbf{elif}\;y \leq 1.75 \cdot 10^{+14}:\\
\;\;\;\;t\_2\\
\mathbf{else}:\\
\;\;\;\;-0.3333333333333333 \cdot \frac{y}{z}\\
\end{array}
\end{array}
if y < -1.70000000000000009e101 or -3e39 < y < -1.82e12Initial program 95.5%
+-commutative95.5%
associate-+r-95.5%
+-commutative95.5%
associate--l+95.5%
sub-neg95.5%
remove-double-neg95.5%
distribute-frac-neg95.5%
distribute-neg-in95.5%
remove-double-neg95.5%
sub-neg95.5%
neg-mul-195.5%
times-frac95.5%
distribute-frac-neg95.5%
neg-mul-195.5%
*-commutative95.5%
associate-/l*95.4%
*-commutative95.4%
Simplified99.8%
Taylor expanded in y around inf 98.6%
associate-*r/98.7%
metadata-eval98.7%
Simplified98.7%
Taylor expanded in x around 0 78.6%
if -1.70000000000000009e101 < y < -3e39 or -1.82e12 < y < -4.00000000000000026e-158 or 2.5000000000000001e-116 < y < 4.5000000000000002e-93Initial 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-frac92.8%
distribute-frac-neg92.8%
neg-mul-192.8%
*-commutative92.8%
associate-/l*92.8%
*-commutative92.8%
Simplified92.9%
Taylor expanded in x around inf 60.2%
if -4.00000000000000026e-158 < y < 2.5000000000000001e-116 or 4.5000000000000002e-93 < y < 1.75e14Initial program 94.2%
+-commutative94.2%
associate-+r-94.2%
+-commutative94.2%
associate--l+94.2%
sub-neg94.2%
remove-double-neg94.2%
distribute-frac-neg94.2%
distribute-neg-in94.2%
remove-double-neg94.2%
sub-neg94.2%
neg-mul-194.2%
times-frac91.4%
distribute-frac-neg91.4%
neg-mul-191.4%
*-commutative91.4%
associate-/l*91.4%
*-commutative91.4%
Simplified91.3%
Taylor expanded in y around 0 94.7%
Taylor expanded in t around inf 75.1%
associate-*r/75.1%
associate-*l/75.1%
*-commutative75.1%
Simplified75.1%
associate-/l*69.6%
*-commutative69.6%
associate-/l/69.6%
Applied egg-rr69.6%
if 1.75e14 < y Initial program 99.7%
Taylor expanded in t around 0 95.2%
Taylor expanded in x around 0 66.8%
Final simplification68.6%
(FPCore (x y z t) :precision binary64 (if (<= (+ (- x (/ y (* z 3.0))) (/ t (* y (* z 3.0)))) 2e+290) (+ (+ x (/ t (* z (* y 3.0)))) (/ y (* z -3.0))) (+ x (* (/ 0.3333333333333333 z) (- (/ t y) y)))))
double code(double x, double y, double z, double t) {
double tmp;
if (((x - (y / (z * 3.0))) + (t / (y * (z * 3.0)))) <= 2e+290) {
tmp = (x + (t / (z * (y * 3.0)))) + (y / (z * -3.0));
} else {
tmp = x + ((0.3333333333333333 / z) * ((t / y) - 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 (((x - (y / (z * 3.0d0))) + (t / (y * (z * 3.0d0)))) <= 2d+290) then
tmp = (x + (t / (z * (y * 3.0d0)))) + (y / (z * (-3.0d0)))
else
tmp = x + ((0.3333333333333333d0 / z) * ((t / y) - y))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (((x - (y / (z * 3.0))) + (t / (y * (z * 3.0)))) <= 2e+290) {
tmp = (x + (t / (z * (y * 3.0)))) + (y / (z * -3.0));
} else {
tmp = x + ((0.3333333333333333 / z) * ((t / y) - y));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if ((x - (y / (z * 3.0))) + (t / (y * (z * 3.0)))) <= 2e+290: tmp = (x + (t / (z * (y * 3.0)))) + (y / (z * -3.0)) else: tmp = x + ((0.3333333333333333 / z) * ((t / y) - y)) return tmp
function code(x, y, z, t) tmp = 0.0 if (Float64(Float64(x - Float64(y / Float64(z * 3.0))) + Float64(t / Float64(y * Float64(z * 3.0)))) <= 2e+290) tmp = Float64(Float64(x + Float64(t / Float64(z * Float64(y * 3.0)))) + Float64(y / Float64(z * -3.0))); else tmp = Float64(x + Float64(Float64(0.3333333333333333 / z) * Float64(Float64(t / y) - y))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (((x - (y / (z * 3.0))) + (t / (y * (z * 3.0)))) <= 2e+290) tmp = (x + (t / (z * (y * 3.0)))) + (y / (z * -3.0)); else tmp = x + ((0.3333333333333333 / z) * ((t / y) - y)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[N[(N[(x - N[(y / N[(z * 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(t / N[(y * N[(z * 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 2e+290], N[(N[(x + N[(t / N[(z * N[(y * 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(y / N[(z * -3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(N[(0.3333333333333333 / z), $MachinePrecision] * N[(N[(t / y), $MachinePrecision] - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\left(x - \frac{y}{z \cdot 3}\right) + \frac{t}{y \cdot \left(z \cdot 3\right)} \leq 2 \cdot 10^{+290}:\\
\;\;\;\;\left(x + \frac{t}{z \cdot \left(y \cdot 3\right)}\right) + \frac{y}{z \cdot -3}\\
\mathbf{else}:\\
\;\;\;\;x + \frac{0.3333333333333333}{z} \cdot \left(\frac{t}{y} - y\right)\\
\end{array}
\end{array}
if (+.f64 (-.f64 x (/.f64 y (*.f64 z #s(literal 3 binary64)))) (/.f64 t (*.f64 (*.f64 z #s(literal 3 binary64)) y))) < 2.00000000000000012e290Initial program 97.9%
+-commutative97.9%
associate-+r-97.9%
sub-neg97.9%
associate-*l*97.9%
*-commutative97.9%
distribute-frac-neg297.9%
distribute-rgt-neg-in97.9%
metadata-eval97.9%
Simplified97.9%
if 2.00000000000000012e290 < (+.f64 (-.f64 x (/.f64 y (*.f64 z #s(literal 3 binary64)))) (/.f64 t (*.f64 (*.f64 z #s(literal 3 binary64)) y))) Initial program 90.8%
+-commutative90.8%
associate-+r-90.8%
+-commutative90.8%
associate--l+90.8%
sub-neg90.8%
remove-double-neg90.8%
distribute-frac-neg90.8%
distribute-neg-in90.8%
remove-double-neg90.8%
sub-neg90.8%
neg-mul-190.8%
times-frac96.2%
distribute-frac-neg96.2%
neg-mul-196.2%
*-commutative96.2%
associate-/l*96.2%
*-commutative96.2%
Simplified100.0%
Final simplification98.3%
(FPCore (x y z t) :precision binary64 (if (or (<= y -1e-82) (not (<= y 2.46e-88))) (+ x (* (/ 0.3333333333333333 z) (- (/ t y) y))) (/ (+ (* 0.3333333333333333 (/ t z)) (* x y)) y)))
double code(double x, double y, double z, double t) {
double tmp;
if ((y <= -1e-82) || !(y <= 2.46e-88)) {
tmp = x + ((0.3333333333333333 / z) * ((t / y) - y));
} else {
tmp = ((0.3333333333333333 * (t / z)) + (x * y)) / 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 <= (-1d-82)) .or. (.not. (y <= 2.46d-88))) then
tmp = x + ((0.3333333333333333d0 / z) * ((t / y) - y))
else
tmp = ((0.3333333333333333d0 * (t / z)) + (x * y)) / y
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((y <= -1e-82) || !(y <= 2.46e-88)) {
tmp = x + ((0.3333333333333333 / z) * ((t / y) - y));
} else {
tmp = ((0.3333333333333333 * (t / z)) + (x * y)) / y;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (y <= -1e-82) or not (y <= 2.46e-88): tmp = x + ((0.3333333333333333 / z) * ((t / y) - y)) else: tmp = ((0.3333333333333333 * (t / z)) + (x * y)) / y return tmp
function code(x, y, z, t) tmp = 0.0 if ((y <= -1e-82) || !(y <= 2.46e-88)) tmp = Float64(x + Float64(Float64(0.3333333333333333 / z) * Float64(Float64(t / y) - y))); else tmp = Float64(Float64(Float64(0.3333333333333333 * Float64(t / z)) + Float64(x * y)) / y); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((y <= -1e-82) || ~((y <= 2.46e-88))) tmp = x + ((0.3333333333333333 / z) * ((t / y) - y)); else tmp = ((0.3333333333333333 * (t / z)) + (x * y)) / y; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[y, -1e-82], N[Not[LessEqual[y, 2.46e-88]], $MachinePrecision]], N[(x + N[(N[(0.3333333333333333 / z), $MachinePrecision] * N[(N[(t / y), $MachinePrecision] - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(0.3333333333333333 * N[(t / z), $MachinePrecision]), $MachinePrecision] + N[(x * y), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1 \cdot 10^{-82} \lor \neg \left(y \leq 2.46 \cdot 10^{-88}\right):\\
\;\;\;\;x + \frac{0.3333333333333333}{z} \cdot \left(\frac{t}{y} - y\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{0.3333333333333333 \cdot \frac{t}{z} + x \cdot y}{y}\\
\end{array}
\end{array}
if y < -1e-82 or 2.4599999999999999e-88 < y Initial program 98.4%
+-commutative98.4%
associate-+r-98.4%
+-commutative98.4%
associate--l+98.4%
sub-neg98.4%
remove-double-neg98.4%
distribute-frac-neg98.4%
distribute-neg-in98.4%
remove-double-neg98.4%
sub-neg98.4%
neg-mul-198.4%
times-frac97.8%
distribute-frac-neg97.8%
neg-mul-197.8%
*-commutative97.8%
associate-/l*97.9%
*-commutative97.9%
Simplified99.2%
if -1e-82 < y < 2.4599999999999999e-88Initial 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-frac88.4%
distribute-frac-neg88.4%
neg-mul-188.4%
*-commutative88.4%
associate-/l*88.4%
*-commutative88.4%
Simplified88.4%
Taylor expanded in y around 0 96.9%
Final simplification98.3%
(FPCore (x y z t)
:precision binary64
(if (<= y -2200000000000.0)
(+ x (/ (* y -0.3333333333333333) z))
(if (<= y 23500000000.0)
(+ x (/ t (* z (* y 3.0))))
(- x (* (/ y z) 0.3333333333333333)))))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -2200000000000.0) {
tmp = x + ((y * -0.3333333333333333) / z);
} else if (y <= 23500000000.0) {
tmp = x + (t / (z * (y * 3.0)));
} else {
tmp = x - ((y / z) * 0.3333333333333333);
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (y <= (-2200000000000.0d0)) then
tmp = x + ((y * (-0.3333333333333333d0)) / z)
else if (y <= 23500000000.0d0) then
tmp = x + (t / (z * (y * 3.0d0)))
else
tmp = x - ((y / z) * 0.3333333333333333d0)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (y <= -2200000000000.0) {
tmp = x + ((y * -0.3333333333333333) / z);
} else if (y <= 23500000000.0) {
tmp = x + (t / (z * (y * 3.0)));
} else {
tmp = x - ((y / z) * 0.3333333333333333);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= -2200000000000.0: tmp = x + ((y * -0.3333333333333333) / z) elif y <= 23500000000.0: tmp = x + (t / (z * (y * 3.0))) else: tmp = x - ((y / z) * 0.3333333333333333) return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= -2200000000000.0) tmp = Float64(x + Float64(Float64(y * -0.3333333333333333) / z)); elseif (y <= 23500000000.0) tmp = Float64(x + Float64(t / Float64(z * Float64(y * 3.0)))); else tmp = Float64(x - Float64(Float64(y / z) * 0.3333333333333333)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (y <= -2200000000000.0) tmp = x + ((y * -0.3333333333333333) / z); elseif (y <= 23500000000.0) tmp = x + (t / (z * (y * 3.0))); else tmp = x - ((y / z) * 0.3333333333333333); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, -2200000000000.0], N[(x + N[(N[(y * -0.3333333333333333), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 23500000000.0], N[(x + N[(t / N[(z * N[(y * 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x - N[(N[(y / z), $MachinePrecision] * 0.3333333333333333), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -2200000000000:\\
\;\;\;\;x + \frac{y \cdot -0.3333333333333333}{z}\\
\mathbf{elif}\;y \leq 23500000000:\\
\;\;\;\;x + \frac{t}{z \cdot \left(y \cdot 3\right)}\\
\mathbf{else}:\\
\;\;\;\;x - \frac{y}{z} \cdot 0.3333333333333333\\
\end{array}
\end{array}
if y < -2.2e12Initial program 96.3%
sub-neg96.3%
associate-+l+96.3%
distribute-frac-neg96.3%
neg-mul-196.3%
*-commutative96.3%
times-frac96.3%
fma-define96.3%
metadata-eval96.3%
associate-*l*96.3%
*-commutative96.3%
Simplified96.3%
Taylor expanded in z around 0 99.8%
Taylor expanded in y around inf 95.7%
associate-*r/95.7%
*-commutative95.7%
Simplified95.7%
if -2.2e12 < y < 2.35e10Initial program 95.2%
+-commutative95.2%
associate-+r-95.2%
+-commutative95.2%
associate--l+95.2%
sub-neg95.2%
remove-double-neg95.2%
distribute-frac-neg95.2%
distribute-neg-in95.2%
remove-double-neg95.2%
sub-neg95.2%
neg-mul-195.2%
times-frac91.2%
distribute-frac-neg91.2%
neg-mul-191.2%
*-commutative91.2%
associate-/l*91.2%
*-commutative91.2%
Simplified91.2%
Taylor expanded in t around inf 89.7%
*-commutative89.7%
associate-/r*85.7%
associate-*l/85.7%
metadata-eval85.7%
div-inv85.7%
div-inv85.7%
associate-/l/85.7%
frac-times89.7%
*-commutative89.7%
*-un-lft-identity89.7%
*-commutative89.7%
Applied egg-rr89.7%
if 2.35e10 < y Initial program 99.7%
Taylor expanded in t around 0 95.2%
Final simplification92.2%
(FPCore (x y z t)
:precision binary64
(if (<= y -1950000000000.0)
(+ x (/ (* y -0.3333333333333333) z))
(if (<= y 6.5e+14)
(+ x (* 0.3333333333333333 (/ t (* y z))))
(- x (* (/ y z) 0.3333333333333333)))))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -1950000000000.0) {
tmp = x + ((y * -0.3333333333333333) / z);
} else if (y <= 6.5e+14) {
tmp = x + (0.3333333333333333 * (t / (y * z)));
} else {
tmp = x - ((y / z) * 0.3333333333333333);
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (y <= (-1950000000000.0d0)) then
tmp = x + ((y * (-0.3333333333333333d0)) / z)
else if (y <= 6.5d+14) then
tmp = x + (0.3333333333333333d0 * (t / (y * z)))
else
tmp = x - ((y / z) * 0.3333333333333333d0)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (y <= -1950000000000.0) {
tmp = x + ((y * -0.3333333333333333) / z);
} else if (y <= 6.5e+14) {
tmp = x + (0.3333333333333333 * (t / (y * z)));
} else {
tmp = x - ((y / z) * 0.3333333333333333);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= -1950000000000.0: tmp = x + ((y * -0.3333333333333333) / z) elif y <= 6.5e+14: tmp = x + (0.3333333333333333 * (t / (y * z))) else: tmp = x - ((y / z) * 0.3333333333333333) return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= -1950000000000.0) tmp = Float64(x + Float64(Float64(y * -0.3333333333333333) / z)); elseif (y <= 6.5e+14) tmp = Float64(x + Float64(0.3333333333333333 * Float64(t / Float64(y * z)))); else tmp = Float64(x - Float64(Float64(y / z) * 0.3333333333333333)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (y <= -1950000000000.0) tmp = x + ((y * -0.3333333333333333) / z); elseif (y <= 6.5e+14) tmp = x + (0.3333333333333333 * (t / (y * z))); else tmp = x - ((y / z) * 0.3333333333333333); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, -1950000000000.0], N[(x + N[(N[(y * -0.3333333333333333), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 6.5e+14], N[(x + N[(0.3333333333333333 * N[(t / N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x - N[(N[(y / z), $MachinePrecision] * 0.3333333333333333), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1950000000000:\\
\;\;\;\;x + \frac{y \cdot -0.3333333333333333}{z}\\
\mathbf{elif}\;y \leq 6.5 \cdot 10^{+14}:\\
\;\;\;\;x + 0.3333333333333333 \cdot \frac{t}{y \cdot z}\\
\mathbf{else}:\\
\;\;\;\;x - \frac{y}{z} \cdot 0.3333333333333333\\
\end{array}
\end{array}
if y < -1.95e12Initial program 96.3%
sub-neg96.3%
associate-+l+96.3%
distribute-frac-neg96.3%
neg-mul-196.3%
*-commutative96.3%
times-frac96.3%
fma-define96.3%
metadata-eval96.3%
associate-*l*96.3%
*-commutative96.3%
Simplified96.3%
Taylor expanded in z around 0 99.8%
Taylor expanded in y around inf 95.7%
associate-*r/95.7%
*-commutative95.7%
Simplified95.7%
if -1.95e12 < y < 6.5e14Initial program 95.2%
+-commutative95.2%
associate-+r-95.2%
+-commutative95.2%
associate--l+95.2%
sub-neg95.2%
remove-double-neg95.2%
distribute-frac-neg95.2%
distribute-neg-in95.2%
remove-double-neg95.2%
sub-neg95.2%
neg-mul-195.2%
times-frac91.2%
distribute-frac-neg91.2%
neg-mul-191.2%
*-commutative91.2%
associate-/l*91.2%
*-commutative91.2%
Simplified91.2%
Taylor expanded in t around inf 89.7%
if 6.5e14 < y Initial program 99.7%
Taylor expanded in t around 0 95.2%
Final simplification92.2%
(FPCore (x y z t)
:precision binary64
(if (<= y -9e-158)
(+ x (/ (* y -0.3333333333333333) z))
(if (<= y 2.5e-116)
(* (/ t z) (/ (/ 1.0 y) 3.0))
(- x (* (/ y z) 0.3333333333333333)))))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -9e-158) {
tmp = x + ((y * -0.3333333333333333) / z);
} else if (y <= 2.5e-116) {
tmp = (t / z) * ((1.0 / y) / 3.0);
} else {
tmp = x - ((y / z) * 0.3333333333333333);
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (y <= (-9d-158)) then
tmp = x + ((y * (-0.3333333333333333d0)) / z)
else if (y <= 2.5d-116) then
tmp = (t / z) * ((1.0d0 / y) / 3.0d0)
else
tmp = x - ((y / z) * 0.3333333333333333d0)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (y <= -9e-158) {
tmp = x + ((y * -0.3333333333333333) / z);
} else if (y <= 2.5e-116) {
tmp = (t / z) * ((1.0 / y) / 3.0);
} else {
tmp = x - ((y / z) * 0.3333333333333333);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= -9e-158: tmp = x + ((y * -0.3333333333333333) / z) elif y <= 2.5e-116: tmp = (t / z) * ((1.0 / y) / 3.0) else: tmp = x - ((y / z) * 0.3333333333333333) return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= -9e-158) tmp = Float64(x + Float64(Float64(y * -0.3333333333333333) / z)); elseif (y <= 2.5e-116) tmp = Float64(Float64(t / z) * Float64(Float64(1.0 / y) / 3.0)); else tmp = Float64(x - Float64(Float64(y / z) * 0.3333333333333333)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (y <= -9e-158) tmp = x + ((y * -0.3333333333333333) / z); elseif (y <= 2.5e-116) tmp = (t / z) * ((1.0 / y) / 3.0); else tmp = x - ((y / z) * 0.3333333333333333); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, -9e-158], N[(x + N[(N[(y * -0.3333333333333333), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 2.5e-116], N[(N[(t / z), $MachinePrecision] * N[(N[(1.0 / y), $MachinePrecision] / 3.0), $MachinePrecision]), $MachinePrecision], N[(x - N[(N[(y / z), $MachinePrecision] * 0.3333333333333333), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -9 \cdot 10^{-158}:\\
\;\;\;\;x + \frac{y \cdot -0.3333333333333333}{z}\\
\mathbf{elif}\;y \leq 2.5 \cdot 10^{-116}:\\
\;\;\;\;\frac{t}{z} \cdot \frac{\frac{1}{y}}{3}\\
\mathbf{else}:\\
\;\;\;\;x - \frac{y}{z} \cdot 0.3333333333333333\\
\end{array}
\end{array}
if y < -9e-158Initial program 96.6%
sub-neg96.6%
associate-+l+96.6%
distribute-frac-neg96.6%
neg-mul-196.6%
*-commutative96.6%
times-frac96.6%
fma-define96.6%
metadata-eval96.6%
associate-*l*96.7%
*-commutative96.7%
Simplified96.7%
Taylor expanded in z around 0 97.7%
Taylor expanded in y around inf 84.4%
associate-*r/84.4%
*-commutative84.4%
Simplified84.4%
if -9e-158 < y < 2.5000000000000001e-116Initial program 92.5%
+-commutative92.5%
associate-+r-92.5%
+-commutative92.5%
associate--l+92.5%
sub-neg92.5%
remove-double-neg92.5%
distribute-frac-neg92.5%
distribute-neg-in92.5%
remove-double-neg92.5%
sub-neg92.5%
neg-mul-192.5%
times-frac90.2%
distribute-frac-neg90.2%
neg-mul-190.2%
*-commutative90.2%
associate-/l*90.2%
*-commutative90.2%
Simplified90.1%
Taylor expanded in y around 0 97.2%
Taylor expanded in t around inf 81.9%
associate-*r/81.8%
associate-*l/81.9%
*-commutative81.9%
Simplified81.9%
*-commutative81.9%
associate-/l*72.9%
metadata-eval72.9%
associate-/r*72.9%
*-commutative72.9%
associate-/r/72.9%
clear-num72.9%
div-inv72.9%
times-frac81.9%
Applied egg-rr81.9%
if 2.5000000000000001e-116 < y Initial program 99.7%
Taylor expanded in t around 0 82.1%
Final simplification82.9%
(FPCore (x y z t) :precision binary64 (if (<= (* z 3.0) -5e+122) x (if (<= (* z 3.0) 2e-63) (* -0.3333333333333333 (/ y z)) x)))
double code(double x, double y, double z, double t) {
double tmp;
if ((z * 3.0) <= -5e+122) {
tmp = x;
} else if ((z * 3.0) <= 2e-63) {
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 * 3.0d0) <= (-5d+122)) then
tmp = x
else if ((z * 3.0d0) <= 2d-63) 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 * 3.0) <= -5e+122) {
tmp = x;
} else if ((z * 3.0) <= 2e-63) {
tmp = -0.3333333333333333 * (y / z);
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (z * 3.0) <= -5e+122: tmp = x elif (z * 3.0) <= 2e-63: tmp = -0.3333333333333333 * (y / z) else: tmp = x return tmp
function code(x, y, z, t) tmp = 0.0 if (Float64(z * 3.0) <= -5e+122) tmp = x; elseif (Float64(z * 3.0) <= 2e-63) 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 * 3.0) <= -5e+122) tmp = x; elseif ((z * 3.0) <= 2e-63) tmp = -0.3333333333333333 * (y / z); else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[N[(z * 3.0), $MachinePrecision], -5e+122], x, If[LessEqual[N[(z * 3.0), $MachinePrecision], 2e-63], N[(-0.3333333333333333 * N[(y / z), $MachinePrecision]), $MachinePrecision], x]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \cdot 3 \leq -5 \cdot 10^{+122}:\\
\;\;\;\;x\\
\mathbf{elif}\;z \cdot 3 \leq 2 \cdot 10^{-63}:\\
\;\;\;\;-0.3333333333333333 \cdot \frac{y}{z}\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if (*.f64 z #s(literal 3 binary64)) < -4.99999999999999989e122 or 2.00000000000000013e-63 < (*.f64 z #s(literal 3 binary64)) 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-frac89.3%
distribute-frac-neg89.3%
neg-mul-189.3%
*-commutative89.3%
associate-/l*89.3%
*-commutative89.3%
Simplified89.3%
Taylor expanded in x around inf 57.7%
if -4.99999999999999989e122 < (*.f64 z #s(literal 3 binary64)) < 2.00000000000000013e-63Initial program 94.2%
Taylor expanded in t around 0 56.2%
Taylor expanded in x around 0 47.3%
(FPCore (x y z t) :precision binary64 (if (or (<= y -1.78e-158) (not (<= y 4.6e-116))) (+ x (/ (* y -0.3333333333333333) z)) (* t (/ 0.3333333333333333 (* y z)))))
double code(double x, double y, double z, double t) {
double tmp;
if ((y <= -1.78e-158) || !(y <= 4.6e-116)) {
tmp = x + ((y * -0.3333333333333333) / z);
} else {
tmp = t * (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 <= (-1.78d-158)) .or. (.not. (y <= 4.6d-116))) then
tmp = x + ((y * (-0.3333333333333333d0)) / z)
else
tmp = t * (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 <= -1.78e-158) || !(y <= 4.6e-116)) {
tmp = x + ((y * -0.3333333333333333) / z);
} else {
tmp = t * (0.3333333333333333 / (y * z));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (y <= -1.78e-158) or not (y <= 4.6e-116): tmp = x + ((y * -0.3333333333333333) / z) else: tmp = t * (0.3333333333333333 / (y * z)) return tmp
function code(x, y, z, t) tmp = 0.0 if ((y <= -1.78e-158) || !(y <= 4.6e-116)) tmp = Float64(x + Float64(Float64(y * -0.3333333333333333) / z)); else tmp = Float64(t * Float64(0.3333333333333333 / Float64(y * z))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((y <= -1.78e-158) || ~((y <= 4.6e-116))) tmp = x + ((y * -0.3333333333333333) / z); else tmp = t * (0.3333333333333333 / (y * z)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[y, -1.78e-158], N[Not[LessEqual[y, 4.6e-116]], $MachinePrecision]], N[(x + N[(N[(y * -0.3333333333333333), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision], N[(t * N[(0.3333333333333333 / N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.78 \cdot 10^{-158} \lor \neg \left(y \leq 4.6 \cdot 10^{-116}\right):\\
\;\;\;\;x + \frac{y \cdot -0.3333333333333333}{z}\\
\mathbf{else}:\\
\;\;\;\;t \cdot \frac{0.3333333333333333}{y \cdot z}\\
\end{array}
\end{array}
if y < -1.77999999999999992e-158 or 4.60000000000000003e-116 < y Initial program 98.1%
sub-neg98.1%
associate-+l+98.1%
distribute-frac-neg98.1%
neg-mul-198.1%
*-commutative98.1%
times-frac98.2%
fma-define98.2%
metadata-eval98.2%
associate-*l*98.2%
*-commutative98.2%
Simplified98.2%
Taylor expanded in z around 0 97.1%
Taylor expanded in y around inf 83.3%
associate-*r/83.3%
*-commutative83.3%
Simplified83.3%
if -1.77999999999999992e-158 < y < 4.60000000000000003e-116Initial program 92.5%
+-commutative92.5%
associate-+r-92.5%
+-commutative92.5%
associate--l+92.5%
sub-neg92.5%
remove-double-neg92.5%
distribute-frac-neg92.5%
distribute-neg-in92.5%
remove-double-neg92.5%
sub-neg92.5%
neg-mul-192.5%
times-frac90.2%
distribute-frac-neg90.2%
neg-mul-190.2%
*-commutative90.2%
associate-/l*90.2%
*-commutative90.2%
Simplified90.1%
Taylor expanded in y around 0 97.2%
Taylor expanded in t around inf 81.9%
associate-*r/81.8%
associate-*l/81.9%
*-commutative81.9%
Simplified81.9%
associate-/l*74.8%
*-commutative74.8%
associate-/l/74.9%
Applied egg-rr74.9%
Final simplification80.7%
(FPCore (x y z t)
:precision binary64
(if (<= y -8.2e-158)
(+ x (/ (* y -0.3333333333333333) z))
(if (<= y 3e-116)
(/ (* 0.3333333333333333 (/ t z)) y)
(- x (* (/ y z) 0.3333333333333333)))))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -8.2e-158) {
tmp = x + ((y * -0.3333333333333333) / z);
} else if (y <= 3e-116) {
tmp = (0.3333333333333333 * (t / z)) / y;
} else {
tmp = x - ((y / z) * 0.3333333333333333);
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (y <= (-8.2d-158)) then
tmp = x + ((y * (-0.3333333333333333d0)) / z)
else if (y <= 3d-116) then
tmp = (0.3333333333333333d0 * (t / z)) / y
else
tmp = x - ((y / z) * 0.3333333333333333d0)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (y <= -8.2e-158) {
tmp = x + ((y * -0.3333333333333333) / z);
} else if (y <= 3e-116) {
tmp = (0.3333333333333333 * (t / z)) / y;
} else {
tmp = x - ((y / z) * 0.3333333333333333);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= -8.2e-158: tmp = x + ((y * -0.3333333333333333) / z) elif y <= 3e-116: tmp = (0.3333333333333333 * (t / z)) / y else: tmp = x - ((y / z) * 0.3333333333333333) return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= -8.2e-158) tmp = Float64(x + Float64(Float64(y * -0.3333333333333333) / z)); elseif (y <= 3e-116) tmp = Float64(Float64(0.3333333333333333 * Float64(t / z)) / y); else tmp = Float64(x - Float64(Float64(y / z) * 0.3333333333333333)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (y <= -8.2e-158) tmp = x + ((y * -0.3333333333333333) / z); elseif (y <= 3e-116) tmp = (0.3333333333333333 * (t / z)) / y; else tmp = x - ((y / z) * 0.3333333333333333); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, -8.2e-158], N[(x + N[(N[(y * -0.3333333333333333), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 3e-116], N[(N[(0.3333333333333333 * N[(t / z), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision], N[(x - N[(N[(y / z), $MachinePrecision] * 0.3333333333333333), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -8.2 \cdot 10^{-158}:\\
\;\;\;\;x + \frac{y \cdot -0.3333333333333333}{z}\\
\mathbf{elif}\;y \leq 3 \cdot 10^{-116}:\\
\;\;\;\;\frac{0.3333333333333333 \cdot \frac{t}{z}}{y}\\
\mathbf{else}:\\
\;\;\;\;x - \frac{y}{z} \cdot 0.3333333333333333\\
\end{array}
\end{array}
if y < -8.20000000000000008e-158Initial program 96.6%
sub-neg96.6%
associate-+l+96.6%
distribute-frac-neg96.6%
neg-mul-196.6%
*-commutative96.6%
times-frac96.6%
fma-define96.6%
metadata-eval96.6%
associate-*l*96.7%
*-commutative96.7%
Simplified96.7%
Taylor expanded in z around 0 97.7%
Taylor expanded in y around inf 84.4%
associate-*r/84.4%
*-commutative84.4%
Simplified84.4%
if -8.20000000000000008e-158 < y < 3.00000000000000026e-116Initial program 92.5%
+-commutative92.5%
associate-+r-92.5%
+-commutative92.5%
associate--l+92.5%
sub-neg92.5%
remove-double-neg92.5%
distribute-frac-neg92.5%
distribute-neg-in92.5%
remove-double-neg92.5%
sub-neg92.5%
neg-mul-192.5%
times-frac90.2%
distribute-frac-neg90.2%
neg-mul-190.2%
*-commutative90.2%
associate-/l*90.2%
*-commutative90.2%
Simplified90.1%
Taylor expanded in y around 0 97.2%
Taylor expanded in t around inf 81.9%
if 3.00000000000000026e-116 < y Initial program 99.7%
Taylor expanded in t around 0 82.1%
Final simplification82.9%
(FPCore (x y z t)
:precision binary64
(if (<= y -9e-158)
(+ x (/ (* y -0.3333333333333333) z))
(if (<= y 2.8e-116)
(* t (/ 0.3333333333333333 (* y z)))
(- x (* (/ y z) 0.3333333333333333)))))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -9e-158) {
tmp = x + ((y * -0.3333333333333333) / z);
} else if (y <= 2.8e-116) {
tmp = t * (0.3333333333333333 / (y * z));
} else {
tmp = x - ((y / z) * 0.3333333333333333);
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (y <= (-9d-158)) then
tmp = x + ((y * (-0.3333333333333333d0)) / z)
else if (y <= 2.8d-116) then
tmp = t * (0.3333333333333333d0 / (y * z))
else
tmp = x - ((y / z) * 0.3333333333333333d0)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (y <= -9e-158) {
tmp = x + ((y * -0.3333333333333333) / z);
} else if (y <= 2.8e-116) {
tmp = t * (0.3333333333333333 / (y * z));
} else {
tmp = x - ((y / z) * 0.3333333333333333);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= -9e-158: tmp = x + ((y * -0.3333333333333333) / z) elif y <= 2.8e-116: tmp = t * (0.3333333333333333 / (y * z)) else: tmp = x - ((y / z) * 0.3333333333333333) return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= -9e-158) tmp = Float64(x + Float64(Float64(y * -0.3333333333333333) / z)); elseif (y <= 2.8e-116) tmp = Float64(t * Float64(0.3333333333333333 / Float64(y * z))); else tmp = Float64(x - Float64(Float64(y / z) * 0.3333333333333333)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (y <= -9e-158) tmp = x + ((y * -0.3333333333333333) / z); elseif (y <= 2.8e-116) tmp = t * (0.3333333333333333 / (y * z)); else tmp = x - ((y / z) * 0.3333333333333333); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, -9e-158], N[(x + N[(N[(y * -0.3333333333333333), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 2.8e-116], N[(t * N[(0.3333333333333333 / N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x - N[(N[(y / z), $MachinePrecision] * 0.3333333333333333), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -9 \cdot 10^{-158}:\\
\;\;\;\;x + \frac{y \cdot -0.3333333333333333}{z}\\
\mathbf{elif}\;y \leq 2.8 \cdot 10^{-116}:\\
\;\;\;\;t \cdot \frac{0.3333333333333333}{y \cdot z}\\
\mathbf{else}:\\
\;\;\;\;x - \frac{y}{z} \cdot 0.3333333333333333\\
\end{array}
\end{array}
if y < -9e-158Initial program 96.6%
sub-neg96.6%
associate-+l+96.6%
distribute-frac-neg96.6%
neg-mul-196.6%
*-commutative96.6%
times-frac96.6%
fma-define96.6%
metadata-eval96.6%
associate-*l*96.7%
*-commutative96.7%
Simplified96.7%
Taylor expanded in z around 0 97.7%
Taylor expanded in y around inf 84.4%
associate-*r/84.4%
*-commutative84.4%
Simplified84.4%
if -9e-158 < y < 2.7999999999999999e-116Initial program 92.5%
+-commutative92.5%
associate-+r-92.5%
+-commutative92.5%
associate--l+92.5%
sub-neg92.5%
remove-double-neg92.5%
distribute-frac-neg92.5%
distribute-neg-in92.5%
remove-double-neg92.5%
sub-neg92.5%
neg-mul-192.5%
times-frac90.2%
distribute-frac-neg90.2%
neg-mul-190.2%
*-commutative90.2%
associate-/l*90.2%
*-commutative90.2%
Simplified90.1%
Taylor expanded in y around 0 97.2%
Taylor expanded in t around inf 81.9%
associate-*r/81.8%
associate-*l/81.9%
*-commutative81.9%
Simplified81.9%
associate-/l*74.8%
*-commutative74.8%
associate-/l/74.9%
Applied egg-rr74.9%
if 2.7999999999999999e-116 < y Initial program 99.7%
Taylor expanded in t around 0 82.1%
Final simplification80.8%
(FPCore (x y z t) :precision binary64 (+ x (* (/ 0.3333333333333333 z) (- (/ t y) y))))
double code(double x, double y, double z, double t) {
return x + ((0.3333333333333333 / z) * ((t / y) - y));
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = x + ((0.3333333333333333d0 / z) * ((t / y) - y))
end function
public static double code(double x, double y, double z, double t) {
return x + ((0.3333333333333333 / z) * ((t / y) - y));
}
def code(x, y, z, t): return x + ((0.3333333333333333 / z) * ((t / y) - y))
function code(x, y, z, t) return Float64(x + Float64(Float64(0.3333333333333333 / z) * Float64(Float64(t / y) - y))) end
function tmp = code(x, y, z, t) tmp = x + ((0.3333333333333333 / z) * ((t / y) - y)); end
code[x_, y_, z_, t_] := N[(x + N[(N[(0.3333333333333333 / z), $MachinePrecision] * N[(N[(t / y), $MachinePrecision] - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \frac{0.3333333333333333}{z} \cdot \left(\frac{t}{y} - y\right)
\end{array}
Initial program 96.4%
+-commutative96.4%
associate-+r-96.4%
+-commutative96.4%
associate--l+96.4%
sub-neg96.4%
remove-double-neg96.4%
distribute-frac-neg96.4%
distribute-neg-in96.4%
remove-double-neg96.4%
sub-neg96.4%
neg-mul-196.4%
times-frac94.2%
distribute-frac-neg94.2%
neg-mul-194.2%
*-commutative94.2%
associate-/l*94.2%
*-commutative94.2%
Simplified95.0%
(FPCore (x y z t) :precision binary64 x)
double code(double x, double y, double z, double t) {
return x;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = x
end function
public static double code(double x, double y, double z, double t) {
return x;
}
def code(x, y, z, t): return x
function code(x, y, z, t) return x end
function tmp = code(x, y, z, t) tmp = x; end
code[x_, y_, z_, t_] := x
\begin{array}{l}
\\
x
\end{array}
Initial program 96.4%
+-commutative96.4%
associate-+r-96.4%
+-commutative96.4%
associate--l+96.4%
sub-neg96.4%
remove-double-neg96.4%
distribute-frac-neg96.4%
distribute-neg-in96.4%
remove-double-neg96.4%
sub-neg96.4%
neg-mul-196.4%
times-frac94.2%
distribute-frac-neg94.2%
neg-mul-194.2%
*-commutative94.2%
associate-/l*94.2%
*-commutative94.2%
Simplified95.0%
Taylor expanded in x around inf 32.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 2024101
(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))))