
(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 16 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 (/ (- (/ t y) y) (* z 3.0)))))
(if (<= y -6.8e-54)
t_1
(if (<= y 1.3e-53) (fma (/ t z) (/ 0.3333333333333333 y) x) t_1))))
double code(double x, double y, double z, double t) {
double t_1 = x + (((t / y) - y) / (z * 3.0));
double tmp;
if (y <= -6.8e-54) {
tmp = t_1;
} else if (y <= 1.3e-53) {
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(Float64(Float64(t / y) - y) / Float64(z * 3.0))) tmp = 0.0 if (y <= -6.8e-54) tmp = t_1; elseif (y <= 1.3e-53) 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[(N[(N[(t / y), $MachinePrecision] - y), $MachinePrecision] / N[(z * 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -6.8e-54], t$95$1, If[LessEqual[y, 1.3e-53], 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{\frac{t}{y} - y}{z \cdot 3}\\
\mathbf{if}\;y \leq -6.8 \cdot 10^{-54}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq 1.3 \cdot 10^{-53}:\\
\;\;\;\;\mathsf{fma}\left(\frac{t}{z}, \frac{0.3333333333333333}{y}, x\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y < -6.79999999999999975e-54 or 1.29999999999999998e-53 < y Initial program 98.2%
associate-+l-N/A
--lowering--.f64N/A
*-commutativeN/A
associate-/r*N/A
sub-divN/A
/-lowering-/.f64N/A
--lowering--.f64N/A
/-lowering-/.f64N/A
*-lowering-*.f6499.7
Applied egg-rr99.7%
if -6.79999999999999975e-54 < y < 1.29999999999999998e-53Initial program 94.7%
Taylor expanded in x around inf
Simplified94.7%
+-commutativeN/A
associate-/r*N/A
div-invN/A
*-commutativeN/A
associate-/r*N/A
metadata-evalN/A
associate-/l*N/A
associate-/r*N/A
un-div-invN/A
un-div-invN/A
times-fracN/A
accelerator-lowering-fma.f64N/A
/-lowering-/.f64N/A
/-lowering-/.f6498.3
Applied egg-rr98.3%
Final simplification99.1%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (- x (/ y (* z 3.0)))))
(if (<= (+ t_1 (/ t (* y (* z 3.0)))) 2e+286)
(+ t_1 (/ t (* z (* y 3.0))))
(+ x (/ (- (/ t y) y) (* z 3.0))))))
double code(double x, double y, double z, double t) {
double t_1 = x - (y / (z * 3.0));
double tmp;
if ((t_1 + (t / (y * (z * 3.0)))) <= 2e+286) {
tmp = t_1 + (t / (z * (y * 3.0)));
} else {
tmp = x + (((t / y) - y) / (z * 3.0));
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: tmp
t_1 = x - (y / (z * 3.0d0))
if ((t_1 + (t / (y * (z * 3.0d0)))) <= 2d+286) then
tmp = t_1 + (t / (z * (y * 3.0d0)))
else
tmp = x + (((t / y) - y) / (z * 3.0d0))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = x - (y / (z * 3.0));
double tmp;
if ((t_1 + (t / (y * (z * 3.0)))) <= 2e+286) {
tmp = t_1 + (t / (z * (y * 3.0)));
} else {
tmp = x + (((t / y) - y) / (z * 3.0));
}
return tmp;
}
def code(x, y, z, t): t_1 = x - (y / (z * 3.0)) tmp = 0 if (t_1 + (t / (y * (z * 3.0)))) <= 2e+286: tmp = t_1 + (t / (z * (y * 3.0))) else: tmp = x + (((t / y) - y) / (z * 3.0)) return tmp
function code(x, y, z, t) t_1 = Float64(x - Float64(y / Float64(z * 3.0))) tmp = 0.0 if (Float64(t_1 + Float64(t / Float64(y * Float64(z * 3.0)))) <= 2e+286) tmp = Float64(t_1 + Float64(t / Float64(z * Float64(y * 3.0)))); else tmp = Float64(x + Float64(Float64(Float64(t / y) - y) / Float64(z * 3.0))); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = x - (y / (z * 3.0)); tmp = 0.0; if ((t_1 + (t / (y * (z * 3.0)))) <= 2e+286) tmp = t_1 + (t / (z * (y * 3.0))); else tmp = x + (((t / y) - y) / (z * 3.0)); 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[N[(t$95$1 + N[(t / N[(y * N[(z * 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 2e+286], N[(t$95$1 + N[(t / N[(z * N[(y * 3.0), $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}
t_1 := x - \frac{y}{z \cdot 3}\\
\mathbf{if}\;t\_1 + \frac{t}{y \cdot \left(z \cdot 3\right)} \leq 2 \cdot 10^{+286}:\\
\;\;\;\;t\_1 + \frac{t}{z \cdot \left(y \cdot 3\right)}\\
\mathbf{else}:\\
\;\;\;\;x + \frac{\frac{t}{y} - y}{z \cdot 3}\\
\end{array}
\end{array}
if (+.f64 (-.f64 x (/.f64 y (*.f64 z #s(literal 3 binary64)))) (/.f64 t (*.f64 (*.f64 z #s(literal 3 binary64)) y))) < 2.00000000000000007e286Initial program 98.1%
associate-*l*N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f6498.2
Applied egg-rr98.2%
if 2.00000000000000007e286 < (+.f64 (-.f64 x (/.f64 y (*.f64 z #s(literal 3 binary64)))) (/.f64 t (*.f64 (*.f64 z #s(literal 3 binary64)) y))) Initial program 89.1%
associate-+l-N/A
--lowering--.f64N/A
*-commutativeN/A
associate-/r*N/A
sub-divN/A
/-lowering-/.f64N/A
--lowering--.f64N/A
/-lowering-/.f64N/A
*-lowering-*.f6499.9
Applied egg-rr99.9%
Final simplification98.4%
(FPCore (x y z t) :precision binary64 (if (<= (+ (- x (/ y (* z 3.0))) (/ t (* y (* z 3.0)))) 2e+286) (fma (/ t (* y z)) 0.3333333333333333 (fma (/ y z) -0.3333333333333333 x)) (+ x (/ (- (/ t y) y) (* z 3.0)))))
double code(double x, double y, double z, double t) {
double tmp;
if (((x - (y / (z * 3.0))) + (t / (y * (z * 3.0)))) <= 2e+286) {
tmp = fma((t / (y * z)), 0.3333333333333333, fma((y / z), -0.3333333333333333, x));
} else {
tmp = x + (((t / y) - y) / (z * 3.0));
}
return tmp;
}
function code(x, y, z, t) tmp = 0.0 if (Float64(Float64(x - Float64(y / Float64(z * 3.0))) + Float64(t / Float64(y * Float64(z * 3.0)))) <= 2e+286) tmp = fma(Float64(t / Float64(y * z)), 0.3333333333333333, fma(Float64(y / z), -0.3333333333333333, 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[(N[(x - N[(y / N[(z * 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(t / N[(y * N[(z * 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 2e+286], N[(N[(t / N[(y * z), $MachinePrecision]), $MachinePrecision] * 0.3333333333333333 + N[(N[(y / z), $MachinePrecision] * -0.3333333333333333 + 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}\;\left(x - \frac{y}{z \cdot 3}\right) + \frac{t}{y \cdot \left(z \cdot 3\right)} \leq 2 \cdot 10^{+286}:\\
\;\;\;\;\mathsf{fma}\left(\frac{t}{y \cdot z}, 0.3333333333333333, \mathsf{fma}\left(\frac{y}{z}, -0.3333333333333333, x\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x + \frac{\frac{t}{y} - y}{z \cdot 3}\\
\end{array}
\end{array}
if (+.f64 (-.f64 x (/.f64 y (*.f64 z #s(literal 3 binary64)))) (/.f64 t (*.f64 (*.f64 z #s(literal 3 binary64)) y))) < 2.00000000000000007e286Initial program 98.1%
+-commutativeN/A
*-rgt-identityN/A
*-commutativeN/A
associate-*r*N/A
times-fracN/A
accelerator-lowering-fma.f64N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
metadata-evalN/A
sub-negN/A
+-commutativeN/A
associate-/r*N/A
div-invN/A
distribute-rgt-neg-inN/A
accelerator-lowering-fma.f64N/A
/-lowering-/.f64N/A
metadata-evalN/A
metadata-eval97.7
Applied egg-rr97.7%
if 2.00000000000000007e286 < (+.f64 (-.f64 x (/.f64 y (*.f64 z #s(literal 3 binary64)))) (/.f64 t (*.f64 (*.f64 z #s(literal 3 binary64)) y))) Initial program 89.1%
associate-+l-N/A
--lowering--.f64N/A
*-commutativeN/A
associate-/r*N/A
sub-divN/A
/-lowering-/.f64N/A
--lowering--.f64N/A
/-lowering-/.f64N/A
*-lowering-*.f6499.9
Applied egg-rr99.9%
Final simplification98.0%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (fma 0.3333333333333333 (/ (- (/ t y) y) z) x)))
(if (<= y -5.5e-55)
t_1
(if (<= y 1.3e-53) (fma (/ t z) (/ 0.3333333333333333 y) x) t_1))))
double code(double x, double y, double z, double t) {
double t_1 = fma(0.3333333333333333, (((t / y) - y) / z), x);
double tmp;
if (y <= -5.5e-55) {
tmp = t_1;
} else if (y <= 1.3e-53) {
tmp = fma((t / z), (0.3333333333333333 / y), x);
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t) t_1 = fma(0.3333333333333333, Float64(Float64(Float64(t / y) - y) / z), x) tmp = 0.0 if (y <= -5.5e-55) tmp = t_1; elseif (y <= 1.3e-53) 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[(0.3333333333333333 * N[(N[(N[(t / y), $MachinePrecision] - y), $MachinePrecision] / z), $MachinePrecision] + x), $MachinePrecision]}, If[LessEqual[y, -5.5e-55], t$95$1, If[LessEqual[y, 1.3e-53], N[(N[(t / z), $MachinePrecision] * N[(0.3333333333333333 / y), $MachinePrecision] + x), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(0.3333333333333333, \frac{\frac{t}{y} - y}{z}, x\right)\\
\mathbf{if}\;y \leq -5.5 \cdot 10^{-55}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq 1.3 \cdot 10^{-53}:\\
\;\;\;\;\mathsf{fma}\left(\frac{t}{z}, \frac{0.3333333333333333}{y}, x\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y < -5.4999999999999999e-55 or 1.29999999999999998e-53 < y Initial program 98.2%
Taylor expanded in x around 0
associate--l+N/A
+-commutativeN/A
distribute-lft-out--N/A
accelerator-lowering-fma.f64N/A
associate-/r*N/A
div-subN/A
/-lowering-/.f64N/A
--lowering--.f64N/A
/-lowering-/.f6499.1
Simplified99.1%
if -5.4999999999999999e-55 < y < 1.29999999999999998e-53Initial program 94.7%
Taylor expanded in x around inf
Simplified94.7%
+-commutativeN/A
associate-/r*N/A
div-invN/A
*-commutativeN/A
associate-/r*N/A
metadata-evalN/A
associate-/l*N/A
associate-/r*N/A
un-div-invN/A
un-div-invN/A
times-fracN/A
accelerator-lowering-fma.f64N/A
/-lowering-/.f64N/A
/-lowering-/.f6498.3
Applied egg-rr98.3%
(FPCore (x y z t)
:precision binary64
(if (<= y -1.2e-51)
(fma y (/ -0.3333333333333333 z) x)
(if (<= y 9.5e-18)
(fma (/ t z) (/ 0.3333333333333333 y) x)
(- x (/ y (* z 3.0))))))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -1.2e-51) {
tmp = fma(y, (-0.3333333333333333 / z), x);
} else if (y <= 9.5e-18) {
tmp = fma((t / z), (0.3333333333333333 / y), x);
} else {
tmp = x - (y / (z * 3.0));
}
return tmp;
}
function code(x, y, z, t) tmp = 0.0 if (y <= -1.2e-51) tmp = fma(y, Float64(-0.3333333333333333 / z), x); elseif (y <= 9.5e-18) tmp = fma(Float64(t / z), Float64(0.3333333333333333 / 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.2e-51], N[(y * N[(-0.3333333333333333 / z), $MachinePrecision] + x), $MachinePrecision], If[LessEqual[y, 9.5e-18], N[(N[(t / z), $MachinePrecision] * N[(0.3333333333333333 / y), $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.2 \cdot 10^{-51}:\\
\;\;\;\;\mathsf{fma}\left(y, \frac{-0.3333333333333333}{z}, x\right)\\
\mathbf{elif}\;y \leq 9.5 \cdot 10^{-18}:\\
\;\;\;\;\mathsf{fma}\left(\frac{t}{z}, \frac{0.3333333333333333}{y}, x\right)\\
\mathbf{else}:\\
\;\;\;\;x - \frac{y}{z \cdot 3}\\
\end{array}
\end{array}
if y < -1.2e-51Initial program 97.2%
Taylor expanded in y around inf
sub-negN/A
+-commutativeN/A
distribute-rgt-inN/A
associate-*r/N/A
metadata-evalN/A
distribute-neg-fracN/A
metadata-evalN/A
associate-*l/N/A
associate-*r/N/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
Simplified89.3%
if -1.2e-51 < y < 9.5000000000000003e-18Initial program 94.7%
Taylor expanded in x around inf
Simplified94.3%
+-commutativeN/A
associate-/r*N/A
div-invN/A
*-commutativeN/A
associate-/r*N/A
metadata-evalN/A
associate-/l*N/A
associate-/r*N/A
un-div-invN/A
un-div-invN/A
times-fracN/A
accelerator-lowering-fma.f64N/A
/-lowering-/.f64N/A
/-lowering-/.f6497.7
Applied egg-rr97.7%
if 9.5000000000000003e-18 < y Initial program 99.7%
associate-+l-N/A
--lowering--.f64N/A
*-commutativeN/A
associate-/r*N/A
sub-divN/A
/-lowering-/.f64N/A
--lowering--.f64N/A
/-lowering-/.f64N/A
*-lowering-*.f6499.7
Applied egg-rr99.7%
Taylor expanded in y around inf
Simplified91.3%
(FPCore (x y z t) :precision binary64 (if (<= y -1.2e-51) (fma y (/ -0.3333333333333333 z) x) (if (<= y 3.8e-17) (+ x (/ t (* z (* y 3.0)))) (- x (/ y (* z 3.0))))))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -1.2e-51) {
tmp = fma(y, (-0.3333333333333333 / z), x);
} else if (y <= 3.8e-17) {
tmp = x + (t / (z * (y * 3.0)));
} else {
tmp = x - (y / (z * 3.0));
}
return tmp;
}
function code(x, y, z, t) tmp = 0.0 if (y <= -1.2e-51) tmp = fma(y, Float64(-0.3333333333333333 / z), x); elseif (y <= 3.8e-17) tmp = Float64(x + Float64(t / Float64(z * Float64(y * 3.0)))); else tmp = Float64(x - Float64(y / Float64(z * 3.0))); end return tmp end
code[x_, y_, z_, t_] := If[LessEqual[y, -1.2e-51], N[(y * N[(-0.3333333333333333 / z), $MachinePrecision] + x), $MachinePrecision], If[LessEqual[y, 3.8e-17], N[(x + N[(t / N[(z * N[(y * 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x - N[(y / N[(z * 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.2 \cdot 10^{-51}:\\
\;\;\;\;\mathsf{fma}\left(y, \frac{-0.3333333333333333}{z}, x\right)\\
\mathbf{elif}\;y \leq 3.8 \cdot 10^{-17}:\\
\;\;\;\;x + \frac{t}{z \cdot \left(y \cdot 3\right)}\\
\mathbf{else}:\\
\;\;\;\;x - \frac{y}{z \cdot 3}\\
\end{array}
\end{array}
if y < -1.2e-51Initial program 97.2%
Taylor expanded in y around inf
sub-negN/A
+-commutativeN/A
distribute-rgt-inN/A
associate-*r/N/A
metadata-evalN/A
distribute-neg-fracN/A
metadata-evalN/A
associate-*l/N/A
associate-*r/N/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
Simplified89.3%
if -1.2e-51 < y < 3.8000000000000001e-17Initial program 94.7%
Taylor expanded in x around inf
Simplified94.3%
associate-*l*N/A
*-commutativeN/A
*-commutativeN/A
*-lowering-*.f64N/A
*-lowering-*.f6494.4
Applied egg-rr94.4%
if 3.8000000000000001e-17 < y Initial program 99.7%
associate-+l-N/A
--lowering--.f64N/A
*-commutativeN/A
associate-/r*N/A
sub-divN/A
/-lowering-/.f64N/A
--lowering--.f64N/A
/-lowering-/.f64N/A
*-lowering-*.f6499.7
Applied egg-rr99.7%
Taylor expanded in y around inf
Simplified91.3%
Final simplification92.1%
(FPCore (x y z t)
:precision binary64
(if (<= y -1.2e-51)
(fma y (/ -0.3333333333333333 z) x)
(if (<= y 3.55e-17)
(fma (/ t (* y z)) 0.3333333333333333 x)
(- x (/ y (* z 3.0))))))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -1.2e-51) {
tmp = fma(y, (-0.3333333333333333 / z), x);
} else if (y <= 3.55e-17) {
tmp = fma((t / (y * z)), 0.3333333333333333, x);
} else {
tmp = x - (y / (z * 3.0));
}
return tmp;
}
function code(x, y, z, t) tmp = 0.0 if (y <= -1.2e-51) tmp = fma(y, Float64(-0.3333333333333333 / z), x); elseif (y <= 3.55e-17) tmp = fma(Float64(t / Float64(y * z)), 0.3333333333333333, x); else tmp = Float64(x - Float64(y / Float64(z * 3.0))); end return tmp end
code[x_, y_, z_, t_] := If[LessEqual[y, -1.2e-51], N[(y * N[(-0.3333333333333333 / z), $MachinePrecision] + x), $MachinePrecision], If[LessEqual[y, 3.55e-17], N[(N[(t / N[(y * z), $MachinePrecision]), $MachinePrecision] * 0.3333333333333333 + x), $MachinePrecision], N[(x - N[(y / N[(z * 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.2 \cdot 10^{-51}:\\
\;\;\;\;\mathsf{fma}\left(y, \frac{-0.3333333333333333}{z}, x\right)\\
\mathbf{elif}\;y \leq 3.55 \cdot 10^{-17}:\\
\;\;\;\;\mathsf{fma}\left(\frac{t}{y \cdot z}, 0.3333333333333333, x\right)\\
\mathbf{else}:\\
\;\;\;\;x - \frac{y}{z \cdot 3}\\
\end{array}
\end{array}
if y < -1.2e-51Initial program 97.2%
Taylor expanded in y around inf
sub-negN/A
+-commutativeN/A
distribute-rgt-inN/A
associate-*r/N/A
metadata-evalN/A
distribute-neg-fracN/A
metadata-evalN/A
associate-*l/N/A
associate-*r/N/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
Simplified89.3%
if -1.2e-51 < y < 3.5499999999999998e-17Initial program 94.7%
Taylor expanded in x around inf
Simplified94.3%
+-commutativeN/A
associate-/r*N/A
div-invN/A
*-commutativeN/A
associate-/r*N/A
metadata-evalN/A
associate-/l*N/A
associate-/r*N/A
un-div-invN/A
clear-numN/A
un-div-invN/A
div-invN/A
metadata-evalN/A
times-fracN/A
metadata-evalN/A
accelerator-lowering-fma.f64N/A
/-lowering-/.f64N/A
*-commutativeN/A
*-lowering-*.f6494.3
Applied egg-rr94.3%
if 3.5499999999999998e-17 < y Initial program 99.7%
associate-+l-N/A
--lowering--.f64N/A
*-commutativeN/A
associate-/r*N/A
sub-divN/A
/-lowering-/.f64N/A
--lowering--.f64N/A
/-lowering-/.f64N/A
*-lowering-*.f6499.7
Applied egg-rr99.7%
Taylor expanded in y around inf
Simplified91.3%
(FPCore (x y z t)
:precision binary64
(if (<= y -1.08e-51)
(fma y (/ -0.3333333333333333 z) x)
(if (<= y 3.6e-17)
(fma (/ 0.3333333333333333 (* y z)) t x)
(- x (/ y (* z 3.0))))))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -1.08e-51) {
tmp = fma(y, (-0.3333333333333333 / z), x);
} else if (y <= 3.6e-17) {
tmp = fma((0.3333333333333333 / (y * z)), t, x);
} else {
tmp = x - (y / (z * 3.0));
}
return tmp;
}
function code(x, y, z, t) tmp = 0.0 if (y <= -1.08e-51) tmp = fma(y, Float64(-0.3333333333333333 / z), x); elseif (y <= 3.6e-17) tmp = fma(Float64(0.3333333333333333 / Float64(y * z)), t, x); else tmp = Float64(x - Float64(y / Float64(z * 3.0))); end return tmp end
code[x_, y_, z_, t_] := If[LessEqual[y, -1.08e-51], N[(y * N[(-0.3333333333333333 / z), $MachinePrecision] + x), $MachinePrecision], If[LessEqual[y, 3.6e-17], N[(N[(0.3333333333333333 / N[(y * z), $MachinePrecision]), $MachinePrecision] * t + x), $MachinePrecision], N[(x - N[(y / N[(z * 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.08 \cdot 10^{-51}:\\
\;\;\;\;\mathsf{fma}\left(y, \frac{-0.3333333333333333}{z}, x\right)\\
\mathbf{elif}\;y \leq 3.6 \cdot 10^{-17}:\\
\;\;\;\;\mathsf{fma}\left(\frac{0.3333333333333333}{y \cdot z}, t, x\right)\\
\mathbf{else}:\\
\;\;\;\;x - \frac{y}{z \cdot 3}\\
\end{array}
\end{array}
if y < -1.08000000000000004e-51Initial program 97.2%
Taylor expanded in y around inf
sub-negN/A
+-commutativeN/A
distribute-rgt-inN/A
associate-*r/N/A
metadata-evalN/A
distribute-neg-fracN/A
metadata-evalN/A
associate-*l/N/A
associate-*r/N/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
Simplified89.3%
if -1.08000000000000004e-51 < y < 3.59999999999999995e-17Initial program 94.7%
Taylor expanded in x around inf
Simplified94.3%
+-commutativeN/A
associate-*l*N/A
*-commutativeN/A
*-commutativeN/A
div-invN/A
*-commutativeN/A
accelerator-lowering-fma.f64N/A
*-commutativeN/A
associate-/r*N/A
div-invN/A
*-commutativeN/A
times-fracN/A
metadata-evalN/A
associate-/r*N/A
un-div-invN/A
/-lowering-/.f64N/A
*-commutativeN/A
*-lowering-*.f6493.2
Applied egg-rr93.2%
if 3.59999999999999995e-17 < y Initial program 99.7%
associate-+l-N/A
--lowering--.f64N/A
*-commutativeN/A
associate-/r*N/A
sub-divN/A
/-lowering-/.f64N/A
--lowering--.f64N/A
/-lowering-/.f64N/A
*-lowering-*.f6499.7
Applied egg-rr99.7%
Taylor expanded in y around inf
Simplified91.3%
(FPCore (x y z t) :precision binary64 (if (<= y -3.3e-53) (fma y (/ -0.3333333333333333 z) x) (if (<= y 4.7e-46) (/ t (* y (* z 3.0))) (- x (/ y (* z 3.0))))))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -3.3e-53) {
tmp = fma(y, (-0.3333333333333333 / z), x);
} else if (y <= 4.7e-46) {
tmp = t / (y * (z * 3.0));
} else {
tmp = x - (y / (z * 3.0));
}
return tmp;
}
function code(x, y, z, t) tmp = 0.0 if (y <= -3.3e-53) tmp = fma(y, Float64(-0.3333333333333333 / z), x); elseif (y <= 4.7e-46) tmp = Float64(t / Float64(y * Float64(z * 3.0))); else tmp = Float64(x - Float64(y / Float64(z * 3.0))); end return tmp end
code[x_, y_, z_, t_] := If[LessEqual[y, -3.3e-53], N[(y * N[(-0.3333333333333333 / z), $MachinePrecision] + x), $MachinePrecision], If[LessEqual[y, 4.7e-46], N[(t / N[(y * N[(z * 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x - N[(y / N[(z * 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -3.3 \cdot 10^{-53}:\\
\;\;\;\;\mathsf{fma}\left(y, \frac{-0.3333333333333333}{z}, x\right)\\
\mathbf{elif}\;y \leq 4.7 \cdot 10^{-46}:\\
\;\;\;\;\frac{t}{y \cdot \left(z \cdot 3\right)}\\
\mathbf{else}:\\
\;\;\;\;x - \frac{y}{z \cdot 3}\\
\end{array}
\end{array}
if y < -3.30000000000000004e-53Initial program 97.2%
Taylor expanded in y around inf
sub-negN/A
+-commutativeN/A
distribute-rgt-inN/A
associate-*r/N/A
metadata-evalN/A
distribute-neg-fracN/A
metadata-evalN/A
associate-*l/N/A
associate-*r/N/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
Simplified89.3%
if -3.30000000000000004e-53 < y < 4.69999999999999966e-46Initial program 94.5%
Taylor expanded in y around 0
associate-*r/N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f6465.8
Simplified65.8%
associate-/l*N/A
*-commutativeN/A
metadata-evalN/A
times-fracN/A
*-rgt-identityN/A
associate-*r*N/A
*-commutativeN/A
/-lowering-/.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-lowering-*.f6465.9
Applied egg-rr65.9%
if 4.69999999999999966e-46 < y Initial program 99.7%
associate-+l-N/A
--lowering--.f64N/A
*-commutativeN/A
associate-/r*N/A
sub-divN/A
/-lowering-/.f64N/A
--lowering--.f64N/A
/-lowering-/.f64N/A
*-lowering-*.f6499.7
Applied egg-rr99.7%
Taylor expanded in y around inf
Simplified90.3%
(FPCore (x y z t)
:precision binary64
(if (<= y -5e-55)
(fma y (/ -0.3333333333333333 z) x)
(if (<= y 1.7e-46)
(* (/ t (* y z)) 0.3333333333333333)
(- x (/ y (* z 3.0))))))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -5e-55) {
tmp = fma(y, (-0.3333333333333333 / z), x);
} else if (y <= 1.7e-46) {
tmp = (t / (y * z)) * 0.3333333333333333;
} else {
tmp = x - (y / (z * 3.0));
}
return tmp;
}
function code(x, y, z, t) tmp = 0.0 if (y <= -5e-55) tmp = fma(y, Float64(-0.3333333333333333 / z), x); elseif (y <= 1.7e-46) tmp = Float64(Float64(t / Float64(y * z)) * 0.3333333333333333); else tmp = Float64(x - Float64(y / Float64(z * 3.0))); end return tmp end
code[x_, y_, z_, t_] := If[LessEqual[y, -5e-55], N[(y * N[(-0.3333333333333333 / z), $MachinePrecision] + x), $MachinePrecision], If[LessEqual[y, 1.7e-46], N[(N[(t / N[(y * z), $MachinePrecision]), $MachinePrecision] * 0.3333333333333333), $MachinePrecision], N[(x - N[(y / N[(z * 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -5 \cdot 10^{-55}:\\
\;\;\;\;\mathsf{fma}\left(y, \frac{-0.3333333333333333}{z}, x\right)\\
\mathbf{elif}\;y \leq 1.7 \cdot 10^{-46}:\\
\;\;\;\;\frac{t}{y \cdot z} \cdot 0.3333333333333333\\
\mathbf{else}:\\
\;\;\;\;x - \frac{y}{z \cdot 3}\\
\end{array}
\end{array}
if y < -5.0000000000000002e-55Initial program 97.2%
Taylor expanded in y around inf
sub-negN/A
+-commutativeN/A
distribute-rgt-inN/A
associate-*r/N/A
metadata-evalN/A
distribute-neg-fracN/A
metadata-evalN/A
associate-*l/N/A
associate-*r/N/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
Simplified89.3%
if -5.0000000000000002e-55 < y < 1.69999999999999998e-46Initial program 94.5%
Taylor expanded in y around 0
associate-*r/N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f6465.8
Simplified65.8%
associate-/l*N/A
*-commutativeN/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
*-lowering-*.f6465.8
Applied egg-rr65.8%
if 1.69999999999999998e-46 < y Initial program 99.7%
associate-+l-N/A
--lowering--.f64N/A
*-commutativeN/A
associate-/r*N/A
sub-divN/A
/-lowering-/.f64N/A
--lowering--.f64N/A
/-lowering-/.f64N/A
*-lowering-*.f6499.7
Applied egg-rr99.7%
Taylor expanded in y around inf
Simplified90.3%
(FPCore (x y z t)
:precision binary64
(if (<= y -1.2e-52)
(fma y (/ -0.3333333333333333 z) x)
(if (<= y 1.9e-42)
(* t (/ 0.3333333333333333 (* y z)))
(- x (/ y (* z 3.0))))))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -1.2e-52) {
tmp = fma(y, (-0.3333333333333333 / z), x);
} else if (y <= 1.9e-42) {
tmp = t * (0.3333333333333333 / (y * z));
} else {
tmp = x - (y / (z * 3.0));
}
return tmp;
}
function code(x, y, z, t) tmp = 0.0 if (y <= -1.2e-52) tmp = fma(y, Float64(-0.3333333333333333 / z), x); elseif (y <= 1.9e-42) tmp = Float64(t * Float64(0.3333333333333333 / Float64(y * z))); else tmp = Float64(x - Float64(y / Float64(z * 3.0))); end return tmp end
code[x_, y_, z_, t_] := If[LessEqual[y, -1.2e-52], N[(y * N[(-0.3333333333333333 / z), $MachinePrecision] + x), $MachinePrecision], If[LessEqual[y, 1.9e-42], N[(t * N[(0.3333333333333333 / N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x - N[(y / N[(z * 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.2 \cdot 10^{-52}:\\
\;\;\;\;\mathsf{fma}\left(y, \frac{-0.3333333333333333}{z}, x\right)\\
\mathbf{elif}\;y \leq 1.9 \cdot 10^{-42}:\\
\;\;\;\;t \cdot \frac{0.3333333333333333}{y \cdot z}\\
\mathbf{else}:\\
\;\;\;\;x - \frac{y}{z \cdot 3}\\
\end{array}
\end{array}
if y < -1.2000000000000001e-52Initial program 97.2%
Taylor expanded in y around inf
sub-negN/A
+-commutativeN/A
distribute-rgt-inN/A
associate-*r/N/A
metadata-evalN/A
distribute-neg-fracN/A
metadata-evalN/A
associate-*l/N/A
associate-*r/N/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
Simplified89.3%
if -1.2000000000000001e-52 < y < 1.90000000000000009e-42Initial program 94.5%
Taylor expanded in y around 0
associate-*r/N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f6465.8
Simplified65.8%
clear-numN/A
*-commutativeN/A
times-fracN/A
div-invN/A
metadata-evalN/A
associate-/l*N/A
associate-/r/N/A
*-lowering-*.f64N/A
associate-/r*N/A
metadata-evalN/A
div-invN/A
clear-numN/A
associate-/l/N/A
/-lowering-/.f64N/A
*-lowering-*.f6464.6
Applied egg-rr64.6%
if 1.90000000000000009e-42 < y Initial program 99.7%
associate-+l-N/A
--lowering--.f64N/A
*-commutativeN/A
associate-/r*N/A
sub-divN/A
/-lowering-/.f64N/A
--lowering--.f64N/A
/-lowering-/.f64N/A
*-lowering-*.f6499.7
Applied egg-rr99.7%
Taylor expanded in y around inf
Simplified90.3%
Final simplification79.0%
(FPCore (x y z t) :precision binary64 (let* ((t_1 (/ y (* z -3.0)))) (if (<= y -1.15e-61) t_1 (if (<= y 1.28e+33) x t_1))))
double code(double x, double y, double z, double t) {
double t_1 = y / (z * -3.0);
double tmp;
if (y <= -1.15e-61) {
tmp = t_1;
} else if (y <= 1.28e+33) {
tmp = x;
} 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.15d-61)) then
tmp = t_1
else if (y <= 1.28d+33) then
tmp = x
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.15e-61) {
tmp = t_1;
} else if (y <= 1.28e+33) {
tmp = x;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = y / (z * -3.0) tmp = 0 if y <= -1.15e-61: tmp = t_1 elif y <= 1.28e+33: tmp = x 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.15e-61) tmp = t_1; elseif (y <= 1.28e+33) tmp = x; 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.15e-61) tmp = t_1; elseif (y <= 1.28e+33) tmp = x; 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.15e-61], t$95$1, If[LessEqual[y, 1.28e+33], x, t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{y}{z \cdot -3}\\
\mathbf{if}\;y \leq -1.15 \cdot 10^{-61}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq 1.28 \cdot 10^{+33}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y < -1.14999999999999996e-61 or 1.28e33 < y Initial program 98.3%
associate-*l*N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f6498.3
Applied egg-rr98.3%
Taylor expanded in y around inf
associate-*r/N/A
/-lowering-/.f64N/A
*-commutativeN/A
*-lowering-*.f6465.8
Simplified65.8%
associate-/l*N/A
clear-numN/A
un-div-invN/A
/-lowering-/.f64N/A
div-invN/A
metadata-evalN/A
metadata-evalN/A
*-lowering-*.f64N/A
metadata-eval65.8
Applied egg-rr65.8%
if -1.14999999999999996e-61 < y < 1.28e33Initial program 95.1%
Taylor expanded in x around inf
Simplified32.8%
(FPCore (x y z t) :precision binary64 (let* ((t_1 (* y (/ -0.3333333333333333 z)))) (if (<= y -1.15e-61) t_1 (if (<= y 2.1e+38) x t_1))))
double code(double x, double y, double z, double t) {
double t_1 = y * (-0.3333333333333333 / z);
double tmp;
if (y <= -1.15e-61) {
tmp = t_1;
} else if (y <= 2.1e+38) {
tmp = x;
} 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 * ((-0.3333333333333333d0) / z)
if (y <= (-1.15d-61)) then
tmp = t_1
else if (y <= 2.1d+38) then
tmp = x
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 * (-0.3333333333333333 / z);
double tmp;
if (y <= -1.15e-61) {
tmp = t_1;
} else if (y <= 2.1e+38) {
tmp = x;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = y * (-0.3333333333333333 / z) tmp = 0 if y <= -1.15e-61: tmp = t_1 elif y <= 2.1e+38: tmp = x else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(y * Float64(-0.3333333333333333 / z)) tmp = 0.0 if (y <= -1.15e-61) tmp = t_1; elseif (y <= 2.1e+38) tmp = x; else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = y * (-0.3333333333333333 / z); tmp = 0.0; if (y <= -1.15e-61) tmp = t_1; elseif (y <= 2.1e+38) tmp = x; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(y * N[(-0.3333333333333333 / z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -1.15e-61], t$95$1, If[LessEqual[y, 2.1e+38], x, t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := y \cdot \frac{-0.3333333333333333}{z}\\
\mathbf{if}\;y \leq -1.15 \cdot 10^{-61}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq 2.1 \cdot 10^{+38}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y < -1.14999999999999996e-61 or 2.1e38 < y Initial program 98.3%
associate-*l*N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f6498.3
Applied egg-rr98.3%
Taylor expanded in y around inf
associate-*r/N/A
/-lowering-/.f64N/A
*-commutativeN/A
*-lowering-*.f6465.8
Simplified65.8%
associate-/l*N/A
*-commutativeN/A
*-lowering-*.f64N/A
/-lowering-/.f6465.8
Applied egg-rr65.8%
if -1.14999999999999996e-61 < y < 2.1e38Initial program 95.1%
Taylor expanded in x around inf
Simplified32.8%
Final simplification50.1%
(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 96.7%
associate-+l-N/A
--lowering--.f64N/A
*-commutativeN/A
associate-/r*N/A
sub-divN/A
/-lowering-/.f64N/A
--lowering--.f64N/A
/-lowering-/.f64N/A
*-lowering-*.f6494.6
Applied egg-rr94.6%
Taylor expanded in y around inf
Simplified64.1%
(FPCore (x y z t) :precision binary64 (fma y (/ -0.3333333333333333 z) x))
double code(double x, double y, double z, double t) {
return fma(y, (-0.3333333333333333 / z), x);
}
function code(x, y, z, t) return fma(y, Float64(-0.3333333333333333 / z), x) end
code[x_, y_, z_, t_] := N[(y * N[(-0.3333333333333333 / z), $MachinePrecision] + x), $MachinePrecision]
\begin{array}{l}
\\
\mathsf{fma}\left(y, \frac{-0.3333333333333333}{z}, x\right)
\end{array}
Initial program 96.7%
Taylor expanded in y around inf
sub-negN/A
+-commutativeN/A
distribute-rgt-inN/A
associate-*r/N/A
metadata-evalN/A
distribute-neg-fracN/A
metadata-evalN/A
associate-*l/N/A
associate-*r/N/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
Simplified64.0%
(FPCore (x y z t) :precision binary64 x)
double code(double x, double y, double z, double t) {
return x;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = x
end function
public static double code(double x, double y, double z, double t) {
return x;
}
def code(x, y, z, t): return x
function code(x, y, z, t) return x end
function tmp = code(x, y, z, t) tmp = x; end
code[x_, y_, z_, t_] := x
\begin{array}{l}
\\
x
\end{array}
Initial program 96.7%
Taylor expanded in x around inf
Simplified28.8%
(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 2024198
(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))))