
(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 10 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
(let* ((t_1 (- (/ t y) y)))
(if (<= y -2e-48)
(+ x (/ t_1 (* z 3.0)))
(if (<= y 5.6e-213)
(+ x (/ 0.3333333333333333 (* y (/ z t))))
(+ x (* (/ 0.3333333333333333 z) t_1))))))
double code(double x, double y, double z, double t) {
double t_1 = (t / y) - y;
double tmp;
if (y <= -2e-48) {
tmp = x + (t_1 / (z * 3.0));
} else if (y <= 5.6e-213) {
tmp = x + (0.3333333333333333 / (y * (z / t)));
} else {
tmp = x + ((0.3333333333333333 / z) * t_1);
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: tmp
t_1 = (t / y) - y
if (y <= (-2d-48)) then
tmp = x + (t_1 / (z * 3.0d0))
else if (y <= 5.6d-213) then
tmp = x + (0.3333333333333333d0 / (y * (z / t)))
else
tmp = x + ((0.3333333333333333d0 / z) * t_1)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = (t / y) - y;
double tmp;
if (y <= -2e-48) {
tmp = x + (t_1 / (z * 3.0));
} else if (y <= 5.6e-213) {
tmp = x + (0.3333333333333333 / (y * (z / t)));
} else {
tmp = x + ((0.3333333333333333 / z) * t_1);
}
return tmp;
}
def code(x, y, z, t): t_1 = (t / y) - y tmp = 0 if y <= -2e-48: tmp = x + (t_1 / (z * 3.0)) elif y <= 5.6e-213: tmp = x + (0.3333333333333333 / (y * (z / t))) else: tmp = x + ((0.3333333333333333 / z) * t_1) return tmp
function code(x, y, z, t) t_1 = Float64(Float64(t / y) - y) tmp = 0.0 if (y <= -2e-48) tmp = Float64(x + Float64(t_1 / Float64(z * 3.0))); elseif (y <= 5.6e-213) tmp = Float64(x + Float64(0.3333333333333333 / Float64(y * Float64(z / t)))); else tmp = Float64(x + Float64(Float64(0.3333333333333333 / z) * t_1)); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = (t / y) - y; tmp = 0.0; if (y <= -2e-48) tmp = x + (t_1 / (z * 3.0)); elseif (y <= 5.6e-213) tmp = x + (0.3333333333333333 / (y * (z / t))); else tmp = x + ((0.3333333333333333 / z) * t_1); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(t / y), $MachinePrecision] - y), $MachinePrecision]}, If[LessEqual[y, -2e-48], N[(x + N[(t$95$1 / N[(z * 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 5.6e-213], N[(x + N[(0.3333333333333333 / N[(y * N[(z / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(N[(0.3333333333333333 / z), $MachinePrecision] * t$95$1), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{t}{y} - y\\
\mathbf{if}\;y \leq -2 \cdot 10^{-48}:\\
\;\;\;\;x + \frac{t\_1}{z \cdot 3}\\
\mathbf{elif}\;y \leq 5.6 \cdot 10^{-213}:\\
\;\;\;\;x + \frac{0.3333333333333333}{y \cdot \frac{z}{t}}\\
\mathbf{else}:\\
\;\;\;\;x + \frac{0.3333333333333333}{z} \cdot t\_1\\
\end{array}
\end{array}
if y < -1.9999999999999999e-48Initial program 98.5%
sub-neg98.5%
associate-+l+98.5%
+-commutative98.5%
remove-double-neg98.5%
distribute-frac-neg98.5%
distribute-neg-in98.5%
remove-double-neg98.5%
sub-neg98.5%
neg-mul-198.5%
times-frac99.8%
distribute-frac-neg99.8%
neg-mul-199.8%
*-commutative99.8%
associate-/l*99.7%
*-commutative99.7%
Simplified99.7%
metadata-eval99.7%
associate-/r*99.7%
*-commutative99.7%
associate-*l/99.8%
*-un-lft-identity99.8%
Applied egg-rr99.8%
if -1.9999999999999999e-48 < y < 5.6e-213Initial program 92.7%
sub-neg92.7%
associate-+l+92.7%
+-commutative92.7%
remove-double-neg92.7%
distribute-frac-neg92.7%
distribute-neg-in92.7%
remove-double-neg92.7%
sub-neg92.7%
neg-mul-192.7%
times-frac86.0%
distribute-frac-neg86.0%
neg-mul-186.0%
*-commutative86.0%
associate-/l*86.0%
*-commutative86.0%
Simplified85.9%
Taylor expanded in t around inf 92.5%
clear-num92.5%
un-div-inv92.5%
associate-/l*98.8%
Applied egg-rr98.8%
if 5.6e-213 < y Initial program 96.6%
sub-neg96.6%
associate-+l+96.6%
+-commutative96.6%
remove-double-neg96.6%
distribute-frac-neg96.6%
distribute-neg-in96.6%
remove-double-neg96.6%
sub-neg96.6%
neg-mul-196.6%
times-frac99.8%
distribute-frac-neg99.8%
neg-mul-199.8%
*-commutative99.8%
associate-/l*99.8%
*-commutative99.8%
Simplified99.8%
Final simplification99.4%
(FPCore (x y z t) :precision binary64 (if (<= (+ (- x (/ y (* z 3.0))) (/ t (* y (* z 3.0)))) 1e+239) (+ (+ 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)))) <= 1e+239) {
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)))) <= 1d+239) 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)))) <= 1e+239) {
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)))) <= 1e+239: 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)))) <= 1e+239) 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)))) <= 1e+239) 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], 1e+239], 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 10^{+239}:\\
\;\;\;\;\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 3))) (/.f64 t (*.f64 (*.f64 z 3) y))) < 9.99999999999999991e238Initial program 98.0%
+-commutative98.0%
associate-+r-98.0%
sub-neg98.0%
associate-*l*98.0%
*-commutative98.0%
distribute-frac-neg298.0%
distribute-rgt-neg-in98.0%
metadata-eval98.0%
Simplified98.0%
if 9.99999999999999991e238 < (+.f64 (-.f64 x (/.f64 y (*.f64 z 3))) (/.f64 t (*.f64 (*.f64 z 3) y))) Initial program 88.9%
sub-neg88.9%
associate-+l+88.9%
+-commutative88.9%
remove-double-neg88.9%
distribute-frac-neg88.9%
distribute-neg-in88.9%
remove-double-neg88.9%
sub-neg88.9%
neg-mul-188.9%
times-frac99.9%
distribute-frac-neg99.9%
neg-mul-199.9%
*-commutative99.9%
associate-/l*99.9%
*-commutative99.9%
Simplified99.9%
Final simplification98.4%
(FPCore (x y z t) :precision binary64 (if (or (<= y -4.4e-49) (not (<= y 2e-213))) (+ x (* (/ 0.3333333333333333 z) (- (/ t y) y))) (+ x (/ 0.3333333333333333 (* y (/ z t))))))
double code(double x, double y, double z, double t) {
double tmp;
if ((y <= -4.4e-49) || !(y <= 2e-213)) {
tmp = x + ((0.3333333333333333 / z) * ((t / y) - y));
} else {
tmp = x + (0.3333333333333333 / (y * (z / t)));
}
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.4d-49)) .or. (.not. (y <= 2d-213))) then
tmp = x + ((0.3333333333333333d0 / z) * ((t / y) - y))
else
tmp = x + (0.3333333333333333d0 / (y * (z / t)))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((y <= -4.4e-49) || !(y <= 2e-213)) {
tmp = x + ((0.3333333333333333 / z) * ((t / y) - y));
} else {
tmp = x + (0.3333333333333333 / (y * (z / t)));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (y <= -4.4e-49) or not (y <= 2e-213): tmp = x + ((0.3333333333333333 / z) * ((t / y) - y)) else: tmp = x + (0.3333333333333333 / (y * (z / t))) return tmp
function code(x, y, z, t) tmp = 0.0 if ((y <= -4.4e-49) || !(y <= 2e-213)) tmp = Float64(x + Float64(Float64(0.3333333333333333 / z) * Float64(Float64(t / y) - y))); else tmp = Float64(x + Float64(0.3333333333333333 / Float64(y * Float64(z / t)))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((y <= -4.4e-49) || ~((y <= 2e-213))) tmp = x + ((0.3333333333333333 / z) * ((t / y) - y)); else tmp = x + (0.3333333333333333 / (y * (z / t))); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[y, -4.4e-49], N[Not[LessEqual[y, 2e-213]], $MachinePrecision]], N[(x + N[(N[(0.3333333333333333 / z), $MachinePrecision] * N[(N[(t / y), $MachinePrecision] - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(0.3333333333333333 / N[(y * N[(z / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -4.4 \cdot 10^{-49} \lor \neg \left(y \leq 2 \cdot 10^{-213}\right):\\
\;\;\;\;x + \frac{0.3333333333333333}{z} \cdot \left(\frac{t}{y} - y\right)\\
\mathbf{else}:\\
\;\;\;\;x + \frac{0.3333333333333333}{y \cdot \frac{z}{t}}\\
\end{array}
\end{array}
if y < -4.3999999999999998e-49 or 1.9999999999999999e-213 < y Initial program 97.5%
sub-neg97.5%
associate-+l+97.5%
+-commutative97.5%
remove-double-neg97.5%
distribute-frac-neg97.5%
distribute-neg-in97.5%
remove-double-neg97.5%
sub-neg97.5%
neg-mul-197.5%
times-frac99.8%
distribute-frac-neg99.8%
neg-mul-199.8%
*-commutative99.8%
associate-/l*99.7%
*-commutative99.7%
Simplified99.8%
if -4.3999999999999998e-49 < y < 1.9999999999999999e-213Initial program 92.7%
sub-neg92.7%
associate-+l+92.7%
+-commutative92.7%
remove-double-neg92.7%
distribute-frac-neg92.7%
distribute-neg-in92.7%
remove-double-neg92.7%
sub-neg92.7%
neg-mul-192.7%
times-frac86.0%
distribute-frac-neg86.0%
neg-mul-186.0%
*-commutative86.0%
associate-/l*86.0%
*-commutative86.0%
Simplified85.9%
Taylor expanded in t around inf 92.5%
clear-num92.5%
un-div-inv92.5%
associate-/l*98.8%
Applied egg-rr98.8%
Final simplification99.4%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (- (/ t y) y)))
(if (<= y -4.9e-49)
(+ x (/ (* 0.3333333333333333 t_1) z))
(if (<= y 2.1e-213)
(+ x (/ 0.3333333333333333 (* y (/ z t))))
(+ x (* (/ 0.3333333333333333 z) t_1))))))
double code(double x, double y, double z, double t) {
double t_1 = (t / y) - y;
double tmp;
if (y <= -4.9e-49) {
tmp = x + ((0.3333333333333333 * t_1) / z);
} else if (y <= 2.1e-213) {
tmp = x + (0.3333333333333333 / (y * (z / t)));
} else {
tmp = x + ((0.3333333333333333 / z) * t_1);
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: tmp
t_1 = (t / y) - y
if (y <= (-4.9d-49)) then
tmp = x + ((0.3333333333333333d0 * t_1) / z)
else if (y <= 2.1d-213) then
tmp = x + (0.3333333333333333d0 / (y * (z / t)))
else
tmp = x + ((0.3333333333333333d0 / z) * t_1)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = (t / y) - y;
double tmp;
if (y <= -4.9e-49) {
tmp = x + ((0.3333333333333333 * t_1) / z);
} else if (y <= 2.1e-213) {
tmp = x + (0.3333333333333333 / (y * (z / t)));
} else {
tmp = x + ((0.3333333333333333 / z) * t_1);
}
return tmp;
}
def code(x, y, z, t): t_1 = (t / y) - y tmp = 0 if y <= -4.9e-49: tmp = x + ((0.3333333333333333 * t_1) / z) elif y <= 2.1e-213: tmp = x + (0.3333333333333333 / (y * (z / t))) else: tmp = x + ((0.3333333333333333 / z) * t_1) return tmp
function code(x, y, z, t) t_1 = Float64(Float64(t / y) - y) tmp = 0.0 if (y <= -4.9e-49) tmp = Float64(x + Float64(Float64(0.3333333333333333 * t_1) / z)); elseif (y <= 2.1e-213) tmp = Float64(x + Float64(0.3333333333333333 / Float64(y * Float64(z / t)))); else tmp = Float64(x + Float64(Float64(0.3333333333333333 / z) * t_1)); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = (t / y) - y; tmp = 0.0; if (y <= -4.9e-49) tmp = x + ((0.3333333333333333 * t_1) / z); elseif (y <= 2.1e-213) tmp = x + (0.3333333333333333 / (y * (z / t))); else tmp = x + ((0.3333333333333333 / z) * t_1); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(t / y), $MachinePrecision] - y), $MachinePrecision]}, If[LessEqual[y, -4.9e-49], N[(x + N[(N[(0.3333333333333333 * t$95$1), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 2.1e-213], N[(x + N[(0.3333333333333333 / N[(y * N[(z / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(N[(0.3333333333333333 / z), $MachinePrecision] * t$95$1), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{t}{y} - y\\
\mathbf{if}\;y \leq -4.9 \cdot 10^{-49}:\\
\;\;\;\;x + \frac{0.3333333333333333 \cdot t\_1}{z}\\
\mathbf{elif}\;y \leq 2.1 \cdot 10^{-213}:\\
\;\;\;\;x + \frac{0.3333333333333333}{y \cdot \frac{z}{t}}\\
\mathbf{else}:\\
\;\;\;\;x + \frac{0.3333333333333333}{z} \cdot t\_1\\
\end{array}
\end{array}
if y < -4.9000000000000002e-49Initial program 98.5%
sub-neg98.5%
associate-+l+98.5%
+-commutative98.5%
remove-double-neg98.5%
distribute-frac-neg98.5%
distribute-neg-in98.5%
remove-double-neg98.5%
sub-neg98.5%
neg-mul-198.5%
times-frac99.8%
distribute-frac-neg99.8%
neg-mul-199.8%
*-commutative99.8%
associate-/l*99.7%
*-commutative99.7%
Simplified99.7%
associate-*l/99.8%
Applied egg-rr99.8%
if -4.9000000000000002e-49 < y < 2.0999999999999998e-213Initial program 92.7%
sub-neg92.7%
associate-+l+92.7%
+-commutative92.7%
remove-double-neg92.7%
distribute-frac-neg92.7%
distribute-neg-in92.7%
remove-double-neg92.7%
sub-neg92.7%
neg-mul-192.7%
times-frac86.0%
distribute-frac-neg86.0%
neg-mul-186.0%
*-commutative86.0%
associate-/l*86.0%
*-commutative86.0%
Simplified85.9%
Taylor expanded in t around inf 92.5%
clear-num92.5%
un-div-inv92.5%
associate-/l*98.8%
Applied egg-rr98.8%
if 2.0999999999999998e-213 < y Initial program 96.6%
sub-neg96.6%
associate-+l+96.6%
+-commutative96.6%
remove-double-neg96.6%
distribute-frac-neg96.6%
distribute-neg-in96.6%
remove-double-neg96.6%
sub-neg96.6%
neg-mul-196.6%
times-frac99.8%
distribute-frac-neg99.8%
neg-mul-199.8%
*-commutative99.8%
associate-/l*99.8%
*-commutative99.8%
Simplified99.8%
Final simplification99.4%
(FPCore (x y z t)
:precision binary64
(if (<= y -2.6e-48)
(+ x (/ y (* z -3.0)))
(if (<= y 6e+45)
(+ x (* 0.3333333333333333 (/ t (* y z))))
(+ x (* y (/ -0.3333333333333333 z))))))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -2.6e-48) {
tmp = x + (y / (z * -3.0));
} else if (y <= 6e+45) {
tmp = x + (0.3333333333333333 * (t / (y * z)));
} else {
tmp = x + (y * (-0.3333333333333333 / z));
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (y <= (-2.6d-48)) then
tmp = x + (y / (z * (-3.0d0)))
else if (y <= 6d+45) then
tmp = x + (0.3333333333333333d0 * (t / (y * z)))
else
tmp = x + (y * ((-0.3333333333333333d0) / z))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (y <= -2.6e-48) {
tmp = x + (y / (z * -3.0));
} else if (y <= 6e+45) {
tmp = x + (0.3333333333333333 * (t / (y * z)));
} else {
tmp = x + (y * (-0.3333333333333333 / z));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= -2.6e-48: tmp = x + (y / (z * -3.0)) elif y <= 6e+45: tmp = x + (0.3333333333333333 * (t / (y * z))) else: tmp = x + (y * (-0.3333333333333333 / z)) return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= -2.6e-48) tmp = Float64(x + Float64(y / Float64(z * -3.0))); elseif (y <= 6e+45) tmp = Float64(x + Float64(0.3333333333333333 * Float64(t / Float64(y * z)))); else tmp = Float64(x + Float64(y * Float64(-0.3333333333333333 / z))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (y <= -2.6e-48) tmp = x + (y / (z * -3.0)); elseif (y <= 6e+45) tmp = x + (0.3333333333333333 * (t / (y * z))); else tmp = x + (y * (-0.3333333333333333 / z)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, -2.6e-48], N[(x + N[(y / N[(z * -3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 6e+45], N[(x + N[(0.3333333333333333 * N[(t / N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(y * N[(-0.3333333333333333 / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -2.6 \cdot 10^{-48}:\\
\;\;\;\;x + \frac{y}{z \cdot -3}\\
\mathbf{elif}\;y \leq 6 \cdot 10^{+45}:\\
\;\;\;\;x + 0.3333333333333333 \cdot \frac{t}{y \cdot z}\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot \frac{-0.3333333333333333}{z}\\
\end{array}
\end{array}
if y < -2.59999999999999987e-48Initial program 98.5%
sub-neg98.5%
associate-+l+98.5%
+-commutative98.5%
remove-double-neg98.5%
distribute-frac-neg98.5%
distribute-neg-in98.5%
remove-double-neg98.5%
sub-neg98.5%
neg-mul-198.5%
times-frac99.8%
distribute-frac-neg99.8%
neg-mul-199.8%
*-commutative99.8%
associate-/l*99.7%
*-commutative99.7%
Simplified99.7%
Taylor expanded in t around 0 92.1%
associate-*r/92.2%
*-commutative92.2%
associate-/l*92.1%
Simplified92.1%
clear-num92.1%
un-div-inv92.2%
div-inv92.2%
metadata-eval92.2%
Applied egg-rr92.2%
if -2.59999999999999987e-48 < y < 6.00000000000000021e45Initial program 92.8%
sub-neg92.8%
associate-+l+92.8%
+-commutative92.8%
remove-double-neg92.8%
distribute-frac-neg92.8%
distribute-neg-in92.8%
remove-double-neg92.8%
sub-neg92.8%
neg-mul-192.8%
times-frac90.6%
distribute-frac-neg90.6%
neg-mul-190.6%
*-commutative90.6%
associate-/l*90.6%
*-commutative90.6%
Simplified90.5%
Taylor expanded in t around inf 89.0%
if 6.00000000000000021e45 < y Initial program 99.8%
sub-neg99.8%
associate-+l+99.8%
+-commutative99.8%
remove-double-neg99.8%
distribute-frac-neg99.8%
distribute-neg-in99.8%
remove-double-neg99.8%
sub-neg99.8%
neg-mul-199.8%
times-frac99.8%
distribute-frac-neg99.8%
neg-mul-199.8%
*-commutative99.8%
associate-/l*99.8%
*-commutative99.8%
Simplified99.9%
Taylor expanded in t around 0 99.8%
associate-*r/99.7%
*-commutative99.7%
associate-/l*99.9%
Simplified99.9%
Final simplification92.0%
(FPCore (x y z t)
:precision binary64
(if (<= y -2.6e-48)
(+ x (/ y (* z -3.0)))
(if (<= y 2.1e+45)
(+ x (* (/ t z) (/ 0.3333333333333333 y)))
(+ x (* y (/ -0.3333333333333333 z))))))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -2.6e-48) {
tmp = x + (y / (z * -3.0));
} else if (y <= 2.1e+45) {
tmp = x + ((t / z) * (0.3333333333333333 / y));
} else {
tmp = x + (y * (-0.3333333333333333 / z));
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (y <= (-2.6d-48)) then
tmp = x + (y / (z * (-3.0d0)))
else if (y <= 2.1d+45) then
tmp = x + ((t / z) * (0.3333333333333333d0 / y))
else
tmp = x + (y * ((-0.3333333333333333d0) / z))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (y <= -2.6e-48) {
tmp = x + (y / (z * -3.0));
} else if (y <= 2.1e+45) {
tmp = x + ((t / z) * (0.3333333333333333 / y));
} else {
tmp = x + (y * (-0.3333333333333333 / z));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= -2.6e-48: tmp = x + (y / (z * -3.0)) elif y <= 2.1e+45: tmp = x + ((t / z) * (0.3333333333333333 / y)) else: tmp = x + (y * (-0.3333333333333333 / z)) return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= -2.6e-48) tmp = Float64(x + Float64(y / Float64(z * -3.0))); elseif (y <= 2.1e+45) tmp = Float64(x + Float64(Float64(t / z) * Float64(0.3333333333333333 / y))); else tmp = Float64(x + Float64(y * Float64(-0.3333333333333333 / z))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (y <= -2.6e-48) tmp = x + (y / (z * -3.0)); elseif (y <= 2.1e+45) tmp = x + ((t / z) * (0.3333333333333333 / y)); else tmp = x + (y * (-0.3333333333333333 / z)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, -2.6e-48], N[(x + N[(y / N[(z * -3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 2.1e+45], N[(x + N[(N[(t / z), $MachinePrecision] * N[(0.3333333333333333 / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(y * N[(-0.3333333333333333 / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -2.6 \cdot 10^{-48}:\\
\;\;\;\;x + \frac{y}{z \cdot -3}\\
\mathbf{elif}\;y \leq 2.1 \cdot 10^{+45}:\\
\;\;\;\;x + \frac{t}{z} \cdot \frac{0.3333333333333333}{y}\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot \frac{-0.3333333333333333}{z}\\
\end{array}
\end{array}
if y < -2.59999999999999987e-48Initial program 98.5%
sub-neg98.5%
associate-+l+98.5%
+-commutative98.5%
remove-double-neg98.5%
distribute-frac-neg98.5%
distribute-neg-in98.5%
remove-double-neg98.5%
sub-neg98.5%
neg-mul-198.5%
times-frac99.8%
distribute-frac-neg99.8%
neg-mul-199.8%
*-commutative99.8%
associate-/l*99.7%
*-commutative99.7%
Simplified99.7%
Taylor expanded in t around 0 92.1%
associate-*r/92.2%
*-commutative92.2%
associate-/l*92.1%
Simplified92.1%
clear-num92.1%
un-div-inv92.2%
div-inv92.2%
metadata-eval92.2%
Applied egg-rr92.2%
if -2.59999999999999987e-48 < y < 2.09999999999999995e45Initial program 92.8%
sub-neg92.8%
associate-+l+92.8%
+-commutative92.8%
remove-double-neg92.8%
distribute-frac-neg92.8%
distribute-neg-in92.8%
remove-double-neg92.8%
sub-neg92.8%
neg-mul-192.8%
times-frac90.6%
distribute-frac-neg90.6%
neg-mul-190.6%
*-commutative90.6%
associate-/l*90.6%
*-commutative90.6%
Simplified90.5%
Taylor expanded in t around inf 89.0%
associate-*r/89.0%
Simplified89.0%
times-frac93.3%
*-commutative93.3%
Applied egg-rr93.3%
if 2.09999999999999995e45 < y Initial program 99.8%
sub-neg99.8%
associate-+l+99.8%
+-commutative99.8%
remove-double-neg99.8%
distribute-frac-neg99.8%
distribute-neg-in99.8%
remove-double-neg99.8%
sub-neg99.8%
neg-mul-199.8%
times-frac99.8%
distribute-frac-neg99.8%
neg-mul-199.8%
*-commutative99.8%
associate-/l*99.8%
*-commutative99.8%
Simplified99.9%
Taylor expanded in t around 0 99.8%
associate-*r/99.7%
*-commutative99.7%
associate-/l*99.9%
Simplified99.9%
Final simplification94.2%
(FPCore (x y z t)
:precision binary64
(if (<= y -2.6e-48)
(+ x (/ y (* z -3.0)))
(if (<= y 2.7e+45)
(+ x (/ 0.3333333333333333 (* y (/ z t))))
(+ x (* y (/ -0.3333333333333333 z))))))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -2.6e-48) {
tmp = x + (y / (z * -3.0));
} else if (y <= 2.7e+45) {
tmp = x + (0.3333333333333333 / (y * (z / t)));
} else {
tmp = x + (y * (-0.3333333333333333 / z));
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (y <= (-2.6d-48)) then
tmp = x + (y / (z * (-3.0d0)))
else if (y <= 2.7d+45) then
tmp = x + (0.3333333333333333d0 / (y * (z / t)))
else
tmp = x + (y * ((-0.3333333333333333d0) / z))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (y <= -2.6e-48) {
tmp = x + (y / (z * -3.0));
} else if (y <= 2.7e+45) {
tmp = x + (0.3333333333333333 / (y * (z / t)));
} else {
tmp = x + (y * (-0.3333333333333333 / z));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= -2.6e-48: tmp = x + (y / (z * -3.0)) elif y <= 2.7e+45: tmp = x + (0.3333333333333333 / (y * (z / t))) else: tmp = x + (y * (-0.3333333333333333 / z)) return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= -2.6e-48) tmp = Float64(x + Float64(y / Float64(z * -3.0))); elseif (y <= 2.7e+45) tmp = Float64(x + Float64(0.3333333333333333 / Float64(y * Float64(z / t)))); else tmp = Float64(x + Float64(y * Float64(-0.3333333333333333 / z))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (y <= -2.6e-48) tmp = x + (y / (z * -3.0)); elseif (y <= 2.7e+45) tmp = x + (0.3333333333333333 / (y * (z / t))); else tmp = x + (y * (-0.3333333333333333 / z)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, -2.6e-48], N[(x + N[(y / N[(z * -3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 2.7e+45], N[(x + N[(0.3333333333333333 / N[(y * N[(z / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(y * N[(-0.3333333333333333 / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -2.6 \cdot 10^{-48}:\\
\;\;\;\;x + \frac{y}{z \cdot -3}\\
\mathbf{elif}\;y \leq 2.7 \cdot 10^{+45}:\\
\;\;\;\;x + \frac{0.3333333333333333}{y \cdot \frac{z}{t}}\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot \frac{-0.3333333333333333}{z}\\
\end{array}
\end{array}
if y < -2.59999999999999987e-48Initial program 98.5%
sub-neg98.5%
associate-+l+98.5%
+-commutative98.5%
remove-double-neg98.5%
distribute-frac-neg98.5%
distribute-neg-in98.5%
remove-double-neg98.5%
sub-neg98.5%
neg-mul-198.5%
times-frac99.8%
distribute-frac-neg99.8%
neg-mul-199.8%
*-commutative99.8%
associate-/l*99.7%
*-commutative99.7%
Simplified99.7%
Taylor expanded in t around 0 92.1%
associate-*r/92.2%
*-commutative92.2%
associate-/l*92.1%
Simplified92.1%
clear-num92.1%
un-div-inv92.2%
div-inv92.2%
metadata-eval92.2%
Applied egg-rr92.2%
if -2.59999999999999987e-48 < y < 2.69999999999999984e45Initial program 92.8%
sub-neg92.8%
associate-+l+92.8%
+-commutative92.8%
remove-double-neg92.8%
distribute-frac-neg92.8%
distribute-neg-in92.8%
remove-double-neg92.8%
sub-neg92.8%
neg-mul-192.8%
times-frac90.6%
distribute-frac-neg90.6%
neg-mul-190.6%
*-commutative90.6%
associate-/l*90.6%
*-commutative90.6%
Simplified90.5%
Taylor expanded in t around inf 89.0%
clear-num89.0%
un-div-inv89.0%
associate-/l*94.0%
Applied egg-rr94.0%
if 2.69999999999999984e45 < y Initial program 99.8%
sub-neg99.8%
associate-+l+99.8%
+-commutative99.8%
remove-double-neg99.8%
distribute-frac-neg99.8%
distribute-neg-in99.8%
remove-double-neg99.8%
sub-neg99.8%
neg-mul-199.8%
times-frac99.8%
distribute-frac-neg99.8%
neg-mul-199.8%
*-commutative99.8%
associate-/l*99.8%
*-commutative99.8%
Simplified99.9%
Taylor expanded in t around 0 99.8%
associate-*r/99.7%
*-commutative99.7%
associate-/l*99.9%
Simplified99.9%
Final simplification94.6%
(FPCore (x y z t) :precision binary64 (+ x (* -0.3333333333333333 (/ y z))))
double code(double x, double y, double z, double t) {
return x + (-0.3333333333333333 * (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) * (y / z))
end function
public static double code(double x, double y, double z, double t) {
return x + (-0.3333333333333333 * (y / z));
}
def code(x, y, z, t): return x + (-0.3333333333333333 * (y / z))
function code(x, y, z, t) return Float64(x + Float64(-0.3333333333333333 * Float64(y / z))) end
function tmp = code(x, y, z, t) tmp = x + (-0.3333333333333333 * (y / z)); end
code[x_, y_, z_, t_] := N[(x + N[(-0.3333333333333333 * N[(y / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + -0.3333333333333333 \cdot \frac{y}{z}
\end{array}
Initial program 95.8%
sub-neg95.8%
associate-+l+95.8%
+-commutative95.8%
remove-double-neg95.8%
distribute-frac-neg95.8%
distribute-neg-in95.8%
remove-double-neg95.8%
sub-neg95.8%
neg-mul-195.8%
times-frac95.0%
distribute-frac-neg95.0%
neg-mul-195.0%
*-commutative95.0%
associate-/l*95.0%
*-commutative95.0%
Simplified95.0%
Taylor expanded in t around 0 64.0%
Final simplification64.0%
(FPCore (x y z t) :precision binary64 (+ x (* y (/ -0.3333333333333333 z))))
double code(double x, double y, double z, double t) {
return x + (y * (-0.3333333333333333 / z));
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = x + (y * ((-0.3333333333333333d0) / z))
end function
public static double code(double x, double y, double z, double t) {
return x + (y * (-0.3333333333333333 / z));
}
def code(x, y, z, t): return x + (y * (-0.3333333333333333 / z))
function code(x, y, z, t) return Float64(x + Float64(y * Float64(-0.3333333333333333 / z))) end
function tmp = code(x, y, z, t) tmp = x + (y * (-0.3333333333333333 / z)); end
code[x_, y_, z_, t_] := N[(x + N[(y * N[(-0.3333333333333333 / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + y \cdot \frac{-0.3333333333333333}{z}
\end{array}
Initial program 95.8%
sub-neg95.8%
associate-+l+95.8%
+-commutative95.8%
remove-double-neg95.8%
distribute-frac-neg95.8%
distribute-neg-in95.8%
remove-double-neg95.8%
sub-neg95.8%
neg-mul-195.8%
times-frac95.0%
distribute-frac-neg95.0%
neg-mul-195.0%
*-commutative95.0%
associate-/l*95.0%
*-commutative95.0%
Simplified95.0%
Taylor expanded in t around 0 64.0%
associate-*r/64.0%
*-commutative64.0%
associate-/l*64.0%
Simplified64.0%
Final simplification64.0%
(FPCore (x y z t) :precision binary64 (+ x (/ y (* z -3.0))))
double code(double x, double y, double z, double t) {
return x + (y / (z * -3.0));
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = x + (y / (z * (-3.0d0)))
end function
public static double code(double x, double y, double z, double t) {
return x + (y / (z * -3.0));
}
def code(x, y, z, t): return x + (y / (z * -3.0))
function code(x, y, z, t) return Float64(x + Float64(y / Float64(z * -3.0))) end
function tmp = code(x, y, z, t) tmp = x + (y / (z * -3.0)); end
code[x_, y_, z_, t_] := N[(x + N[(y / N[(z * -3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \frac{y}{z \cdot -3}
\end{array}
Initial program 95.8%
sub-neg95.8%
associate-+l+95.8%
+-commutative95.8%
remove-double-neg95.8%
distribute-frac-neg95.8%
distribute-neg-in95.8%
remove-double-neg95.8%
sub-neg95.8%
neg-mul-195.8%
times-frac95.0%
distribute-frac-neg95.0%
neg-mul-195.0%
*-commutative95.0%
associate-/l*95.0%
*-commutative95.0%
Simplified95.0%
Taylor expanded in t around 0 64.0%
associate-*r/64.0%
*-commutative64.0%
associate-/l*64.0%
Simplified64.0%
clear-num64.0%
un-div-inv64.0%
div-inv64.0%
metadata-eval64.0%
Applied egg-rr64.0%
Final simplification64.0%
(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 2024047
(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))))