
(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 (if (<= (* z 3.0) -1e+19) (+ (- x (/ y (* z 3.0))) (/ t (* (* z 3.0) y))) (+ x (/ (- (/ t y) y) (* z 3.0)))))
double code(double x, double y, double z, double t) {
double tmp;
if ((z * 3.0) <= -1e+19) {
tmp = (x - (y / (z * 3.0))) + (t / ((z * 3.0) * y));
} else {
tmp = x + (((t / y) - y) / (z * 3.0));
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if ((z * 3.0d0) <= (-1d+19)) then
tmp = (x - (y / (z * 3.0d0))) + (t / ((z * 3.0d0) * y))
else
tmp = x + (((t / y) - y) / (z * 3.0d0))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((z * 3.0) <= -1e+19) {
tmp = (x - (y / (z * 3.0))) + (t / ((z * 3.0) * y));
} else {
tmp = x + (((t / y) - y) / (z * 3.0));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (z * 3.0) <= -1e+19: tmp = (x - (y / (z * 3.0))) + (t / ((z * 3.0) * y)) else: tmp = x + (((t / y) - y) / (z * 3.0)) return tmp
function code(x, y, z, t) tmp = 0.0 if (Float64(z * 3.0) <= -1e+19) tmp = Float64(Float64(x - Float64(y / Float64(z * 3.0))) + Float64(t / Float64(Float64(z * 3.0) * y))); else tmp = Float64(x + Float64(Float64(Float64(t / y) - y) / Float64(z * 3.0))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((z * 3.0) <= -1e+19) tmp = (x - (y / (z * 3.0))) + (t / ((z * 3.0) * y)); else tmp = x + (((t / y) - y) / (z * 3.0)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[N[(z * 3.0), $MachinePrecision], -1e+19], N[(N[(x - N[(y / N[(z * 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(t / N[(N[(z * 3.0), $MachinePrecision] * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(N[(N[(t / y), $MachinePrecision] - y), $MachinePrecision] / N[(z * 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \cdot 3 \leq -1 \cdot 10^{+19}:\\
\;\;\;\;\left(x - \frac{y}{z \cdot 3}\right) + \frac{t}{\left(z \cdot 3\right) \cdot y}\\
\mathbf{else}:\\
\;\;\;\;x + \frac{\frac{t}{y} - y}{z \cdot 3}\\
\end{array}
\end{array}
if (*.f64 z #s(literal 3 binary64)) < -1e19Initial program 99.8%
if -1e19 < (*.f64 z #s(literal 3 binary64)) Initial program 91.8%
lift-*.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-/.f64N/A
associate-+l-N/A
lower--.f64N/A
lift-/.f64N/A
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/r*N/A
sub-divN/A
lower-/.f64N/A
lower--.f64N/A
lower-/.f6499.3
Applied egg-rr99.3%
Final simplification99.4%
(FPCore (x y z t) :precision binary64 (if (<= (* z 3.0) -1e+19) (fma (/ y z) -0.3333333333333333 (+ x (/ t (* (* z 3.0) y)))) (+ x (/ (- (/ t y) y) (* z 3.0)))))
double code(double x, double y, double z, double t) {
double tmp;
if ((z * 3.0) <= -1e+19) {
tmp = fma((y / z), -0.3333333333333333, (x + (t / ((z * 3.0) * y))));
} else {
tmp = x + (((t / y) - y) / (z * 3.0));
}
return tmp;
}
function code(x, y, z, t) tmp = 0.0 if (Float64(z * 3.0) <= -1e+19) tmp = fma(Float64(y / z), -0.3333333333333333, Float64(x + Float64(t / Float64(Float64(z * 3.0) * y)))); else tmp = Float64(x + Float64(Float64(Float64(t / y) - y) / Float64(z * 3.0))); end return tmp end
code[x_, y_, z_, t_] := If[LessEqual[N[(z * 3.0), $MachinePrecision], -1e+19], N[(N[(y / z), $MachinePrecision] * -0.3333333333333333 + N[(x + N[(t / N[(N[(z * 3.0), $MachinePrecision] * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(N[(N[(t / y), $MachinePrecision] - y), $MachinePrecision] / N[(z * 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \cdot 3 \leq -1 \cdot 10^{+19}:\\
\;\;\;\;\mathsf{fma}\left(\frac{y}{z}, -0.3333333333333333, x + \frac{t}{\left(z \cdot 3\right) \cdot y}\right)\\
\mathbf{else}:\\
\;\;\;\;x + \frac{\frac{t}{y} - y}{z \cdot 3}\\
\end{array}
\end{array}
if (*.f64 z #s(literal 3 binary64)) < -1e19Initial program 99.8%
lift-*.f64N/A
lift-/.f64N/A
sub-negN/A
+-commutativeN/A
lift-*.f64N/A
lift-*.f64N/A
lift-/.f64N/A
associate-+l+N/A
lift-/.f64N/A
lift-*.f64N/A
associate-/r*N/A
div-invN/A
distribute-rgt-neg-inN/A
lower-fma.f64N/A
lower-/.f64N/A
metadata-evalN/A
metadata-evalN/A
lower-+.f6499.7
lift-*.f64N/A
*-commutativeN/A
lower-*.f6499.7
Applied egg-rr99.7%
if -1e19 < (*.f64 z #s(literal 3 binary64)) Initial program 91.8%
lift-*.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-/.f64N/A
associate-+l-N/A
lower--.f64N/A
lift-/.f64N/A
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/r*N/A
sub-divN/A
lower-/.f64N/A
lower--.f64N/A
lower-/.f6499.3
Applied egg-rr99.3%
Final simplification99.4%
(FPCore (x y z t) :precision binary64 (if (<= (* z 3.0) -1e+19) (fma (/ t (* z y)) 0.3333333333333333 (fma y (/ -0.3333333333333333 z) x)) (+ x (/ (- (/ t y) y) (* z 3.0)))))
double code(double x, double y, double z, double t) {
double tmp;
if ((z * 3.0) <= -1e+19) {
tmp = fma((t / (z * y)), 0.3333333333333333, fma(y, (-0.3333333333333333 / z), x));
} else {
tmp = x + (((t / y) - y) / (z * 3.0));
}
return tmp;
}
function code(x, y, z, t) tmp = 0.0 if (Float64(z * 3.0) <= -1e+19) tmp = fma(Float64(t / Float64(z * y)), 0.3333333333333333, fma(y, Float64(-0.3333333333333333 / z), x)); else tmp = Float64(x + Float64(Float64(Float64(t / y) - y) / Float64(z * 3.0))); end return tmp end
code[x_, y_, z_, t_] := If[LessEqual[N[(z * 3.0), $MachinePrecision], -1e+19], N[(N[(t / N[(z * y), $MachinePrecision]), $MachinePrecision] * 0.3333333333333333 + N[(y * N[(-0.3333333333333333 / z), $MachinePrecision] + x), $MachinePrecision]), $MachinePrecision], N[(x + N[(N[(N[(t / y), $MachinePrecision] - y), $MachinePrecision] / N[(z * 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \cdot 3 \leq -1 \cdot 10^{+19}:\\
\;\;\;\;\mathsf{fma}\left(\frac{t}{z \cdot y}, 0.3333333333333333, \mathsf{fma}\left(y, \frac{-0.3333333333333333}{z}, x\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x + \frac{\frac{t}{y} - y}{z \cdot 3}\\
\end{array}
\end{array}
if (*.f64 z #s(literal 3 binary64)) < -1e19Initial program 99.8%
lift-*.f64N/A
lift-/.f64N/A
lift--.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-/.f64N/A
+-commutativeN/A
lift-/.f64N/A
lift-*.f64N/A
*-rgt-identityN/A
*-commutativeN/A
lift-*.f64N/A
associate-*r*N/A
times-fracN/A
lower-fma.f64N/A
lower-/.f64N/A
lower-*.f64N/A
metadata-eval99.7
lift--.f64N/A
sub-negN/A
+-commutativeN/A
Applied egg-rr99.7%
if -1e19 < (*.f64 z #s(literal 3 binary64)) Initial program 91.8%
lift-*.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-/.f64N/A
associate-+l-N/A
lower--.f64N/A
lift-/.f64N/A
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/r*N/A
sub-divN/A
lower-/.f64N/A
lower--.f64N/A
lower-/.f6499.3
Applied egg-rr99.3%
Final simplification99.4%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (+ x (/ y (* z -3.0)))))
(if (<= y -1600.0)
t_1
(if (<= y 3.2e+31) (fma (/ t z) (/ 0.3333333333333333 y) x) t_1))))
double code(double x, double y, double z, double t) {
double t_1 = x + (y / (z * -3.0));
double tmp;
if (y <= -1600.0) {
tmp = t_1;
} else if (y <= 3.2e+31) {
tmp = fma((t / z), (0.3333333333333333 / y), x);
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t) t_1 = Float64(x + Float64(y / Float64(z * -3.0))) tmp = 0.0 if (y <= -1600.0) tmp = t_1; elseif (y <= 3.2e+31) tmp = fma(Float64(t / z), Float64(0.3333333333333333 / y), x); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(x + N[(y / N[(z * -3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -1600.0], t$95$1, If[LessEqual[y, 3.2e+31], N[(N[(t / z), $MachinePrecision] * N[(0.3333333333333333 / y), $MachinePrecision] + x), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x + \frac{y}{z \cdot -3}\\
\mathbf{if}\;y \leq -1600:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq 3.2 \cdot 10^{+31}:\\
\;\;\;\;\mathsf{fma}\left(\frac{t}{z}, \frac{0.3333333333333333}{y}, x\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y < -1600 or 3.2000000000000001e31 < y Initial program 97.6%
lift-*.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-/.f64N/A
associate-+l-N/A
lower--.f64N/A
lift-/.f64N/A
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/r*N/A
sub-divN/A
lower-/.f64N/A
lower--.f64N/A
lower-/.f6499.8
Applied egg-rr99.8%
Taylor expanded in y around inf
sub-negN/A
+-commutativeN/A
distribute-rgt-inN/A
distribute-lft-neg-inN/A
metadata-evalN/A
associate-*l*N/A
associate-*l/N/A
*-lft-identityN/A
cancel-sign-subN/A
mul-1-negN/A
associate-*r/N/A
associate-*l/N/A
associate-/l*N/A
mul-1-negN/A
*-inversesN/A
cancel-sign-subN/A
*-rgt-identityN/A
lower-fma.f64N/A
lower-/.f6496.0
Simplified96.0%
lift-/.f64N/A
lower-+.f64N/A
lift-/.f64N/A
frac-2negN/A
distribute-frac-negN/A
distribute-rgt-neg-outN/A
metadata-evalN/A
times-fracN/A
neg-mul-1N/A
distribute-rgt-neg-inN/A
*-commutativeN/A
lift-*.f64N/A
frac-2negN/A
distribute-neg-frac2N/A
lower-/.f64N/A
lift-*.f64N/A
distribute-rgt-neg-inN/A
lower-*.f64N/A
metadata-eval96.1
Applied egg-rr96.1%
if -1600 < y < 3.2000000000000001e31Initial program 91.0%
lift-*.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-/.f64N/A
associate-+l-N/A
lower--.f64N/A
lift-/.f64N/A
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/r*N/A
sub-divN/A
lower-/.f64N/A
lower--.f64N/A
lower-/.f6493.7
Applied egg-rr93.7%
Taylor expanded in y around 0
div-subN/A
*-commutativeN/A
associate-/l*N/A
associate-/l*N/A
associate-/l/N/A
remove-double-negN/A
distribute-rgt-neg-outN/A
mul-1-negN/A
cancel-sign-sub-invN/A
metadata-evalN/A
+-commutativeN/A
*-lft-identityN/A
associate-*l/N/A
associate-*l*N/A
*-commutativeN/A
distribute-rgt-neg-inN/A
mul-1-negN/A
remove-double-negN/A
associate-/l*N/A
Simplified87.9%
lift-*.f64N/A
associate-*r/N/A
lift-*.f64N/A
*-commutativeN/A
times-fracN/A
lower-fma.f64N/A
lower-/.f64N/A
lower-/.f6494.6
Applied egg-rr94.6%
Final simplification95.3%
(FPCore (x y z t)
:precision binary64
(if (<= y -1.65e+25)
(fma -0.3333333333333333 (/ y z) x)
(if (<= y 3.6e+33)
(fma t (/ 0.3333333333333333 (* z y)) x)
(+ x (/ y (* z -3.0))))))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -1.65e+25) {
tmp = fma(-0.3333333333333333, (y / z), x);
} else if (y <= 3.6e+33) {
tmp = fma(t, (0.3333333333333333 / (z * y)), x);
} else {
tmp = x + (y / (z * -3.0));
}
return tmp;
}
function code(x, y, z, t) tmp = 0.0 if (y <= -1.65e+25) tmp = fma(-0.3333333333333333, Float64(y / z), x); elseif (y <= 3.6e+33) tmp = fma(t, Float64(0.3333333333333333 / Float64(z * y)), x); else tmp = Float64(x + Float64(y / Float64(z * -3.0))); end return tmp end
code[x_, y_, z_, t_] := If[LessEqual[y, -1.65e+25], N[(-0.3333333333333333 * N[(y / z), $MachinePrecision] + x), $MachinePrecision], If[LessEqual[y, 3.6e+33], N[(t * N[(0.3333333333333333 / N[(z * y), $MachinePrecision]), $MachinePrecision] + x), $MachinePrecision], N[(x + N[(y / N[(z * -3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.65 \cdot 10^{+25}:\\
\;\;\;\;\mathsf{fma}\left(-0.3333333333333333, \frac{y}{z}, x\right)\\
\mathbf{elif}\;y \leq 3.6 \cdot 10^{+33}:\\
\;\;\;\;\mathsf{fma}\left(t, \frac{0.3333333333333333}{z \cdot y}, x\right)\\
\mathbf{else}:\\
\;\;\;\;x + \frac{y}{z \cdot -3}\\
\end{array}
\end{array}
if y < -1.6500000000000001e25Initial program 96.9%
lift-*.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-/.f64N/A
associate-+l-N/A
lower--.f64N/A
lift-/.f64N/A
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/r*N/A
sub-divN/A
lower-/.f64N/A
lower--.f64N/A
lower-/.f6499.8
Applied egg-rr99.8%
Taylor expanded in y around inf
sub-negN/A
+-commutativeN/A
distribute-rgt-inN/A
distribute-lft-neg-inN/A
metadata-evalN/A
associate-*l*N/A
associate-*l/N/A
*-lft-identityN/A
cancel-sign-subN/A
mul-1-negN/A
associate-*r/N/A
associate-*l/N/A
associate-/l*N/A
mul-1-negN/A
*-inversesN/A
cancel-sign-subN/A
*-rgt-identityN/A
lower-fma.f64N/A
lower-/.f6498.6
Simplified98.6%
if -1.6500000000000001e25 < y < 3.6000000000000003e33Initial program 91.3%
lift-*.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-/.f64N/A
associate-+l-N/A
lower--.f64N/A
lift-/.f64N/A
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/r*N/A
sub-divN/A
lower-/.f64N/A
lower--.f64N/A
lower-/.f6493.9
Applied egg-rr93.9%
Taylor expanded in y around 0
div-subN/A
*-commutativeN/A
associate-/l*N/A
associate-/l*N/A
associate-/l/N/A
remove-double-negN/A
distribute-rgt-neg-outN/A
mul-1-negN/A
cancel-sign-sub-invN/A
metadata-evalN/A
+-commutativeN/A
*-lft-identityN/A
associate-*l/N/A
associate-*l*N/A
*-commutativeN/A
distribute-rgt-neg-inN/A
mul-1-negN/A
remove-double-negN/A
associate-/l*N/A
Simplified87.0%
if 3.6000000000000003e33 < y Initial program 98.2%
lift-*.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-/.f64N/A
associate-+l-N/A
lower--.f64N/A
lift-/.f64N/A
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/r*N/A
sub-divN/A
lower-/.f64N/A
lower--.f64N/A
lower-/.f6499.9
Applied egg-rr99.9%
Taylor expanded in y around inf
sub-negN/A
+-commutativeN/A
distribute-rgt-inN/A
distribute-lft-neg-inN/A
metadata-evalN/A
associate-*l*N/A
associate-*l/N/A
*-lft-identityN/A
cancel-sign-subN/A
mul-1-negN/A
associate-*r/N/A
associate-*l/N/A
associate-/l*N/A
mul-1-negN/A
*-inversesN/A
cancel-sign-subN/A
*-rgt-identityN/A
lower-fma.f64N/A
lower-/.f6496.3
Simplified96.3%
lift-/.f64N/A
lower-+.f64N/A
lift-/.f64N/A
frac-2negN/A
distribute-frac-negN/A
distribute-rgt-neg-outN/A
metadata-evalN/A
times-fracN/A
neg-mul-1N/A
distribute-rgt-neg-inN/A
*-commutativeN/A
lift-*.f64N/A
frac-2negN/A
distribute-neg-frac2N/A
lower-/.f64N/A
lift-*.f64N/A
distribute-rgt-neg-inN/A
lower-*.f64N/A
metadata-eval96.5
Applied egg-rr96.5%
Final simplification91.7%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (+ x (/ y (* z -3.0)))))
(if (<= y -3.1e-12)
t_1
(if (<= y 9.8e-67) (/ (* t 0.3333333333333333) (* z y)) t_1))))
double code(double x, double y, double z, double t) {
double t_1 = x + (y / (z * -3.0));
double tmp;
if (y <= -3.1e-12) {
tmp = t_1;
} else if (y <= 9.8e-67) {
tmp = (t * 0.3333333333333333) / (z * y);
} else {
tmp = 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 = x + (y / (z * (-3.0d0)))
if (y <= (-3.1d-12)) then
tmp = t_1
else if (y <= 9.8d-67) then
tmp = (t * 0.3333333333333333d0) / (z * y)
else
tmp = t_1
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));
double tmp;
if (y <= -3.1e-12) {
tmp = t_1;
} else if (y <= 9.8e-67) {
tmp = (t * 0.3333333333333333) / (z * y);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = x + (y / (z * -3.0)) tmp = 0 if y <= -3.1e-12: tmp = t_1 elif y <= 9.8e-67: tmp = (t * 0.3333333333333333) / (z * y) else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(x + Float64(y / Float64(z * -3.0))) tmp = 0.0 if (y <= -3.1e-12) tmp = t_1; elseif (y <= 9.8e-67) tmp = Float64(Float64(t * 0.3333333333333333) / Float64(z * y)); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = x + (y / (z * -3.0)); tmp = 0.0; if (y <= -3.1e-12) tmp = t_1; elseif (y <= 9.8e-67) tmp = (t * 0.3333333333333333) / (z * y); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(x + N[(y / N[(z * -3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -3.1e-12], t$95$1, If[LessEqual[y, 9.8e-67], N[(N[(t * 0.3333333333333333), $MachinePrecision] / N[(z * y), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x + \frac{y}{z \cdot -3}\\
\mathbf{if}\;y \leq -3.1 \cdot 10^{-12}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq 9.8 \cdot 10^{-67}:\\
\;\;\;\;\frac{t \cdot 0.3333333333333333}{z \cdot y}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y < -3.1000000000000001e-12 or 9.79999999999999987e-67 < y Initial program 97.2%
lift-*.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-/.f64N/A
associate-+l-N/A
lower--.f64N/A
lift-/.f64N/A
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/r*N/A
sub-divN/A
lower-/.f64N/A
lower--.f64N/A
lower-/.f6499.8
Applied egg-rr99.8%
Taylor expanded in y around inf
sub-negN/A
+-commutativeN/A
distribute-rgt-inN/A
distribute-lft-neg-inN/A
metadata-evalN/A
associate-*l*N/A
associate-*l/N/A
*-lft-identityN/A
cancel-sign-subN/A
mul-1-negN/A
associate-*r/N/A
associate-*l/N/A
associate-/l*N/A
mul-1-negN/A
*-inversesN/A
cancel-sign-subN/A
*-rgt-identityN/A
lower-fma.f64N/A
lower-/.f6493.9
Simplified93.9%
lift-/.f64N/A
lower-+.f64N/A
lift-/.f64N/A
frac-2negN/A
distribute-frac-negN/A
distribute-rgt-neg-outN/A
metadata-evalN/A
times-fracN/A
neg-mul-1N/A
distribute-rgt-neg-inN/A
*-commutativeN/A
lift-*.f64N/A
frac-2negN/A
distribute-neg-frac2N/A
lower-/.f64N/A
lift-*.f64N/A
distribute-rgt-neg-inN/A
lower-*.f64N/A
metadata-eval94.0
Applied egg-rr94.0%
if -3.1000000000000001e-12 < y < 9.79999999999999987e-67Initial program 90.7%
Taylor expanded in y around 0
associate-*r/N/A
lower-/.f64N/A
lower-*.f64N/A
lower-*.f6467.6
Simplified67.6%
Final simplification81.5%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (+ x (/ y (* z -3.0)))))
(if (<= y -3.1e-12)
t_1
(if (<= y 6.6e-66) (* t (/ 0.3333333333333333 (* z y))) t_1))))
double code(double x, double y, double z, double t) {
double t_1 = x + (y / (z * -3.0));
double tmp;
if (y <= -3.1e-12) {
tmp = t_1;
} else if (y <= 6.6e-66) {
tmp = t * (0.3333333333333333 / (z * y));
} else {
tmp = 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 = x + (y / (z * (-3.0d0)))
if (y <= (-3.1d-12)) then
tmp = t_1
else if (y <= 6.6d-66) then
tmp = t * (0.3333333333333333d0 / (z * y))
else
tmp = t_1
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));
double tmp;
if (y <= -3.1e-12) {
tmp = t_1;
} else if (y <= 6.6e-66) {
tmp = t * (0.3333333333333333 / (z * y));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = x + (y / (z * -3.0)) tmp = 0 if y <= -3.1e-12: tmp = t_1 elif y <= 6.6e-66: tmp = t * (0.3333333333333333 / (z * y)) else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(x + Float64(y / Float64(z * -3.0))) tmp = 0.0 if (y <= -3.1e-12) tmp = t_1; elseif (y <= 6.6e-66) tmp = Float64(t * Float64(0.3333333333333333 / Float64(z * y))); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = x + (y / (z * -3.0)); tmp = 0.0; if (y <= -3.1e-12) tmp = t_1; elseif (y <= 6.6e-66) tmp = t * (0.3333333333333333 / (z * y)); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(x + N[(y / N[(z * -3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -3.1e-12], t$95$1, If[LessEqual[y, 6.6e-66], N[(t * N[(0.3333333333333333 / N[(z * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x + \frac{y}{z \cdot -3}\\
\mathbf{if}\;y \leq -3.1 \cdot 10^{-12}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq 6.6 \cdot 10^{-66}:\\
\;\;\;\;t \cdot \frac{0.3333333333333333}{z \cdot y}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y < -3.1000000000000001e-12 or 6.5999999999999998e-66 < y Initial program 97.2%
lift-*.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-/.f64N/A
associate-+l-N/A
lower--.f64N/A
lift-/.f64N/A
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/r*N/A
sub-divN/A
lower-/.f64N/A
lower--.f64N/A
lower-/.f6499.8
Applied egg-rr99.8%
Taylor expanded in y around inf
sub-negN/A
+-commutativeN/A
distribute-rgt-inN/A
distribute-lft-neg-inN/A
metadata-evalN/A
associate-*l*N/A
associate-*l/N/A
*-lft-identityN/A
cancel-sign-subN/A
mul-1-negN/A
associate-*r/N/A
associate-*l/N/A
associate-/l*N/A
mul-1-negN/A
*-inversesN/A
cancel-sign-subN/A
*-rgt-identityN/A
lower-fma.f64N/A
lower-/.f6493.9
Simplified93.9%
lift-/.f64N/A
lower-+.f64N/A
lift-/.f64N/A
frac-2negN/A
distribute-frac-negN/A
distribute-rgt-neg-outN/A
metadata-evalN/A
times-fracN/A
neg-mul-1N/A
distribute-rgt-neg-inN/A
*-commutativeN/A
lift-*.f64N/A
frac-2negN/A
distribute-neg-frac2N/A
lower-/.f64N/A
lift-*.f64N/A
distribute-rgt-neg-inN/A
lower-*.f64N/A
metadata-eval94.0
Applied egg-rr94.0%
if -3.1000000000000001e-12 < y < 6.5999999999999998e-66Initial program 90.7%
lift-*.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-/.f64N/A
associate-+l-N/A
lower--.f64N/A
lift-/.f64N/A
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/r*N/A
sub-divN/A
lower-/.f64N/A
lower--.f64N/A
lower-/.f6492.9
Applied egg-rr92.9%
Taylor expanded in y around 0
associate-*r/N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f6467.6
Simplified67.6%
*-commutativeN/A
lift-*.f64N/A
lift-*.f64N/A
clear-numN/A
associate-/r/N/A
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-*r*N/A
lower-*.f64N/A
*-commutativeN/A
lift-/.f64N/A
div-invN/A
lower-/.f6467.5
lift-*.f64N/A
*-commutativeN/A
lift-*.f6467.5
Applied egg-rr67.5%
Final simplification81.5%
(FPCore (x y z t) :precision binary64 (+ x (/ (- (/ t y) y) (* z 3.0))))
double code(double x, double y, double z, double t) {
return x + (((t / y) - y) / (z * 3.0));
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = x + (((t / y) - y) / (z * 3.0d0))
end function
public static double code(double x, double y, double z, double t) {
return x + (((t / y) - y) / (z * 3.0));
}
def code(x, y, z, t): return x + (((t / y) - y) / (z * 3.0))
function code(x, y, z, t) return Float64(x + Float64(Float64(Float64(t / y) - y) / Float64(z * 3.0))) end
function tmp = code(x, y, z, t) tmp = x + (((t / y) - y) / (z * 3.0)); end
code[x_, y_, z_, t_] := N[(x + N[(N[(N[(t / y), $MachinePrecision] - y), $MachinePrecision] / N[(z * 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \frac{\frac{t}{y} - y}{z \cdot 3}
\end{array}
Initial program 94.1%
lift-*.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-/.f64N/A
associate-+l-N/A
lower--.f64N/A
lift-/.f64N/A
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/r*N/A
sub-divN/A
lower-/.f64N/A
lower--.f64N/A
lower-/.f6496.6
Applied egg-rr96.6%
Final simplification96.6%
(FPCore (x y z t) :precision binary64 (fma (/ 0.3333333333333333 z) (- (/ t y) y) x))
double code(double x, double y, double z, double t) {
return fma((0.3333333333333333 / z), ((t / y) - y), x);
}
function code(x, y, z, t) return fma(Float64(0.3333333333333333 / z), Float64(Float64(t / y) - y), x) end
code[x_, y_, z_, t_] := N[(N[(0.3333333333333333 / z), $MachinePrecision] * N[(N[(t / y), $MachinePrecision] - y), $MachinePrecision] + x), $MachinePrecision]
\begin{array}{l}
\\
\mathsf{fma}\left(\frac{0.3333333333333333}{z}, \frac{t}{y} - y, x\right)
\end{array}
Initial program 94.1%
Taylor expanded in x around 0
associate--l+N/A
+-commutativeN/A
associate-*r/N/A
*-commutativeN/A
times-fracN/A
metadata-evalN/A
associate-*r/N/A
associate-*r/N/A
associate-*l/N/A
metadata-evalN/A
associate-*r/N/A
distribute-lft-out--N/A
lower-fma.f64N/A
associate-*r/N/A
metadata-evalN/A
lower-/.f64N/A
lower--.f64N/A
lower-/.f6496.4
Simplified96.4%
(FPCore (x y z t) :precision binary64 (let* ((t_1 (/ y (* z -3.0)))) (if (<= y -1.26e-59) t_1 (if (<= y 2e+80) (/ (* z x) z) t_1))))
double code(double x, double y, double z, double t) {
double t_1 = y / (z * -3.0);
double tmp;
if (y <= -1.26e-59) {
tmp = t_1;
} else if (y <= 2e+80) {
tmp = (z * x) / z;
} else {
tmp = 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 = y / (z * (-3.0d0))
if (y <= (-1.26d-59)) then
tmp = t_1
else if (y <= 2d+80) then
tmp = (z * x) / z
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = y / (z * -3.0);
double tmp;
if (y <= -1.26e-59) {
tmp = t_1;
} else if (y <= 2e+80) {
tmp = (z * x) / z;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = y / (z * -3.0) tmp = 0 if y <= -1.26e-59: tmp = t_1 elif y <= 2e+80: tmp = (z * x) / z else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(y / Float64(z * -3.0)) tmp = 0.0 if (y <= -1.26e-59) tmp = t_1; elseif (y <= 2e+80) tmp = Float64(Float64(z * x) / z); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = y / (z * -3.0); tmp = 0.0; if (y <= -1.26e-59) tmp = t_1; elseif (y <= 2e+80) tmp = (z * x) / z; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(y / N[(z * -3.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -1.26e-59], t$95$1, If[LessEqual[y, 2e+80], N[(N[(z * x), $MachinePrecision] / z), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{y}{z \cdot -3}\\
\mathbf{if}\;y \leq -1.26 \cdot 10^{-59}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq 2 \cdot 10^{+80}:\\
\;\;\;\;\frac{z \cdot x}{z}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y < -1.2599999999999999e-59 or 2e80 < y Initial program 96.9%
Taylor expanded in y around inf
associate-*r/N/A
*-commutativeN/A
associate-/l*N/A
metadata-evalN/A
distribute-neg-fracN/A
metadata-evalN/A
associate-*r/N/A
lower-*.f64N/A
associate-*r/N/A
metadata-evalN/A
distribute-neg-fracN/A
metadata-evalN/A
lower-/.f6459.5
Simplified59.5%
clear-numN/A
un-div-invN/A
div-invN/A
metadata-evalN/A
metadata-evalN/A
distribute-rgt-neg-inN/A
lift-*.f64N/A
lower-/.f64N/A
lift-*.f64N/A
distribute-rgt-neg-inN/A
lower-*.f64N/A
metadata-eval59.6
Applied egg-rr59.6%
if -1.2599999999999999e-59 < y < 2e80Initial program 91.4%
Taylor expanded in x around 0
associate--l+N/A
+-commutativeN/A
associate-*r/N/A
*-commutativeN/A
times-fracN/A
metadata-evalN/A
associate-*r/N/A
associate-*r/N/A
associate-*l/N/A
metadata-evalN/A
associate-*r/N/A
distribute-lft-out--N/A
lower-fma.f64N/A
associate-*r/N/A
metadata-evalN/A
lower-/.f64N/A
lower--.f64N/A
lower-/.f6494.1
Simplified94.1%
Taylor expanded in z around 0
lower-/.f64N/A
lower-fma.f64N/A
lower--.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f6482.6
Simplified82.6%
Taylor expanded in z around inf
lower-*.f6421.7
Simplified21.7%
Final simplification40.3%
(FPCore (x y z t) :precision binary64 (+ x (/ y (* z -3.0))))
double code(double x, double y, double z, double t) {
return x + (y / (z * -3.0));
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = x + (y / (z * (-3.0d0)))
end function
public static double code(double x, double y, double z, double t) {
return x + (y / (z * -3.0));
}
def code(x, y, z, t): return x + (y / (z * -3.0))
function code(x, y, z, t) return Float64(x + Float64(y / Float64(z * -3.0))) end
function tmp = code(x, y, z, t) tmp = x + (y / (z * -3.0)); end
code[x_, y_, z_, t_] := N[(x + N[(y / N[(z * -3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \frac{y}{z \cdot -3}
\end{array}
Initial program 94.1%
lift-*.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-/.f64N/A
associate-+l-N/A
lower--.f64N/A
lift-/.f64N/A
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/r*N/A
sub-divN/A
lower-/.f64N/A
lower--.f64N/A
lower-/.f6496.6
Applied egg-rr96.6%
Taylor expanded in y around inf
sub-negN/A
+-commutativeN/A
distribute-rgt-inN/A
distribute-lft-neg-inN/A
metadata-evalN/A
associate-*l*N/A
associate-*l/N/A
*-lft-identityN/A
cancel-sign-subN/A
mul-1-negN/A
associate-*r/N/A
associate-*l/N/A
associate-/l*N/A
mul-1-negN/A
*-inversesN/A
cancel-sign-subN/A
*-rgt-identityN/A
lower-fma.f64N/A
lower-/.f6461.5
Simplified61.5%
lift-/.f64N/A
lower-+.f64N/A
lift-/.f64N/A
frac-2negN/A
distribute-frac-negN/A
distribute-rgt-neg-outN/A
metadata-evalN/A
times-fracN/A
neg-mul-1N/A
distribute-rgt-neg-inN/A
*-commutativeN/A
lift-*.f64N/A
frac-2negN/A
distribute-neg-frac2N/A
lower-/.f64N/A
lift-*.f64N/A
distribute-rgt-neg-inN/A
lower-*.f64N/A
metadata-eval61.5
Applied egg-rr61.5%
Final simplification61.5%
(FPCore (x y z t) :precision binary64 (fma -0.3333333333333333 (/ y z) x))
double code(double x, double y, double z, double t) {
return fma(-0.3333333333333333, (y / z), x);
}
function code(x, y, z, t) return fma(-0.3333333333333333, Float64(y / z), x) end
code[x_, y_, z_, t_] := N[(-0.3333333333333333 * N[(y / z), $MachinePrecision] + x), $MachinePrecision]
\begin{array}{l}
\\
\mathsf{fma}\left(-0.3333333333333333, \frac{y}{z}, x\right)
\end{array}
Initial program 94.1%
lift-*.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-/.f64N/A
associate-+l-N/A
lower--.f64N/A
lift-/.f64N/A
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/r*N/A
sub-divN/A
lower-/.f64N/A
lower--.f64N/A
lower-/.f6496.6
Applied egg-rr96.6%
Taylor expanded in y around inf
sub-negN/A
+-commutativeN/A
distribute-rgt-inN/A
distribute-lft-neg-inN/A
metadata-evalN/A
associate-*l*N/A
associate-*l/N/A
*-lft-identityN/A
cancel-sign-subN/A
mul-1-negN/A
associate-*r/N/A
associate-*l/N/A
associate-/l*N/A
mul-1-negN/A
*-inversesN/A
cancel-sign-subN/A
*-rgt-identityN/A
lower-fma.f64N/A
lower-/.f6461.5
Simplified61.5%
(FPCore (x y z t) :precision binary64 (/ y (* z -3.0)))
double code(double x, double y, double z, double t) {
return 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 = y / (z * (-3.0d0))
end function
public static double code(double x, double y, double z, double t) {
return y / (z * -3.0);
}
def code(x, y, z, t): return y / (z * -3.0)
function code(x, y, z, t) return Float64(y / Float64(z * -3.0)) end
function tmp = code(x, y, z, t) tmp = y / (z * -3.0); end
code[x_, y_, z_, t_] := N[(y / N[(z * -3.0), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{y}{z \cdot -3}
\end{array}
Initial program 94.1%
Taylor expanded in y around inf
associate-*r/N/A
*-commutativeN/A
associate-/l*N/A
metadata-evalN/A
distribute-neg-fracN/A
metadata-evalN/A
associate-*r/N/A
lower-*.f64N/A
associate-*r/N/A
metadata-evalN/A
distribute-neg-fracN/A
metadata-evalN/A
lower-/.f6432.6
Simplified32.6%
clear-numN/A
un-div-invN/A
div-invN/A
metadata-evalN/A
metadata-evalN/A
distribute-rgt-neg-inN/A
lift-*.f64N/A
lower-/.f64N/A
lift-*.f64N/A
distribute-rgt-neg-inN/A
lower-*.f64N/A
metadata-eval32.7
Applied egg-rr32.7%
(FPCore (x y z t) :precision binary64 (* (/ y z) -0.3333333333333333))
double code(double x, double y, double z, double t) {
return (y / z) * -0.3333333333333333;
}
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 = (y / z) * (-0.3333333333333333d0)
end function
public static double code(double x, double y, double z, double t) {
return (y / z) * -0.3333333333333333;
}
def code(x, y, z, t): return (y / z) * -0.3333333333333333
function code(x, y, z, t) return Float64(Float64(y / z) * -0.3333333333333333) end
function tmp = code(x, y, z, t) tmp = (y / z) * -0.3333333333333333; end
code[x_, y_, z_, t_] := N[(N[(y / z), $MachinePrecision] * -0.3333333333333333), $MachinePrecision]
\begin{array}{l}
\\
\frac{y}{z} \cdot -0.3333333333333333
\end{array}
Initial program 94.1%
Taylor expanded in y around inf
associate-*r/N/A
*-commutativeN/A
associate-/l*N/A
metadata-evalN/A
distribute-neg-fracN/A
metadata-evalN/A
associate-*r/N/A
lower-*.f64N/A
associate-*r/N/A
metadata-evalN/A
distribute-neg-fracN/A
metadata-evalN/A
lower-/.f6432.6
Simplified32.6%
associate-*r/N/A
associate-*l/N/A
lift-/.f64N/A
lower-*.f6432.6
Applied egg-rr32.6%
(FPCore (x y z t) :precision binary64 (* y (/ -0.3333333333333333 z)))
double code(double x, double y, double z, double t) {
return 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 = y * ((-0.3333333333333333d0) / z)
end function
public static double code(double x, double y, double z, double t) {
return y * (-0.3333333333333333 / z);
}
def code(x, y, z, t): return y * (-0.3333333333333333 / z)
function code(x, y, z, t) return Float64(y * Float64(-0.3333333333333333 / z)) end
function tmp = code(x, y, z, t) tmp = y * (-0.3333333333333333 / z); end
code[x_, y_, z_, t_] := N[(y * N[(-0.3333333333333333 / z), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
y \cdot \frac{-0.3333333333333333}{z}
\end{array}
Initial program 94.1%
Taylor expanded in y around inf
associate-*r/N/A
*-commutativeN/A
associate-/l*N/A
metadata-evalN/A
distribute-neg-fracN/A
metadata-evalN/A
associate-*r/N/A
lower-*.f64N/A
associate-*r/N/A
metadata-evalN/A
distribute-neg-fracN/A
metadata-evalN/A
lower-/.f6432.6
Simplified32.6%
(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 2024212
(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))))