
(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 15 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 (+ (- x (/ y (* z 3.0))) (/ t (* y (* z 3.0)))))) (if (<= t_1 5e+296) t_1 (+ x (/ (* 0.3333333333333333 (- (/ t y) y)) z)))))
double code(double x, double y, double z, double t) {
double t_1 = (x - (y / (z * 3.0))) + (t / (y * (z * 3.0)));
double tmp;
if (t_1 <= 5e+296) {
tmp = t_1;
} else {
tmp = x + ((0.3333333333333333 * ((t / y) - 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) :: tmp
t_1 = (x - (y / (z * 3.0d0))) + (t / (y * (z * 3.0d0)))
if (t_1 <= 5d+296) then
tmp = t_1
else
tmp = x + ((0.3333333333333333d0 * ((t / y) - y)) / z)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = (x - (y / (z * 3.0))) + (t / (y * (z * 3.0)));
double tmp;
if (t_1 <= 5e+296) {
tmp = t_1;
} else {
tmp = x + ((0.3333333333333333 * ((t / y) - y)) / z);
}
return tmp;
}
def code(x, y, z, t): t_1 = (x - (y / (z * 3.0))) + (t / (y * (z * 3.0))) tmp = 0 if t_1 <= 5e+296: tmp = t_1 else: tmp = x + ((0.3333333333333333 * ((t / y) - y)) / z) return tmp
function code(x, y, z, t) t_1 = Float64(Float64(x - Float64(y / Float64(z * 3.0))) + Float64(t / Float64(y * Float64(z * 3.0)))) tmp = 0.0 if (t_1 <= 5e+296) tmp = t_1; else tmp = Float64(x + Float64(Float64(0.3333333333333333 * Float64(Float64(t / y) - y)) / z)); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = (x - (y / (z * 3.0))) + (t / (y * (z * 3.0))); tmp = 0.0; if (t_1 <= 5e+296) tmp = t_1; else tmp = x + ((0.3333333333333333 * ((t / y) - y)) / z); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(x - N[(y / N[(z * 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(t / N[(y * N[(z * 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, 5e+296], t$95$1, N[(x + N[(N[(0.3333333333333333 * N[(N[(t / y), $MachinePrecision] - y), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(x - \frac{y}{z \cdot 3}\right) + \frac{t}{y \cdot \left(z \cdot 3\right)}\\
\mathbf{if}\;t\_1 \leq 5 \cdot 10^{+296}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;x + \frac{0.3333333333333333 \cdot \left(\frac{t}{y} - y\right)}{z}\\
\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))) < 5.0000000000000001e296Initial program 97.8%
if 5.0000000000000001e296 < (+.f64 (-.f64 x (/.f64 y (*.f64 z #s(literal 3 binary64)))) (/.f64 t (*.f64 (*.f64 z #s(literal 3 binary64)) y))) Initial program 86.9%
sub-neg86.9%
associate-+l+86.9%
+-commutative86.9%
remove-double-neg86.9%
distribute-frac-neg86.9%
distribute-neg-in86.9%
remove-double-neg86.9%
sub-neg86.9%
neg-mul-186.9%
times-frac94.2%
distribute-frac-neg94.2%
neg-mul-194.2%
*-commutative94.2%
associate-/l*94.2%
*-commutative94.2%
Simplified99.9%
associate-*l/99.9%
Applied egg-rr99.9%
Final simplification98.2%
(FPCore (x y z t) :precision binary64 (if (<= (* z 3.0) 1e-36) (+ x (/ (* 0.3333333333333333 (- (/ t y) y)) z)) (+ (+ x (/ t (* z (* y 3.0)))) (/ y (* z -3.0)))))
double code(double x, double y, double z, double t) {
double tmp;
if ((z * 3.0) <= 1e-36) {
tmp = x + ((0.3333333333333333 * ((t / y) - y)) / z);
} else {
tmp = (x + (t / (z * (y * 3.0)))) + (y / (z * -3.0));
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if ((z * 3.0d0) <= 1d-36) then
tmp = x + ((0.3333333333333333d0 * ((t / y) - y)) / z)
else
tmp = (x + (t / (z * (y * 3.0d0)))) + (y / (z * (-3.0d0)))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((z * 3.0) <= 1e-36) {
tmp = x + ((0.3333333333333333 * ((t / y) - y)) / z);
} else {
tmp = (x + (t / (z * (y * 3.0)))) + (y / (z * -3.0));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (z * 3.0) <= 1e-36: tmp = x + ((0.3333333333333333 * ((t / y) - y)) / z) else: tmp = (x + (t / (z * (y * 3.0)))) + (y / (z * -3.0)) return tmp
function code(x, y, z, t) tmp = 0.0 if (Float64(z * 3.0) <= 1e-36) tmp = Float64(x + Float64(Float64(0.3333333333333333 * Float64(Float64(t / y) - y)) / z)); else tmp = Float64(Float64(x + Float64(t / Float64(z * Float64(y * 3.0)))) + Float64(y / Float64(z * -3.0))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((z * 3.0) <= 1e-36) tmp = x + ((0.3333333333333333 * ((t / y) - y)) / z); else tmp = (x + (t / (z * (y * 3.0)))) + (y / (z * -3.0)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[N[(z * 3.0), $MachinePrecision], 1e-36], N[(x + N[(N[(0.3333333333333333 * N[(N[(t / y), $MachinePrecision] - y), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision], N[(N[(x + N[(t / N[(z * N[(y * 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(y / N[(z * -3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \cdot 3 \leq 10^{-36}:\\
\;\;\;\;x + \frac{0.3333333333333333 \cdot \left(\frac{t}{y} - y\right)}{z}\\
\mathbf{else}:\\
\;\;\;\;\left(x + \frac{t}{z \cdot \left(y \cdot 3\right)}\right) + \frac{y}{z \cdot -3}\\
\end{array}
\end{array}
if (*.f64 z #s(literal 3 binary64)) < 9.9999999999999994e-37Initial program 94.3%
sub-neg94.3%
associate-+l+94.3%
+-commutative94.3%
remove-double-neg94.3%
distribute-frac-neg94.3%
distribute-neg-in94.3%
remove-double-neg94.3%
sub-neg94.3%
neg-mul-194.3%
times-frac95.8%
distribute-frac-neg95.8%
neg-mul-195.8%
*-commutative95.8%
associate-/l*95.8%
*-commutative95.8%
Simplified97.3%
associate-*l/97.4%
Applied egg-rr97.4%
if 9.9999999999999994e-37 < (*.f64 z #s(literal 3 binary64)) Initial program 99.5%
+-commutative99.5%
associate-+r-99.5%
sub-neg99.5%
associate-*l*99.5%
*-commutative99.5%
distribute-frac-neg299.5%
distribute-rgt-neg-in99.5%
metadata-eval99.5%
Simplified99.5%
Final simplification97.9%
(FPCore (x y z t) :precision binary64 (if (or (<= y -2.1e+32) (not (<= y 1.5e-23))) (- x (* y (/ 0.3333333333333333 z))) (+ x (/ (/ t z) (* y 3.0)))))
double code(double x, double y, double z, double t) {
double tmp;
if ((y <= -2.1e+32) || !(y <= 1.5e-23)) {
tmp = x - (y * (0.3333333333333333 / z));
} else {
tmp = x + ((t / z) / (y * 3.0));
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if ((y <= (-2.1d+32)) .or. (.not. (y <= 1.5d-23))) then
tmp = x - (y * (0.3333333333333333d0 / z))
else
tmp = x + ((t / z) / (y * 3.0d0))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((y <= -2.1e+32) || !(y <= 1.5e-23)) {
tmp = x - (y * (0.3333333333333333 / z));
} else {
tmp = x + ((t / z) / (y * 3.0));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (y <= -2.1e+32) or not (y <= 1.5e-23): tmp = x - (y * (0.3333333333333333 / z)) else: tmp = x + ((t / z) / (y * 3.0)) return tmp
function code(x, y, z, t) tmp = 0.0 if ((y <= -2.1e+32) || !(y <= 1.5e-23)) tmp = Float64(x - Float64(y * Float64(0.3333333333333333 / z))); else tmp = Float64(x + Float64(Float64(t / z) / Float64(y * 3.0))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((y <= -2.1e+32) || ~((y <= 1.5e-23))) tmp = x - (y * (0.3333333333333333 / z)); else tmp = x + ((t / z) / (y * 3.0)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[y, -2.1e+32], N[Not[LessEqual[y, 1.5e-23]], $MachinePrecision]], N[(x - N[(y * N[(0.3333333333333333 / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(N[(t / z), $MachinePrecision] / N[(y * 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -2.1 \cdot 10^{+32} \lor \neg \left(y \leq 1.5 \cdot 10^{-23}\right):\\
\;\;\;\;x - y \cdot \frac{0.3333333333333333}{z}\\
\mathbf{else}:\\
\;\;\;\;x + \frac{\frac{t}{z}}{y \cdot 3}\\
\end{array}
\end{array}
if y < -2.1000000000000001e32 or 1.50000000000000001e-23 < 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-frac97.5%
distribute-frac-neg97.5%
neg-mul-197.5%
*-commutative97.5%
associate-/l*97.4%
*-commutative97.4%
Simplified99.9%
Taylor expanded in t around 0 88.4%
neg-mul-188.4%
Simplified88.4%
div-inv88.3%
distribute-rgt-neg-out88.3%
unsub-neg88.3%
*-commutative88.3%
div-inv88.4%
Applied egg-rr88.4%
if -2.1000000000000001e32 < y < 1.50000000000000001e-23Initial program 94.6%
sub-neg94.6%
associate-+l+94.6%
+-commutative94.6%
remove-double-neg94.6%
distribute-frac-neg94.6%
distribute-neg-in94.6%
remove-double-neg94.6%
sub-neg94.6%
neg-mul-194.6%
times-frac90.9%
distribute-frac-neg90.9%
neg-mul-190.9%
*-commutative90.9%
associate-/l*90.9%
*-commutative90.9%
Simplified90.9%
Taylor expanded in t around inf 89.1%
*-commutative89.1%
metadata-eval89.1%
times-frac89.2%
*-rgt-identity89.2%
*-commutative89.2%
associate-*r*89.2%
associate-/r*93.6%
Simplified93.6%
Final simplification91.0%
(FPCore (x y z t) :precision binary64 (if (or (<= y -1.4e+30) (not (<= y 1.5e-23))) (- x (* y (/ 0.3333333333333333 z))) (+ x (/ (* t (/ 0.3333333333333333 z)) y))))
double code(double x, double y, double z, double t) {
double tmp;
if ((y <= -1.4e+30) || !(y <= 1.5e-23)) {
tmp = x - (y * (0.3333333333333333 / z));
} else {
tmp = x + ((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.4d+30)) .or. (.not. (y <= 1.5d-23))) then
tmp = x - (y * (0.3333333333333333d0 / z))
else
tmp = x + ((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.4e+30) || !(y <= 1.5e-23)) {
tmp = x - (y * (0.3333333333333333 / z));
} else {
tmp = x + ((t * (0.3333333333333333 / z)) / y);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (y <= -1.4e+30) or not (y <= 1.5e-23): tmp = x - (y * (0.3333333333333333 / z)) else: tmp = x + ((t * (0.3333333333333333 / z)) / y) return tmp
function code(x, y, z, t) tmp = 0.0 if ((y <= -1.4e+30) || !(y <= 1.5e-23)) tmp = Float64(x - Float64(y * Float64(0.3333333333333333 / z))); else tmp = Float64(x + Float64(Float64(t * Float64(0.3333333333333333 / z)) / y)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((y <= -1.4e+30) || ~((y <= 1.5e-23))) tmp = x - (y * (0.3333333333333333 / z)); else tmp = x + ((t * (0.3333333333333333 / z)) / y); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[y, -1.4e+30], N[Not[LessEqual[y, 1.5e-23]], $MachinePrecision]], N[(x - N[(y * N[(0.3333333333333333 / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(N[(t * N[(0.3333333333333333 / z), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.4 \cdot 10^{+30} \lor \neg \left(y \leq 1.5 \cdot 10^{-23}\right):\\
\;\;\;\;x - y \cdot \frac{0.3333333333333333}{z}\\
\mathbf{else}:\\
\;\;\;\;x + \frac{t \cdot \frac{0.3333333333333333}{z}}{y}\\
\end{array}
\end{array}
if y < -1.39999999999999992e30 or 1.50000000000000001e-23 < 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-frac97.5%
distribute-frac-neg97.5%
neg-mul-197.5%
*-commutative97.5%
associate-/l*97.4%
*-commutative97.4%
Simplified99.9%
Taylor expanded in t around 0 88.4%
neg-mul-188.4%
Simplified88.4%
div-inv88.3%
distribute-rgt-neg-out88.3%
unsub-neg88.3%
*-commutative88.3%
div-inv88.4%
Applied egg-rr88.4%
if -1.39999999999999992e30 < y < 1.50000000000000001e-23Initial program 94.6%
sub-neg94.6%
associate-+l+94.6%
+-commutative94.6%
remove-double-neg94.6%
distribute-frac-neg94.6%
distribute-neg-in94.6%
remove-double-neg94.6%
sub-neg94.6%
neg-mul-194.6%
times-frac90.9%
distribute-frac-neg90.9%
neg-mul-190.9%
*-commutative90.9%
associate-/l*90.9%
*-commutative90.9%
Simplified90.9%
Taylor expanded in t around inf 84.7%
div-inv84.8%
*-commutative84.8%
associate-*l/93.5%
div-inv93.5%
Applied egg-rr93.5%
Final simplification91.0%
(FPCore (x y z t) :precision binary64 (if (or (<= y -4e+30) (not (<= y 1.5e-23))) (- x (* y (/ 0.3333333333333333 z))) (+ x (* (/ 0.3333333333333333 y) (/ t z)))))
double code(double x, double y, double z, double t) {
double tmp;
if ((y <= -4e+30) || !(y <= 1.5e-23)) {
tmp = x - (y * (0.3333333333333333 / z));
} else {
tmp = x + ((0.3333333333333333 / y) * (t / z));
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if ((y <= (-4d+30)) .or. (.not. (y <= 1.5d-23))) then
tmp = x - (y * (0.3333333333333333d0 / z))
else
tmp = x + ((0.3333333333333333d0 / y) * (t / z))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((y <= -4e+30) || !(y <= 1.5e-23)) {
tmp = x - (y * (0.3333333333333333 / z));
} else {
tmp = x + ((0.3333333333333333 / y) * (t / z));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (y <= -4e+30) or not (y <= 1.5e-23): tmp = x - (y * (0.3333333333333333 / z)) else: tmp = x + ((0.3333333333333333 / y) * (t / z)) return tmp
function code(x, y, z, t) tmp = 0.0 if ((y <= -4e+30) || !(y <= 1.5e-23)) tmp = Float64(x - Float64(y * Float64(0.3333333333333333 / z))); else tmp = Float64(x + Float64(Float64(0.3333333333333333 / y) * Float64(t / z))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((y <= -4e+30) || ~((y <= 1.5e-23))) tmp = x - (y * (0.3333333333333333 / z)); else tmp = x + ((0.3333333333333333 / y) * (t / z)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[y, -4e+30], N[Not[LessEqual[y, 1.5e-23]], $MachinePrecision]], N[(x - N[(y * N[(0.3333333333333333 / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(N[(0.3333333333333333 / y), $MachinePrecision] * N[(t / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -4 \cdot 10^{+30} \lor \neg \left(y \leq 1.5 \cdot 10^{-23}\right):\\
\;\;\;\;x - y \cdot \frac{0.3333333333333333}{z}\\
\mathbf{else}:\\
\;\;\;\;x + \frac{0.3333333333333333}{y} \cdot \frac{t}{z}\\
\end{array}
\end{array}
if y < -4.0000000000000001e30 or 1.50000000000000001e-23 < 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-frac97.5%
distribute-frac-neg97.5%
neg-mul-197.5%
*-commutative97.5%
associate-/l*97.4%
*-commutative97.4%
Simplified99.9%
Taylor expanded in t around 0 88.4%
neg-mul-188.4%
Simplified88.4%
div-inv88.3%
distribute-rgt-neg-out88.3%
unsub-neg88.3%
*-commutative88.3%
div-inv88.4%
Applied egg-rr88.4%
if -4.0000000000000001e30 < y < 1.50000000000000001e-23Initial program 94.6%
sub-neg94.6%
associate-+l+94.6%
+-commutative94.6%
remove-double-neg94.6%
distribute-frac-neg94.6%
distribute-neg-in94.6%
remove-double-neg94.6%
sub-neg94.6%
neg-mul-194.6%
times-frac90.9%
distribute-frac-neg90.9%
neg-mul-190.9%
*-commutative90.9%
associate-/l*90.9%
*-commutative90.9%
Simplified90.9%
associate-*l/91.0%
Applied egg-rr91.0%
Taylor expanded in t around inf 89.1%
associate-*r/89.1%
times-frac93.5%
Simplified93.5%
Final simplification91.0%
(FPCore (x y z t) :precision binary64 (if (or (<= y -4.6e+31) (not (<= y 1.5e-23))) (- x (* y (/ 0.3333333333333333 z))) (+ x (* 0.3333333333333333 (/ t (* y z))))))
double code(double x, double y, double z, double t) {
double tmp;
if ((y <= -4.6e+31) || !(y <= 1.5e-23)) {
tmp = x - (y * (0.3333333333333333 / z));
} else {
tmp = x + (0.3333333333333333 * (t / (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 <= (-4.6d+31)) .or. (.not. (y <= 1.5d-23))) then
tmp = x - (y * (0.3333333333333333d0 / z))
else
tmp = x + (0.3333333333333333d0 * (t / (y * z)))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((y <= -4.6e+31) || !(y <= 1.5e-23)) {
tmp = x - (y * (0.3333333333333333 / z));
} else {
tmp = x + (0.3333333333333333 * (t / (y * z)));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (y <= -4.6e+31) or not (y <= 1.5e-23): tmp = x - (y * (0.3333333333333333 / z)) else: tmp = x + (0.3333333333333333 * (t / (y * z))) return tmp
function code(x, y, z, t) tmp = 0.0 if ((y <= -4.6e+31) || !(y <= 1.5e-23)) tmp = Float64(x - Float64(y * Float64(0.3333333333333333 / z))); else tmp = Float64(x + Float64(0.3333333333333333 * Float64(t / Float64(y * z)))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((y <= -4.6e+31) || ~((y <= 1.5e-23))) tmp = x - (y * (0.3333333333333333 / z)); else tmp = x + (0.3333333333333333 * (t / (y * z))); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[y, -4.6e+31], N[Not[LessEqual[y, 1.5e-23]], $MachinePrecision]], N[(x - N[(y * N[(0.3333333333333333 / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(0.3333333333333333 * N[(t / N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -4.6 \cdot 10^{+31} \lor \neg \left(y \leq 1.5 \cdot 10^{-23}\right):\\
\;\;\;\;x - y \cdot \frac{0.3333333333333333}{z}\\
\mathbf{else}:\\
\;\;\;\;x + 0.3333333333333333 \cdot \frac{t}{y \cdot z}\\
\end{array}
\end{array}
if y < -4.5999999999999999e31 or 1.50000000000000001e-23 < 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-frac97.5%
distribute-frac-neg97.5%
neg-mul-197.5%
*-commutative97.5%
associate-/l*97.4%
*-commutative97.4%
Simplified99.9%
Taylor expanded in t around 0 88.4%
neg-mul-188.4%
Simplified88.4%
div-inv88.3%
distribute-rgt-neg-out88.3%
unsub-neg88.3%
*-commutative88.3%
div-inv88.4%
Applied egg-rr88.4%
if -4.5999999999999999e31 < y < 1.50000000000000001e-23Initial program 94.6%
sub-neg94.6%
associate-+l+94.6%
+-commutative94.6%
remove-double-neg94.6%
distribute-frac-neg94.6%
distribute-neg-in94.6%
remove-double-neg94.6%
sub-neg94.6%
neg-mul-194.6%
times-frac90.9%
distribute-frac-neg90.9%
neg-mul-190.9%
*-commutative90.9%
associate-/l*90.9%
*-commutative90.9%
Simplified90.9%
Taylor expanded in t around inf 89.1%
Final simplification88.8%
(FPCore (x y z t) :precision binary64 (if (<= (* z 3.0) -1e+141) x (if (<= (* z 3.0) 50.0) (/ y (* z -3.0)) x)))
double code(double x, double y, double z, double t) {
double tmp;
if ((z * 3.0) <= -1e+141) {
tmp = x;
} else if ((z * 3.0) <= 50.0) {
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 * 3.0d0) <= (-1d+141)) then
tmp = x
else if ((z * 3.0d0) <= 50.0d0) 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 * 3.0) <= -1e+141) {
tmp = x;
} else if ((z * 3.0) <= 50.0) {
tmp = y / (z * -3.0);
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (z * 3.0) <= -1e+141: tmp = x elif (z * 3.0) <= 50.0: tmp = y / (z * -3.0) else: tmp = x return tmp
function code(x, y, z, t) tmp = 0.0 if (Float64(z * 3.0) <= -1e+141) tmp = x; elseif (Float64(z * 3.0) <= 50.0) 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 * 3.0) <= -1e+141) tmp = x; elseif ((z * 3.0) <= 50.0) tmp = y / (z * -3.0); else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[N[(z * 3.0), $MachinePrecision], -1e+141], x, If[LessEqual[N[(z * 3.0), $MachinePrecision], 50.0], N[(y / N[(z * -3.0), $MachinePrecision]), $MachinePrecision], x]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \cdot 3 \leq -1 \cdot 10^{+141}:\\
\;\;\;\;x\\
\mathbf{elif}\;z \cdot 3 \leq 50:\\
\;\;\;\;\frac{y}{z \cdot -3}\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if (*.f64 z #s(literal 3 binary64)) < -1.00000000000000002e141 or 50 < (*.f64 z #s(literal 3 binary64)) Initial program 98.5%
sub-neg98.5%
associate-+l+98.5%
distribute-frac-neg98.5%
neg-mul-198.5%
*-commutative98.5%
times-frac98.4%
fma-define98.4%
metadata-eval98.4%
associate-*l*98.5%
*-commutative98.5%
Simplified98.5%
Taylor expanded in x around inf 59.5%
if -1.00000000000000002e141 < (*.f64 z #s(literal 3 binary64)) < 50Initial program 94.0%
sub-neg94.0%
associate-+l+94.0%
distribute-frac-neg94.0%
neg-mul-194.0%
*-commutative94.0%
times-frac93.3%
fma-define93.3%
metadata-eval93.3%
associate-*l*93.3%
*-commutative93.3%
Simplified93.3%
Taylor expanded in y around inf 57.3%
Taylor expanded in x around 0 45.0%
clear-num45.0%
un-div-inv45.0%
div-inv45.1%
metadata-eval45.1%
Applied egg-rr45.1%
(FPCore (x y z t) :precision binary64 (if (<= (* z 3.0) 2e+148) (+ x (/ (* 0.3333333333333333 (- (/ t y) y)) z)) (+ x (* (/ 0.3333333333333333 y) (/ t z)))))
double code(double x, double y, double z, double t) {
double tmp;
if ((z * 3.0) <= 2e+148) {
tmp = x + ((0.3333333333333333 * ((t / y) - y)) / z);
} else {
tmp = x + ((0.3333333333333333 / y) * (t / z));
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if ((z * 3.0d0) <= 2d+148) then
tmp = x + ((0.3333333333333333d0 * ((t / y) - y)) / z)
else
tmp = x + ((0.3333333333333333d0 / y) * (t / z))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((z * 3.0) <= 2e+148) {
tmp = x + ((0.3333333333333333 * ((t / y) - y)) / z);
} else {
tmp = x + ((0.3333333333333333 / y) * (t / z));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (z * 3.0) <= 2e+148: tmp = x + ((0.3333333333333333 * ((t / y) - y)) / z) else: tmp = x + ((0.3333333333333333 / y) * (t / z)) return tmp
function code(x, y, z, t) tmp = 0.0 if (Float64(z * 3.0) <= 2e+148) tmp = Float64(x + Float64(Float64(0.3333333333333333 * Float64(Float64(t / y) - y)) / z)); else tmp = Float64(x + Float64(Float64(0.3333333333333333 / y) * Float64(t / z))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((z * 3.0) <= 2e+148) tmp = x + ((0.3333333333333333 * ((t / y) - y)) / z); else tmp = x + ((0.3333333333333333 / y) * (t / z)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[N[(z * 3.0), $MachinePrecision], 2e+148], N[(x + N[(N[(0.3333333333333333 * N[(N[(t / y), $MachinePrecision] - y), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision], N[(x + N[(N[(0.3333333333333333 / y), $MachinePrecision] * N[(t / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \cdot 3 \leq 2 \cdot 10^{+148}:\\
\;\;\;\;x + \frac{0.3333333333333333 \cdot \left(\frac{t}{y} - y\right)}{z}\\
\mathbf{else}:\\
\;\;\;\;x + \frac{0.3333333333333333}{y} \cdot \frac{t}{z}\\
\end{array}
\end{array}
if (*.f64 z #s(literal 3 binary64)) < 2.0000000000000001e148Initial program 95.1%
sub-neg95.1%
associate-+l+95.1%
+-commutative95.1%
remove-double-neg95.1%
distribute-frac-neg95.1%
distribute-neg-in95.1%
remove-double-neg95.1%
sub-neg95.1%
neg-mul-195.1%
times-frac96.0%
distribute-frac-neg96.0%
neg-mul-196.0%
*-commutative96.0%
associate-/l*95.9%
*-commutative95.9%
Simplified97.3%
associate-*l/97.3%
Applied egg-rr97.3%
if 2.0000000000000001e148 < (*.f64 z #s(literal 3 binary64)) Initial program 99.2%
sub-neg99.2%
associate-+l+99.2%
+-commutative99.2%
remove-double-neg99.2%
distribute-frac-neg99.2%
distribute-neg-in99.2%
remove-double-neg99.2%
sub-neg99.2%
neg-mul-199.2%
times-frac79.6%
distribute-frac-neg79.6%
neg-mul-179.6%
*-commutative79.6%
associate-/l*79.6%
*-commutative79.6%
Simplified79.8%
associate-*l/79.7%
Applied egg-rr79.7%
Taylor expanded in t around inf 93.3%
associate-*r/93.3%
times-frac93.5%
Simplified93.5%
(FPCore (x y z t) :precision binary64 (if (<= z -1.15e+139) x (if (<= z 29.0) (* y (/ -0.3333333333333333 z)) x)))
double code(double x, double y, double z, double t) {
double tmp;
if (z <= -1.15e+139) {
tmp = x;
} else if (z <= 29.0) {
tmp = y * (-0.3333333333333333 / z);
} else {
tmp = x;
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (z <= (-1.15d+139)) then
tmp = x
else if (z <= 29.0d0) then
tmp = y * ((-0.3333333333333333d0) / z)
else
tmp = x
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (z <= -1.15e+139) {
tmp = x;
} else if (z <= 29.0) {
tmp = y * (-0.3333333333333333 / z);
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if z <= -1.15e+139: tmp = x elif z <= 29.0: tmp = y * (-0.3333333333333333 / z) else: tmp = x return tmp
function code(x, y, z, t) tmp = 0.0 if (z <= -1.15e+139) tmp = x; elseif (z <= 29.0) tmp = Float64(y * Float64(-0.3333333333333333 / z)); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (z <= -1.15e+139) tmp = x; elseif (z <= 29.0) tmp = y * (-0.3333333333333333 / z); else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[z, -1.15e+139], x, If[LessEqual[z, 29.0], N[(y * N[(-0.3333333333333333 / z), $MachinePrecision]), $MachinePrecision], x]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.15 \cdot 10^{+139}:\\
\;\;\;\;x\\
\mathbf{elif}\;z \leq 29:\\
\;\;\;\;y \cdot \frac{-0.3333333333333333}{z}\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if z < -1.15e139 or 29 < z Initial program 98.5%
sub-neg98.5%
associate-+l+98.5%
distribute-frac-neg98.5%
neg-mul-198.5%
*-commutative98.5%
times-frac98.4%
fma-define98.4%
metadata-eval98.4%
associate-*l*98.5%
*-commutative98.5%
Simplified98.5%
Taylor expanded in x around inf 59.5%
if -1.15e139 < z < 29Initial program 94.0%
sub-neg94.0%
associate-+l+94.0%
distribute-frac-neg94.0%
neg-mul-194.0%
*-commutative94.0%
times-frac93.3%
fma-define93.3%
metadata-eval93.3%
associate-*l*93.3%
*-commutative93.3%
Simplified93.3%
Taylor expanded in y around inf 57.3%
Taylor expanded in x around 0 45.0%
(FPCore (x y z t) :precision binary64 (if (<= z -1.5e+139) x (if (<= z 26.5) (* (/ y z) -0.3333333333333333) x)))
double code(double x, double y, double z, double t) {
double tmp;
if (z <= -1.5e+139) {
tmp = x;
} else if (z <= 26.5) {
tmp = (y / z) * -0.3333333333333333;
} 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 <= (-1.5d+139)) then
tmp = x
else if (z <= 26.5d0) then
tmp = (y / z) * (-0.3333333333333333d0)
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 <= -1.5e+139) {
tmp = x;
} else if (z <= 26.5) {
tmp = (y / z) * -0.3333333333333333;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if z <= -1.5e+139: tmp = x elif z <= 26.5: tmp = (y / z) * -0.3333333333333333 else: tmp = x return tmp
function code(x, y, z, t) tmp = 0.0 if (z <= -1.5e+139) tmp = x; elseif (z <= 26.5) tmp = Float64(Float64(y / z) * -0.3333333333333333); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (z <= -1.5e+139) tmp = x; elseif (z <= 26.5) tmp = (y / z) * -0.3333333333333333; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[z, -1.5e+139], x, If[LessEqual[z, 26.5], N[(N[(y / z), $MachinePrecision] * -0.3333333333333333), $MachinePrecision], x]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.5 \cdot 10^{+139}:\\
\;\;\;\;x\\
\mathbf{elif}\;z \leq 26.5:\\
\;\;\;\;\frac{y}{z} \cdot -0.3333333333333333\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if z < -1.5e139 or 26.5 < z Initial program 98.5%
sub-neg98.5%
associate-+l+98.5%
distribute-frac-neg98.5%
neg-mul-198.5%
*-commutative98.5%
times-frac98.4%
fma-define98.4%
metadata-eval98.4%
associate-*l*98.5%
*-commutative98.5%
Simplified98.5%
Taylor expanded in x around inf 59.5%
if -1.5e139 < z < 26.5Initial program 94.0%
sub-neg94.0%
associate-+l+94.0%
distribute-frac-neg94.0%
neg-mul-194.0%
*-commutative94.0%
times-frac93.3%
fma-define93.3%
metadata-eval93.3%
associate-*l*93.3%
*-commutative93.3%
Simplified93.3%
Taylor expanded in y around inf 57.3%
Taylor expanded in x around 0 45.0%
Taylor expanded in y around 0 45.0%
Final simplification50.2%
(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 95.6%
sub-neg95.6%
associate-+l+95.6%
+-commutative95.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-frac94.1%
distribute-frac-neg94.1%
neg-mul-194.1%
*-commutative94.1%
associate-/l*94.1%
*-commutative94.1%
Simplified95.3%
Final simplification95.3%
(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.6%
sub-neg95.6%
associate-+l+95.6%
+-commutative95.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-frac94.1%
distribute-frac-neg94.1%
neg-mul-194.1%
*-commutative94.1%
associate-/l*94.1%
*-commutative94.1%
Simplified95.3%
Taylor expanded in t around 0 60.0%
neg-mul-160.0%
Simplified60.0%
div-inv59.9%
distribute-rgt-neg-out59.9%
unsub-neg59.9%
*-commutative59.9%
div-inv60.0%
Applied egg-rr60.0%
(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.6%
Taylor expanded in t around 0 60.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(Float64(y * -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[(N[(y * -0.3333333333333333), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \frac{y \cdot -0.3333333333333333}{z}
\end{array}
Initial program 95.6%
sub-neg95.6%
associate-+l+95.6%
+-commutative95.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-frac94.1%
distribute-frac-neg94.1%
neg-mul-194.1%
*-commutative94.1%
associate-/l*94.1%
*-commutative94.1%
Simplified95.3%
associate-*l/95.3%
Applied egg-rr95.3%
Taylor expanded in t around 0 60.0%
Final simplification60.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 95.6%
sub-neg95.6%
associate-+l+95.6%
distribute-frac-neg95.6%
neg-mul-195.6%
*-commutative95.6%
times-frac95.1%
fma-define95.1%
metadata-eval95.1%
associate-*l*95.1%
*-commutative95.1%
Simplified95.1%
Taylor expanded in x around inf 28.1%
(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 2024133
(FPCore (x y z t)
:name "Diagrams.Solve.Polynomial:cubForm from diagrams-solve-0.1, H"
:precision binary64
:alt
(! :herbie-platform default (+ (- x (/ y (* z 3))) (/ (/ t (* z 3)) y)))
(+ (- x (/ y (* z 3.0))) (/ t (* (* z 3.0) y))))