
(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 20 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) 5e-78) (+ x (/ (- (/ t y) y) (* z 3.0))) (+ (- x (/ y (* z 3.0))) (/ t (* 3.0 (* z y))))))
double code(double x, double y, double z, double t) {
double tmp;
if ((z * 3.0) <= 5e-78) {
tmp = x + (((t / y) - y) / (z * 3.0));
} else {
tmp = (x - (y / (z * 3.0))) + (t / (3.0 * (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 ((z * 3.0d0) <= 5d-78) then
tmp = x + (((t / y) - y) / (z * 3.0d0))
else
tmp = (x - (y / (z * 3.0d0))) + (t / (3.0d0 * (z * y)))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((z * 3.0) <= 5e-78) {
tmp = x + (((t / y) - y) / (z * 3.0));
} else {
tmp = (x - (y / (z * 3.0))) + (t / (3.0 * (z * y)));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (z * 3.0) <= 5e-78: tmp = x + (((t / y) - y) / (z * 3.0)) else: tmp = (x - (y / (z * 3.0))) + (t / (3.0 * (z * y))) return tmp
function code(x, y, z, t) tmp = 0.0 if (Float64(z * 3.0) <= 5e-78) tmp = Float64(x + Float64(Float64(Float64(t / y) - y) / Float64(z * 3.0))); else tmp = Float64(Float64(x - Float64(y / Float64(z * 3.0))) + Float64(t / Float64(3.0 * Float64(z * y)))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((z * 3.0) <= 5e-78) tmp = x + (((t / y) - y) / (z * 3.0)); else tmp = (x - (y / (z * 3.0))) + (t / (3.0 * (z * y))); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[N[(z * 3.0), $MachinePrecision], 5e-78], N[(x + N[(N[(N[(t / y), $MachinePrecision] - y), $MachinePrecision] / N[(z * 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x - N[(y / N[(z * 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(t / N[(3.0 * N[(z * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \cdot 3 \leq 5 \cdot 10^{-78}:\\
\;\;\;\;x + \frac{\frac{t}{y} - y}{z \cdot 3}\\
\mathbf{else}:\\
\;\;\;\;\left(x - \frac{y}{z \cdot 3}\right) + \frac{t}{3 \cdot \left(z \cdot y\right)}\\
\end{array}
\end{array}
if (*.f64 z #s(literal 3 binary64)) < 4.9999999999999996e-78Initial program 89.8%
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.2
Applied egg-rr99.2%
if 4.9999999999999996e-78 < (*.f64 z #s(literal 3 binary64)) Initial program 99.7%
associate-*l*N/A
*-commutativeN/A
associate-*r*N/A
*-lowering-*.f64N/A
*-lowering-*.f6499.8
Applied egg-rr99.8%
Final simplification99.4%
(FPCore (x y z t) :precision binary64 (if (<= (* z 3.0) 4e-95) (+ x (/ (- (/ t y) y) (* z 3.0))) (+ (- x (/ y (* z 3.0))) (/ t (* (* z 3.0) y)))))
double code(double x, double y, double z, double t) {
double tmp;
if ((z * 3.0) <= 4e-95) {
tmp = x + (((t / y) - y) / (z * 3.0));
} else {
tmp = (x - (y / (z * 3.0))) + (t / ((z * 3.0) * 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 ((z * 3.0d0) <= 4d-95) then
tmp = x + (((t / y) - y) / (z * 3.0d0))
else
tmp = (x - (y / (z * 3.0d0))) + (t / ((z * 3.0d0) * y))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((z * 3.0) <= 4e-95) {
tmp = x + (((t / y) - y) / (z * 3.0));
} else {
tmp = (x - (y / (z * 3.0))) + (t / ((z * 3.0) * y));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (z * 3.0) <= 4e-95: tmp = x + (((t / y) - y) / (z * 3.0)) else: tmp = (x - (y / (z * 3.0))) + (t / ((z * 3.0) * y)) return tmp
function code(x, y, z, t) tmp = 0.0 if (Float64(z * 3.0) <= 4e-95) tmp = Float64(x + Float64(Float64(Float64(t / y) - y) / Float64(z * 3.0))); else tmp = Float64(Float64(x - Float64(y / Float64(z * 3.0))) + Float64(t / Float64(Float64(z * 3.0) * y))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((z * 3.0) <= 4e-95) tmp = x + (((t / y) - y) / (z * 3.0)); else tmp = (x - (y / (z * 3.0))) + (t / ((z * 3.0) * y)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[N[(z * 3.0), $MachinePrecision], 4e-95], N[(x + N[(N[(N[(t / y), $MachinePrecision] - y), $MachinePrecision] / N[(z * 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 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}
\\
\begin{array}{l}
\mathbf{if}\;z \cdot 3 \leq 4 \cdot 10^{-95}:\\
\;\;\;\;x + \frac{\frac{t}{y} - y}{z \cdot 3}\\
\mathbf{else}:\\
\;\;\;\;\left(x - \frac{y}{z \cdot 3}\right) + \frac{t}{\left(z \cdot 3\right) \cdot y}\\
\end{array}
\end{array}
if (*.f64 z #s(literal 3 binary64)) < 3.99999999999999996e-95Initial program 89.5%
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.2
Applied egg-rr99.2%
if 3.99999999999999996e-95 < (*.f64 z #s(literal 3 binary64)) Initial program 99.7%
Final simplification99.4%
(FPCore (x y z t) :precision binary64 (if (<= (* z 3.0) 0.1) (+ x (/ (- (/ t y) y) (* z 3.0))) (fma (/ t (* z y)) 0.3333333333333333 (fma (/ y z) -0.3333333333333333 x))))
double code(double x, double y, double z, double t) {
double tmp;
if ((z * 3.0) <= 0.1) {
tmp = x + (((t / y) - y) / (z * 3.0));
} else {
tmp = fma((t / (z * y)), 0.3333333333333333, fma((y / z), -0.3333333333333333, x));
}
return tmp;
}
function code(x, y, z, t) tmp = 0.0 if (Float64(z * 3.0) <= 0.1) tmp = Float64(x + Float64(Float64(Float64(t / y) - y) / Float64(z * 3.0))); else tmp = fma(Float64(t / Float64(z * y)), 0.3333333333333333, fma(Float64(y / z), -0.3333333333333333, x)); end return tmp end
code[x_, y_, z_, t_] := If[LessEqual[N[(z * 3.0), $MachinePrecision], 0.1], N[(x + N[(N[(N[(t / y), $MachinePrecision] - y), $MachinePrecision] / N[(z * 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(t / N[(z * y), $MachinePrecision]), $MachinePrecision] * 0.3333333333333333 + N[(N[(y / z), $MachinePrecision] * -0.3333333333333333 + x), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \cdot 3 \leq 0.1:\\
\;\;\;\;x + \frac{\frac{t}{y} - y}{z \cdot 3}\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(\frac{t}{z \cdot y}, 0.3333333333333333, \mathsf{fma}\left(\frac{y}{z}, -0.3333333333333333, x\right)\right)\\
\end{array}
\end{array}
if (*.f64 z #s(literal 3 binary64)) < 0.10000000000000001Initial program 90.6%
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.3
Applied egg-rr99.3%
if 0.10000000000000001 < (*.f64 z #s(literal 3 binary64)) Initial program 99.7%
+-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-eval99.6
Applied egg-rr99.6%
Final simplification99.4%
(FPCore (x y z t)
:precision binary64
(if (<= y -6.8e-6)
(- x (/ y (* z 3.0)))
(if (<= y 780.0)
(+ x (/ (/ t (* z 3.0)) y))
(fma y (/ -0.3333333333333333 z) x))))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -6.8e-6) {
tmp = x - (y / (z * 3.0));
} else if (y <= 780.0) {
tmp = x + ((t / (z * 3.0)) / y);
} else {
tmp = fma(y, (-0.3333333333333333 / z), x);
}
return tmp;
}
function code(x, y, z, t) tmp = 0.0 if (y <= -6.8e-6) tmp = Float64(x - Float64(y / Float64(z * 3.0))); elseif (y <= 780.0) tmp = Float64(x + Float64(Float64(t / Float64(z * 3.0)) / y)); else tmp = fma(y, Float64(-0.3333333333333333 / z), x); end return tmp end
code[x_, y_, z_, t_] := If[LessEqual[y, -6.8e-6], N[(x - N[(y / N[(z * 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 780.0], N[(x + N[(N[(t / N[(z * 3.0), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision], N[(y * N[(-0.3333333333333333 / z), $MachinePrecision] + x), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -6.8 \cdot 10^{-6}:\\
\;\;\;\;x - \frac{y}{z \cdot 3}\\
\mathbf{elif}\;y \leq 780:\\
\;\;\;\;x + \frac{\frac{t}{z \cdot 3}}{y}\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(y, \frac{-0.3333333333333333}{z}, x\right)\\
\end{array}
\end{array}
if y < -6.80000000000000012e-6Initial program 98.3%
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.8
Applied egg-rr99.8%
Taylor expanded in y around inf
Simplified93.8%
if -6.80000000000000012e-6 < y < 780Initial program 88.1%
Taylor expanded in x around inf
Simplified82.0%
associate-/r*N/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
*-lowering-*.f6490.4
Applied egg-rr90.4%
if 780 < y Initial program 99.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
Simplified92.0%
(FPCore (x y z t)
:precision binary64
(if (<= y -4.9e-5)
(- x (/ y (* z 3.0)))
(if (<= y 840.0)
(fma (/ t z) (/ 0.3333333333333333 y) x)
(fma y (/ -0.3333333333333333 z) x))))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -4.9e-5) {
tmp = x - (y / (z * 3.0));
} else if (y <= 840.0) {
tmp = fma((t / z), (0.3333333333333333 / y), x);
} else {
tmp = fma(y, (-0.3333333333333333 / z), x);
}
return tmp;
}
function code(x, y, z, t) tmp = 0.0 if (y <= -4.9e-5) tmp = Float64(x - Float64(y / Float64(z * 3.0))); elseif (y <= 840.0) tmp = fma(Float64(t / z), Float64(0.3333333333333333 / y), x); else tmp = fma(y, Float64(-0.3333333333333333 / z), x); end return tmp end
code[x_, y_, z_, t_] := If[LessEqual[y, -4.9e-5], N[(x - N[(y / N[(z * 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 840.0], N[(N[(t / z), $MachinePrecision] * N[(0.3333333333333333 / y), $MachinePrecision] + x), $MachinePrecision], N[(y * N[(-0.3333333333333333 / z), $MachinePrecision] + x), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -4.9 \cdot 10^{-5}:\\
\;\;\;\;x - \frac{y}{z \cdot 3}\\
\mathbf{elif}\;y \leq 840:\\
\;\;\;\;\mathsf{fma}\left(\frac{t}{z}, \frac{0.3333333333333333}{y}, x\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(y, \frac{-0.3333333333333333}{z}, x\right)\\
\end{array}
\end{array}
if y < -4.9e-5Initial program 98.3%
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.8
Applied egg-rr99.8%
Taylor expanded in y around inf
Simplified93.8%
if -4.9e-5 < y < 840Initial program 88.1%
Taylor expanded in x around inf
Simplified82.0%
+-commutativeN/A
associate-*l*N/A
*-commutativeN/A
associate-/r*N/A
div-invN/A
accelerator-lowering-fma.f64N/A
/-lowering-/.f64N/A
*-commutativeN/A
associate-/r*N/A
metadata-evalN/A
/-lowering-/.f6490.3
Applied egg-rr90.3%
if 840 < y Initial program 99.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
Simplified92.0%
(FPCore (x y z t)
:precision binary64
(if (<= y -8.5e-6)
(- x (/ y (* z 3.0)))
(if (<= y 800.0)
(fma 0.3333333333333333 (/ (/ t z) y) x)
(fma y (/ -0.3333333333333333 z) x))))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -8.5e-6) {
tmp = x - (y / (z * 3.0));
} else if (y <= 800.0) {
tmp = fma(0.3333333333333333, ((t / z) / y), x);
} else {
tmp = fma(y, (-0.3333333333333333 / z), x);
}
return tmp;
}
function code(x, y, z, t) tmp = 0.0 if (y <= -8.5e-6) tmp = Float64(x - Float64(y / Float64(z * 3.0))); elseif (y <= 800.0) tmp = fma(0.3333333333333333, Float64(Float64(t / z) / y), x); else tmp = fma(y, Float64(-0.3333333333333333 / z), x); end return tmp end
code[x_, y_, z_, t_] := If[LessEqual[y, -8.5e-6], N[(x - N[(y / N[(z * 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 800.0], N[(0.3333333333333333 * N[(N[(t / z), $MachinePrecision] / y), $MachinePrecision] + x), $MachinePrecision], N[(y * N[(-0.3333333333333333 / z), $MachinePrecision] + x), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -8.5 \cdot 10^{-6}:\\
\;\;\;\;x - \frac{y}{z \cdot 3}\\
\mathbf{elif}\;y \leq 800:\\
\;\;\;\;\mathsf{fma}\left(0.3333333333333333, \frac{\frac{t}{z}}{y}, x\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(y, \frac{-0.3333333333333333}{z}, x\right)\\
\end{array}
\end{array}
if y < -8.4999999999999999e-6Initial program 98.3%
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.8
Applied egg-rr99.8%
Taylor expanded in y around inf
Simplified93.8%
if -8.4999999999999999e-6 < y < 800Initial program 88.1%
Taylor expanded in x around inf
Simplified82.0%
+-commutativeN/A
associate-*l*N/A
*-commutativeN/A
associate-/r*N/A
div-invN/A
*-commutativeN/A
associate-/r*N/A
times-fracN/A
associate-/r/N/A
div-invN/A
clear-numN/A
times-fracN/A
metadata-evalN/A
accelerator-lowering-fma.f64N/A
/-lowering-/.f64N/A
/-lowering-/.f6486.9
Applied egg-rr86.9%
associate-/l/N/A
associate-/r*N/A
/-lowering-/.f64N/A
/-lowering-/.f6490.3
Applied egg-rr90.3%
if 800 < y Initial program 99.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
Simplified92.0%
(FPCore (x y z t)
:precision binary64
(if (<= y -1.62e+38)
(- x (/ y (* z 3.0)))
(if (<= y 1150.0)
(fma 0.3333333333333333 (/ (/ t y) z) x)
(fma y (/ -0.3333333333333333 z) x))))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -1.62e+38) {
tmp = x - (y / (z * 3.0));
} else if (y <= 1150.0) {
tmp = fma(0.3333333333333333, ((t / y) / z), x);
} else {
tmp = fma(y, (-0.3333333333333333 / z), x);
}
return tmp;
}
function code(x, y, z, t) tmp = 0.0 if (y <= -1.62e+38) tmp = Float64(x - Float64(y / Float64(z * 3.0))); elseif (y <= 1150.0) tmp = fma(0.3333333333333333, Float64(Float64(t / y) / z), x); else tmp = fma(y, Float64(-0.3333333333333333 / z), x); end return tmp end
code[x_, y_, z_, t_] := If[LessEqual[y, -1.62e+38], N[(x - N[(y / N[(z * 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1150.0], N[(0.3333333333333333 * N[(N[(t / y), $MachinePrecision] / z), $MachinePrecision] + x), $MachinePrecision], N[(y * N[(-0.3333333333333333 / z), $MachinePrecision] + x), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.62 \cdot 10^{+38}:\\
\;\;\;\;x - \frac{y}{z \cdot 3}\\
\mathbf{elif}\;y \leq 1150:\\
\;\;\;\;\mathsf{fma}\left(0.3333333333333333, \frac{\frac{t}{y}}{z}, x\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(y, \frac{-0.3333333333333333}{z}, x\right)\\
\end{array}
\end{array}
if y < -1.62000000000000001e38Initial program 98.0%
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%
Taylor expanded in y around inf
Simplified98.1%
if -1.62000000000000001e38 < y < 1150Initial program 89.0%
Taylor expanded in x around inf
Simplified81.4%
+-commutativeN/A
associate-*l*N/A
*-commutativeN/A
associate-/r*N/A
div-invN/A
*-commutativeN/A
associate-/r*N/A
times-fracN/A
associate-/r/N/A
div-invN/A
clear-numN/A
times-fracN/A
metadata-evalN/A
accelerator-lowering-fma.f64N/A
/-lowering-/.f64N/A
/-lowering-/.f6486.0
Applied egg-rr86.0%
if 1150 < y Initial program 99.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
Simplified92.0%
(FPCore (x y z t)
:precision binary64
(if (<= y -2.1e+38)
(- x (/ y (* z 3.0)))
(if (<= y 1020.0)
(+ x (/ t (* (* z 3.0) y)))
(fma y (/ -0.3333333333333333 z) x))))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -2.1e+38) {
tmp = x - (y / (z * 3.0));
} else if (y <= 1020.0) {
tmp = x + (t / ((z * 3.0) * y));
} else {
tmp = fma(y, (-0.3333333333333333 / z), x);
}
return tmp;
}
function code(x, y, z, t) tmp = 0.0 if (y <= -2.1e+38) tmp = Float64(x - Float64(y / Float64(z * 3.0))); elseif (y <= 1020.0) tmp = Float64(x + Float64(t / Float64(Float64(z * 3.0) * y))); else tmp = fma(y, Float64(-0.3333333333333333 / z), x); end return tmp end
code[x_, y_, z_, t_] := If[LessEqual[y, -2.1e+38], N[(x - N[(y / N[(z * 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1020.0], N[(x + N[(t / N[(N[(z * 3.0), $MachinePrecision] * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(y * N[(-0.3333333333333333 / z), $MachinePrecision] + x), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -2.1 \cdot 10^{+38}:\\
\;\;\;\;x - \frac{y}{z \cdot 3}\\
\mathbf{elif}\;y \leq 1020:\\
\;\;\;\;x + \frac{t}{\left(z \cdot 3\right) \cdot y}\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(y, \frac{-0.3333333333333333}{z}, x\right)\\
\end{array}
\end{array}
if y < -2.1e38Initial program 98.0%
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%
Taylor expanded in y around inf
Simplified98.1%
if -2.1e38 < y < 1020Initial program 89.0%
Taylor expanded in x around inf
Simplified81.4%
if 1020 < y Initial program 99.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
Simplified92.0%
(FPCore (x y z t)
:precision binary64
(if (<= y -3e-27)
(- x (/ y (* z 3.0)))
(if (<= y 1.22e-104)
(/ (* t 0.3333333333333333) (* z y))
(fma y (/ -0.3333333333333333 z) x))))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -3e-27) {
tmp = x - (y / (z * 3.0));
} else if (y <= 1.22e-104) {
tmp = (t * 0.3333333333333333) / (z * y);
} else {
tmp = fma(y, (-0.3333333333333333 / z), x);
}
return tmp;
}
function code(x, y, z, t) tmp = 0.0 if (y <= -3e-27) tmp = Float64(x - Float64(y / Float64(z * 3.0))); elseif (y <= 1.22e-104) tmp = Float64(Float64(t * 0.3333333333333333) / Float64(z * y)); else tmp = fma(y, Float64(-0.3333333333333333 / z), x); end return tmp end
code[x_, y_, z_, t_] := If[LessEqual[y, -3e-27], N[(x - N[(y / N[(z * 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.22e-104], N[(N[(t * 0.3333333333333333), $MachinePrecision] / N[(z * y), $MachinePrecision]), $MachinePrecision], N[(y * N[(-0.3333333333333333 / z), $MachinePrecision] + x), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -3 \cdot 10^{-27}:\\
\;\;\;\;x - \frac{y}{z \cdot 3}\\
\mathbf{elif}\;y \leq 1.22 \cdot 10^{-104}:\\
\;\;\;\;\frac{t \cdot 0.3333333333333333}{z \cdot y}\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(y, \frac{-0.3333333333333333}{z}, x\right)\\
\end{array}
\end{array}
if y < -3.0000000000000001e-27Initial program 98.5%
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.8
Applied egg-rr99.8%
Taylor expanded in y around inf
Simplified92.0%
if -3.0000000000000001e-27 < y < 1.21999999999999997e-104Initial program 85.8%
Taylor expanded in y around 0
associate-*r/N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f6464.0
Simplified64.0%
if 1.21999999999999997e-104 < y Initial program 98.4%
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
Simplified78.9%
Final simplification76.0%
(FPCore (x y z t)
:precision binary64
(if (<= y -1.9e-27)
(- x (/ y (* z 3.0)))
(if (<= y 2.6e-104)
(* t (/ 0.3333333333333333 (* z y)))
(fma y (/ -0.3333333333333333 z) x))))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -1.9e-27) {
tmp = x - (y / (z * 3.0));
} else if (y <= 2.6e-104) {
tmp = t * (0.3333333333333333 / (z * y));
} else {
tmp = fma(y, (-0.3333333333333333 / z), x);
}
return tmp;
}
function code(x, y, z, t) tmp = 0.0 if (y <= -1.9e-27) tmp = Float64(x - Float64(y / Float64(z * 3.0))); elseif (y <= 2.6e-104) tmp = Float64(t * Float64(0.3333333333333333 / Float64(z * y))); else tmp = fma(y, Float64(-0.3333333333333333 / z), x); end return tmp end
code[x_, y_, z_, t_] := If[LessEqual[y, -1.9e-27], N[(x - N[(y / N[(z * 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 2.6e-104], N[(t * N[(0.3333333333333333 / N[(z * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(y * N[(-0.3333333333333333 / z), $MachinePrecision] + x), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.9 \cdot 10^{-27}:\\
\;\;\;\;x - \frac{y}{z \cdot 3}\\
\mathbf{elif}\;y \leq 2.6 \cdot 10^{-104}:\\
\;\;\;\;t \cdot \frac{0.3333333333333333}{z \cdot y}\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(y, \frac{-0.3333333333333333}{z}, x\right)\\
\end{array}
\end{array}
if y < -1.9e-27Initial program 98.5%
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.8
Applied egg-rr99.8%
Taylor expanded in y around inf
Simplified92.0%
if -1.9e-27 < y < 2.60000000000000003e-104Initial program 85.8%
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-*.f6492.3
Applied egg-rr92.3%
frac-2negN/A
div-invN/A
sub-negN/A
distribute-neg-inN/A
distribute-neg-frac2N/A
distribute-frac-negN/A
frac-2negN/A
+-commutativeN/A
sub-negN/A
*-lowering-*.f64N/A
--lowering--.f64N/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
distribute-rgt-neg-inN/A
*-lowering-*.f64N/A
metadata-eval92.2
Applied egg-rr92.2%
Taylor expanded in t around inf
*-lowering-*.f64N/A
/-lowering-/.f64N/A
*-commutativeN/A
*-lowering-*.f6463.9
Simplified63.9%
clear-numN/A
associate-*r/N/A
div-invN/A
associate-*r/N/A
associate-/r/N/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
*-commutativeN/A
*-lowering-*.f6464.0
Applied egg-rr64.0%
if 2.60000000000000003e-104 < y Initial program 98.4%
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
Simplified78.9%
Final simplification76.0%
(FPCore (x y z t)
:precision binary64
(if (<= y -1.9e-27)
(- x (/ y (* z 3.0)))
(if (<= y 1.3e-104)
(* (/ t (* z y)) 0.3333333333333333)
(fma y (/ -0.3333333333333333 z) x))))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -1.9e-27) {
tmp = x - (y / (z * 3.0));
} else if (y <= 1.3e-104) {
tmp = (t / (z * y)) * 0.3333333333333333;
} else {
tmp = fma(y, (-0.3333333333333333 / z), x);
}
return tmp;
}
function code(x, y, z, t) tmp = 0.0 if (y <= -1.9e-27) tmp = Float64(x - Float64(y / Float64(z * 3.0))); elseif (y <= 1.3e-104) tmp = Float64(Float64(t / Float64(z * y)) * 0.3333333333333333); else tmp = fma(y, Float64(-0.3333333333333333 / z), x); end return tmp end
code[x_, y_, z_, t_] := If[LessEqual[y, -1.9e-27], N[(x - N[(y / N[(z * 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.3e-104], N[(N[(t / N[(z * y), $MachinePrecision]), $MachinePrecision] * 0.3333333333333333), $MachinePrecision], N[(y * N[(-0.3333333333333333 / z), $MachinePrecision] + x), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.9 \cdot 10^{-27}:\\
\;\;\;\;x - \frac{y}{z \cdot 3}\\
\mathbf{elif}\;y \leq 1.3 \cdot 10^{-104}:\\
\;\;\;\;\frac{t}{z \cdot y} \cdot 0.3333333333333333\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(y, \frac{-0.3333333333333333}{z}, x\right)\\
\end{array}
\end{array}
if y < -1.9e-27Initial program 98.5%
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.8
Applied egg-rr99.8%
Taylor expanded in y around inf
Simplified92.0%
if -1.9e-27 < y < 1.30000000000000001e-104Initial program 85.8%
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-*.f6492.3
Applied egg-rr92.3%
Taylor expanded in y around 0
*-lowering-*.f64N/A
/-lowering-/.f64N/A
*-lowering-*.f6463.9
Simplified63.9%
if 1.30000000000000001e-104 < y Initial program 98.4%
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
Simplified78.9%
Final simplification76.0%
(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 92.9%
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-*.f6496.5
Applied egg-rr96.5%
Final simplification96.5%
(FPCore (x y z t) :precision binary64 (fma -0.3333333333333333 (/ (- y (/ t y)) z) x))
double code(double x, double y, double z, double t) {
return fma(-0.3333333333333333, ((y - (t / y)) / z), x);
}
function code(x, y, z, t) return fma(-0.3333333333333333, Float64(Float64(y - Float64(t / y)) / z), x) end
code[x_, y_, z_, t_] := N[(-0.3333333333333333 * N[(N[(y - N[(t / y), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision] + x), $MachinePrecision]
\begin{array}{l}
\\
\mathsf{fma}\left(-0.3333333333333333, \frac{y - \frac{t}{y}}{z}, x\right)
\end{array}
Initial program 92.9%
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-*.f6496.5
Applied egg-rr96.5%
sub-negN/A
+-commutativeN/A
distribute-neg-fracN/A
neg-mul-1N/A
*-commutativeN/A
times-fracN/A
metadata-evalN/A
metadata-evalN/A
accelerator-lowering-fma.f64N/A
metadata-evalN/A
/-lowering-/.f64N/A
--lowering--.f64N/A
/-lowering-/.f6496.4
Applied egg-rr96.4%
(FPCore (x y z t) :precision binary64 (if (<= y -3.5e+74) (/ y (* z -3.0)) (if (<= y 4.7e+88) x (/ (* y -0.3333333333333333) z))))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -3.5e+74) {
tmp = y / (z * -3.0);
} else if (y <= 4.7e+88) {
tmp = x;
} else {
tmp = (y * -0.3333333333333333) / z;
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (y <= (-3.5d+74)) then
tmp = y / (z * (-3.0d0))
else if (y <= 4.7d+88) then
tmp = x
else
tmp = (y * (-0.3333333333333333d0)) / z
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (y <= -3.5e+74) {
tmp = y / (z * -3.0);
} else if (y <= 4.7e+88) {
tmp = x;
} else {
tmp = (y * -0.3333333333333333) / z;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= -3.5e+74: tmp = y / (z * -3.0) elif y <= 4.7e+88: tmp = x else: tmp = (y * -0.3333333333333333) / z return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= -3.5e+74) tmp = Float64(y / Float64(z * -3.0)); elseif (y <= 4.7e+88) tmp = x; else tmp = Float64(Float64(y * -0.3333333333333333) / z); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (y <= -3.5e+74) tmp = y / (z * -3.0); elseif (y <= 4.7e+88) tmp = x; else tmp = (y * -0.3333333333333333) / z; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, -3.5e+74], N[(y / N[(z * -3.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 4.7e+88], x, N[(N[(y * -0.3333333333333333), $MachinePrecision] / z), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -3.5 \cdot 10^{+74}:\\
\;\;\;\;\frac{y}{z \cdot -3}\\
\mathbf{elif}\;y \leq 4.7 \cdot 10^{+88}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;\frac{y \cdot -0.3333333333333333}{z}\\
\end{array}
\end{array}
if y < -3.50000000000000014e74Initial program 97.7%
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
*-lowering-*.f64N/A
associate-*r/N/A
metadata-evalN/A
distribute-neg-fracN/A
metadata-evalN/A
/-lowering-/.f6480.2
Simplified80.2%
div-invN/A
div-invN/A
clear-numN/A
div-invN/A
metadata-evalN/A
un-div-invN/A
/-lowering-/.f64N/A
*-lowering-*.f6480.3
Applied egg-rr80.3%
if -3.50000000000000014e74 < y < 4.70000000000000007e88Initial program 90.3%
Taylor expanded in x around inf
Simplified31.1%
if 4.70000000000000007e88 < y Initial program 99.6%
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.6
Applied egg-rr99.6%
Taylor expanded in y around inf
associate-*r/N/A
/-lowering-/.f64N/A
*-lowering-*.f6488.4
Simplified88.4%
Final simplification47.8%
(FPCore (x y z t) :precision binary64 (if (<= y -4.2e+74) (/ y (* z -3.0)) (if (<= y 4.7e+88) x (* y (/ -0.3333333333333333 z)))))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -4.2e+74) {
tmp = y / (z * -3.0);
} else if (y <= 4.7e+88) {
tmp = x;
} else {
tmp = y * (-0.3333333333333333 / z);
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (y <= (-4.2d+74)) then
tmp = y / (z * (-3.0d0))
else if (y <= 4.7d+88) then
tmp = x
else
tmp = y * ((-0.3333333333333333d0) / z)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (y <= -4.2e+74) {
tmp = y / (z * -3.0);
} else if (y <= 4.7e+88) {
tmp = x;
} else {
tmp = y * (-0.3333333333333333 / z);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= -4.2e+74: tmp = y / (z * -3.0) elif y <= 4.7e+88: tmp = x else: tmp = y * (-0.3333333333333333 / z) return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= -4.2e+74) tmp = Float64(y / Float64(z * -3.0)); elseif (y <= 4.7e+88) tmp = x; else tmp = Float64(y * Float64(-0.3333333333333333 / z)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (y <= -4.2e+74) tmp = y / (z * -3.0); elseif (y <= 4.7e+88) tmp = x; else tmp = y * (-0.3333333333333333 / z); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, -4.2e+74], N[(y / N[(z * -3.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 4.7e+88], x, N[(y * N[(-0.3333333333333333 / z), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -4.2 \cdot 10^{+74}:\\
\;\;\;\;\frac{y}{z \cdot -3}\\
\mathbf{elif}\;y \leq 4.7 \cdot 10^{+88}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;y \cdot \frac{-0.3333333333333333}{z}\\
\end{array}
\end{array}
if y < -4.1999999999999998e74Initial program 97.7%
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
*-lowering-*.f64N/A
associate-*r/N/A
metadata-evalN/A
distribute-neg-fracN/A
metadata-evalN/A
/-lowering-/.f6480.2
Simplified80.2%
div-invN/A
div-invN/A
clear-numN/A
div-invN/A
metadata-evalN/A
un-div-invN/A
/-lowering-/.f64N/A
*-lowering-*.f6480.3
Applied egg-rr80.3%
if -4.1999999999999998e74 < y < 4.70000000000000007e88Initial program 90.3%
Taylor expanded in x around inf
Simplified31.1%
if 4.70000000000000007e88 < y Initial program 99.6%
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
*-lowering-*.f64N/A
associate-*r/N/A
metadata-evalN/A
distribute-neg-fracN/A
metadata-evalN/A
/-lowering-/.f6488.2
Simplified88.2%
(FPCore (x y z t) :precision binary64 (let* ((t_1 (* y (/ -0.3333333333333333 z)))) (if (<= y -1.6e+75) t_1 (if (<= y 4.8e+88) 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.6e+75) {
tmp = t_1;
} else if (y <= 4.8e+88) {
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.6d+75)) then
tmp = t_1
else if (y <= 4.8d+88) 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.6e+75) {
tmp = t_1;
} else if (y <= 4.8e+88) {
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.6e+75: tmp = t_1 elif y <= 4.8e+88: 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.6e+75) tmp = t_1; elseif (y <= 4.8e+88) 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.6e+75) tmp = t_1; elseif (y <= 4.8e+88) 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.6e+75], t$95$1, If[LessEqual[y, 4.8e+88], x, t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := y \cdot \frac{-0.3333333333333333}{z}\\
\mathbf{if}\;y \leq -1.6 \cdot 10^{+75}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq 4.8 \cdot 10^{+88}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y < -1.59999999999999992e75 or 4.7999999999999998e88 < y Initial program 98.5%
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
*-lowering-*.f64N/A
associate-*r/N/A
metadata-evalN/A
distribute-neg-fracN/A
metadata-evalN/A
/-lowering-/.f6483.6
Simplified83.6%
if -1.59999999999999992e75 < y < 4.7999999999999998e88Initial program 90.3%
Taylor expanded in x around inf
Simplified31.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 92.9%
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-*.f6496.5
Applied egg-rr96.5%
Taylor expanded in y around inf
Simplified59.4%
(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 92.9%
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
Simplified59.4%
(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 92.9%
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-*.f6496.5
Applied egg-rr96.5%
Taylor expanded in y around inf
sub-negN/A
associate-*r/N/A
metadata-evalN/A
distribute-neg-fracN/A
metadata-evalN/A
+-commutativeN/A
distribute-lft-inN/A
associate-/l*N/A
*-commutativeN/A
associate-*r/N/A
*-commutativeN/A
associate-*l/N/A
associate-/l*N/A
*-inversesN/A
*-rgt-identityN/A
accelerator-lowering-fma.f64N/A
/-lowering-/.f6459.3
Simplified59.3%
(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 92.9%
Taylor expanded in x around inf
Simplified26.4%
(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 2024199
(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))))