
(FPCore (x y z t) :precision binary64 (- (* x x) (* (* y 4.0) (- (* z z) t))))
double code(double x, double y, double z, double t) {
return (x * x) - ((y * 4.0) * ((z * z) - t));
}
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 * x) - ((y * 4.0d0) * ((z * z) - t))
end function
public static double code(double x, double y, double z, double t) {
return (x * x) - ((y * 4.0) * ((z * z) - t));
}
def code(x, y, z, t): return (x * x) - ((y * 4.0) * ((z * z) - t))
function code(x, y, z, t) return Float64(Float64(x * x) - Float64(Float64(y * 4.0) * Float64(Float64(z * z) - t))) end
function tmp = code(x, y, z, t) tmp = (x * x) - ((y * 4.0) * ((z * z) - t)); end
code[x_, y_, z_, t_] := N[(N[(x * x), $MachinePrecision] - N[(N[(y * 4.0), $MachinePrecision] * N[(N[(z * z), $MachinePrecision] - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x \cdot x - \left(y \cdot 4\right) \cdot \left(z \cdot z - t\right)
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 12 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t) :precision binary64 (- (* x x) (* (* y 4.0) (- (* z z) t))))
double code(double x, double y, double z, double t) {
return (x * x) - ((y * 4.0) * ((z * z) - t));
}
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 * x) - ((y * 4.0d0) * ((z * z) - t))
end function
public static double code(double x, double y, double z, double t) {
return (x * x) - ((y * 4.0) * ((z * z) - t));
}
def code(x, y, z, t): return (x * x) - ((y * 4.0) * ((z * z) - t))
function code(x, y, z, t) return Float64(Float64(x * x) - Float64(Float64(y * 4.0) * Float64(Float64(z * z) - t))) end
function tmp = code(x, y, z, t) tmp = (x * x) - ((y * 4.0) * ((z * z) - t)); end
code[x_, y_, z_, t_] := N[(N[(x * x), $MachinePrecision] - N[(N[(y * 4.0), $MachinePrecision] * N[(N[(z * z), $MachinePrecision] - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x \cdot x - \left(y \cdot 4\right) \cdot \left(z \cdot z - t\right)
\end{array}
(FPCore (x y z t) :precision binary64 (if (<= (* y 4.0) 5e-99) (+ (* x x) (* 4.0 (- (* y t) (* z (* y z))))) (fma x x (* y (* 4.0 (- t (* z z)))))))
double code(double x, double y, double z, double t) {
double tmp;
if ((y * 4.0) <= 5e-99) {
tmp = (x * x) + (4.0 * ((y * t) - (z * (y * z))));
} else {
tmp = fma(x, x, (y * (4.0 * (t - (z * z)))));
}
return tmp;
}
function code(x, y, z, t) tmp = 0.0 if (Float64(y * 4.0) <= 5e-99) tmp = Float64(Float64(x * x) + Float64(4.0 * Float64(Float64(y * t) - Float64(z * Float64(y * z))))); else tmp = fma(x, x, Float64(y * Float64(4.0 * Float64(t - Float64(z * z))))); end return tmp end
code[x_, y_, z_, t_] := If[LessEqual[N[(y * 4.0), $MachinePrecision], 5e-99], N[(N[(x * x), $MachinePrecision] + N[(4.0 * N[(N[(y * t), $MachinePrecision] - N[(z * N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x * x + N[(y * N[(4.0 * N[(t - N[(z * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \cdot 4 \leq 5 \cdot 10^{-99}:\\
\;\;\;\;x \cdot x + 4 \cdot \left(y \cdot t - z \cdot \left(y \cdot z\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(x, x, y \cdot \left(4 \cdot \left(t - z \cdot z\right)\right)\right)\\
\end{array}
\end{array}
if (*.f64 y #s(literal 4 binary64)) < 4.99999999999999969e-99Initial program 93.7%
sub-negN/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
*-commutativeN/A
associate-*l*N/A
distribute-rgt-neg-inN/A
*-commutativeN/A
*-lowering-*.f64N/A
*-commutativeN/A
distribute-rgt-neg-inN/A
*-lowering-*.f64N/A
sub-negN/A
+-commutativeN/A
distribute-neg-inN/A
unsub-negN/A
remove-double-negN/A
--lowering--.f64N/A
*-lowering-*.f6494.2%
Simplified94.2%
sub-negN/A
distribute-rgt-inN/A
fma-defineN/A
distribute-lft-neg-outN/A
fmm-undefN/A
--lowering--.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f6494.2%
Applied egg-rr94.2%
associate-*l*N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f6499.9%
Applied egg-rr99.9%
if 4.99999999999999969e-99 < (*.f64 y #s(literal 4 binary64)) Initial program 93.0%
sub-negN/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
*-commutativeN/A
associate-*l*N/A
distribute-rgt-neg-inN/A
*-commutativeN/A
*-lowering-*.f64N/A
*-commutativeN/A
distribute-rgt-neg-inN/A
*-lowering-*.f64N/A
sub-negN/A
+-commutativeN/A
distribute-neg-inN/A
unsub-negN/A
remove-double-negN/A
--lowering--.f64N/A
*-lowering-*.f6493.0%
Simplified93.0%
fma-defineN/A
fma-lowering-fma.f64N/A
associate-*r*N/A
*-commutativeN/A
associate-*l*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
--lowering--.f64N/A
*-lowering-*.f6497.6%
Applied egg-rr97.6%
Final simplification99.1%
(FPCore (x y z t)
:precision binary64
(if (<= (* z z) 5e+55)
(+ (* x x) (* 4.0 (* y t)))
(if (<= (* z z) 1e+282)
(+ (* x x) (* y (* (* z z) -4.0)))
(* (* z (* y z)) -4.0))))
double code(double x, double y, double z, double t) {
double tmp;
if ((z * z) <= 5e+55) {
tmp = (x * x) + (4.0 * (y * t));
} else if ((z * z) <= 1e+282) {
tmp = (x * x) + (y * ((z * z) * -4.0));
} else {
tmp = (z * (y * z)) * -4.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 * z) <= 5d+55) then
tmp = (x * x) + (4.0d0 * (y * t))
else if ((z * z) <= 1d+282) then
tmp = (x * x) + (y * ((z * z) * (-4.0d0)))
else
tmp = (z * (y * z)) * (-4.0d0)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((z * z) <= 5e+55) {
tmp = (x * x) + (4.0 * (y * t));
} else if ((z * z) <= 1e+282) {
tmp = (x * x) + (y * ((z * z) * -4.0));
} else {
tmp = (z * (y * z)) * -4.0;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (z * z) <= 5e+55: tmp = (x * x) + (4.0 * (y * t)) elif (z * z) <= 1e+282: tmp = (x * x) + (y * ((z * z) * -4.0)) else: tmp = (z * (y * z)) * -4.0 return tmp
function code(x, y, z, t) tmp = 0.0 if (Float64(z * z) <= 5e+55) tmp = Float64(Float64(x * x) + Float64(4.0 * Float64(y * t))); elseif (Float64(z * z) <= 1e+282) tmp = Float64(Float64(x * x) + Float64(y * Float64(Float64(z * z) * -4.0))); else tmp = Float64(Float64(z * Float64(y * z)) * -4.0); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((z * z) <= 5e+55) tmp = (x * x) + (4.0 * (y * t)); elseif ((z * z) <= 1e+282) tmp = (x * x) + (y * ((z * z) * -4.0)); else tmp = (z * (y * z)) * -4.0; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[N[(z * z), $MachinePrecision], 5e+55], N[(N[(x * x), $MachinePrecision] + N[(4.0 * N[(y * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(z * z), $MachinePrecision], 1e+282], N[(N[(x * x), $MachinePrecision] + N[(y * N[(N[(z * z), $MachinePrecision] * -4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(z * N[(y * z), $MachinePrecision]), $MachinePrecision] * -4.0), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \cdot z \leq 5 \cdot 10^{+55}:\\
\;\;\;\;x \cdot x + 4 \cdot \left(y \cdot t\right)\\
\mathbf{elif}\;z \cdot z \leq 10^{+282}:\\
\;\;\;\;x \cdot x + y \cdot \left(\left(z \cdot z\right) \cdot -4\right)\\
\mathbf{else}:\\
\;\;\;\;\left(z \cdot \left(y \cdot z\right)\right) \cdot -4\\
\end{array}
\end{array}
if (*.f64 z z) < 5.00000000000000046e55Initial program 99.3%
sub-negN/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
*-commutativeN/A
associate-*l*N/A
distribute-rgt-neg-inN/A
*-commutativeN/A
*-lowering-*.f64N/A
*-commutativeN/A
distribute-rgt-neg-inN/A
*-lowering-*.f64N/A
sub-negN/A
+-commutativeN/A
distribute-neg-inN/A
unsub-negN/A
remove-double-negN/A
--lowering--.f64N/A
*-lowering-*.f6499.9%
Simplified99.9%
Taylor expanded in z around 0
+-commutativeN/A
+-lowering-+.f64N/A
unpow2N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f6491.0%
Simplified91.0%
if 5.00000000000000046e55 < (*.f64 z z) < 1.00000000000000003e282Initial program 97.8%
sub-negN/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
*-commutativeN/A
associate-*l*N/A
distribute-rgt-neg-inN/A
*-commutativeN/A
*-lowering-*.f64N/A
*-commutativeN/A
distribute-rgt-neg-inN/A
*-lowering-*.f64N/A
sub-negN/A
+-commutativeN/A
distribute-neg-inN/A
unsub-negN/A
remove-double-negN/A
--lowering--.f64N/A
*-lowering-*.f6497.8%
Simplified97.8%
Taylor expanded in t around 0
+-commutativeN/A
+-lowering-+.f64N/A
unpow2N/A
*-lowering-*.f64N/A
associate-*r*N/A
*-commutativeN/A
associate-*l*N/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6488.5%
Simplified88.5%
if 1.00000000000000003e282 < (*.f64 z z) Initial program 71.4%
sub-negN/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
*-commutativeN/A
associate-*l*N/A
distribute-rgt-neg-inN/A
*-commutativeN/A
*-lowering-*.f64N/A
*-commutativeN/A
distribute-rgt-neg-inN/A
*-lowering-*.f64N/A
sub-negN/A
+-commutativeN/A
distribute-neg-inN/A
unsub-negN/A
remove-double-negN/A
--lowering--.f64N/A
*-lowering-*.f6471.4%
Simplified71.4%
Taylor expanded in z around inf
associate-*r*N/A
*-commutativeN/A
associate-*l*N/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6479.2%
Simplified79.2%
associate-*r*N/A
associate-*r*N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f6492.1%
Applied egg-rr92.1%
Final simplification90.7%
(FPCore (x y z t) :precision binary64 (if (<= x 3.3e+167) (+ (* x x) (* 4.0 (- (* y t) (* z (* y z))))) (* (* x x) (+ 1.0 (/ (* y (/ (* (* z z) -4.0) x)) x)))))
double code(double x, double y, double z, double t) {
double tmp;
if (x <= 3.3e+167) {
tmp = (x * x) + (4.0 * ((y * t) - (z * (y * z))));
} else {
tmp = (x * x) * (1.0 + ((y * (((z * z) * -4.0) / x)) / x));
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (x <= 3.3d+167) then
tmp = (x * x) + (4.0d0 * ((y * t) - (z * (y * z))))
else
tmp = (x * x) * (1.0d0 + ((y * (((z * z) * (-4.0d0)) / x)) / x))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (x <= 3.3e+167) {
tmp = (x * x) + (4.0 * ((y * t) - (z * (y * z))));
} else {
tmp = (x * x) * (1.0 + ((y * (((z * z) * -4.0) / x)) / x));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if x <= 3.3e+167: tmp = (x * x) + (4.0 * ((y * t) - (z * (y * z)))) else: tmp = (x * x) * (1.0 + ((y * (((z * z) * -4.0) / x)) / x)) return tmp
function code(x, y, z, t) tmp = 0.0 if (x <= 3.3e+167) tmp = Float64(Float64(x * x) + Float64(4.0 * Float64(Float64(y * t) - Float64(z * Float64(y * z))))); else tmp = Float64(Float64(x * x) * Float64(1.0 + Float64(Float64(y * Float64(Float64(Float64(z * z) * -4.0) / x)) / x))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (x <= 3.3e+167) tmp = (x * x) + (4.0 * ((y * t) - (z * (y * z)))); else tmp = (x * x) * (1.0 + ((y * (((z * z) * -4.0) / x)) / x)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[x, 3.3e+167], N[(N[(x * x), $MachinePrecision] + N[(4.0 * N[(N[(y * t), $MachinePrecision] - N[(z * N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x * x), $MachinePrecision] * N[(1.0 + N[(N[(y * N[(N[(N[(z * z), $MachinePrecision] * -4.0), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq 3.3 \cdot 10^{+167}:\\
\;\;\;\;x \cdot x + 4 \cdot \left(y \cdot t - z \cdot \left(y \cdot z\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(x \cdot x\right) \cdot \left(1 + \frac{y \cdot \frac{\left(z \cdot z\right) \cdot -4}{x}}{x}\right)\\
\end{array}
\end{array}
if x < 3.30000000000000018e167Initial program 94.1%
sub-negN/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
*-commutativeN/A
associate-*l*N/A
distribute-rgt-neg-inN/A
*-commutativeN/A
*-lowering-*.f64N/A
*-commutativeN/A
distribute-rgt-neg-inN/A
*-lowering-*.f64N/A
sub-negN/A
+-commutativeN/A
distribute-neg-inN/A
unsub-negN/A
remove-double-negN/A
--lowering--.f64N/A
*-lowering-*.f6494.5%
Simplified94.5%
sub-negN/A
distribute-rgt-inN/A
fma-defineN/A
distribute-lft-neg-outN/A
fmm-undefN/A
--lowering--.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f6493.7%
Applied egg-rr93.7%
associate-*l*N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f6497.3%
Applied egg-rr97.3%
if 3.30000000000000018e167 < x Initial program 86.4%
sub-negN/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
*-commutativeN/A
associate-*l*N/A
distribute-rgt-neg-inN/A
*-commutativeN/A
*-lowering-*.f64N/A
*-commutativeN/A
distribute-rgt-neg-inN/A
*-lowering-*.f64N/A
sub-negN/A
+-commutativeN/A
distribute-neg-inN/A
unsub-negN/A
remove-double-negN/A
--lowering--.f64N/A
*-lowering-*.f6486.4%
Simplified86.4%
Taylor expanded in t around 0
+-commutativeN/A
+-lowering-+.f64N/A
unpow2N/A
*-lowering-*.f64N/A
associate-*r*N/A
*-commutativeN/A
associate-*l*N/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6486.4%
Simplified86.4%
Taylor expanded in x around inf
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
associate-*r/N/A
unpow2N/A
associate-/r*N/A
/-lowering-/.f64N/A
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
associate-/l*N/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6495.5%
Simplified95.5%
Final simplification97.2%
(FPCore (x y z t) :precision binary64 (if (<= (* x x) 6.2e-165) (* 4.0 (* y t)) (if (<= (* x x) 1.66e+74) (* (* z (* y z)) -4.0) (* x x))))
double code(double x, double y, double z, double t) {
double tmp;
if ((x * x) <= 6.2e-165) {
tmp = 4.0 * (y * t);
} else if ((x * x) <= 1.66e+74) {
tmp = (z * (y * z)) * -4.0;
} else {
tmp = x * x;
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if ((x * x) <= 6.2d-165) then
tmp = 4.0d0 * (y * t)
else if ((x * x) <= 1.66d+74) then
tmp = (z * (y * z)) * (-4.0d0)
else
tmp = x * x
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((x * x) <= 6.2e-165) {
tmp = 4.0 * (y * t);
} else if ((x * x) <= 1.66e+74) {
tmp = (z * (y * z)) * -4.0;
} else {
tmp = x * x;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (x * x) <= 6.2e-165: tmp = 4.0 * (y * t) elif (x * x) <= 1.66e+74: tmp = (z * (y * z)) * -4.0 else: tmp = x * x return tmp
function code(x, y, z, t) tmp = 0.0 if (Float64(x * x) <= 6.2e-165) tmp = Float64(4.0 * Float64(y * t)); elseif (Float64(x * x) <= 1.66e+74) tmp = Float64(Float64(z * Float64(y * z)) * -4.0); else tmp = Float64(x * x); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((x * x) <= 6.2e-165) tmp = 4.0 * (y * t); elseif ((x * x) <= 1.66e+74) tmp = (z * (y * z)) * -4.0; else tmp = x * x; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[N[(x * x), $MachinePrecision], 6.2e-165], N[(4.0 * N[(y * t), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(x * x), $MachinePrecision], 1.66e+74], N[(N[(z * N[(y * z), $MachinePrecision]), $MachinePrecision] * -4.0), $MachinePrecision], N[(x * x), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \cdot x \leq 6.2 \cdot 10^{-165}:\\
\;\;\;\;4 \cdot \left(y \cdot t\right)\\
\mathbf{elif}\;x \cdot x \leq 1.66 \cdot 10^{+74}:\\
\;\;\;\;\left(z \cdot \left(y \cdot z\right)\right) \cdot -4\\
\mathbf{else}:\\
\;\;\;\;x \cdot x\\
\end{array}
\end{array}
if (*.f64 x x) < 6.19999999999999992e-165Initial program 97.3%
sub-negN/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
*-commutativeN/A
associate-*l*N/A
distribute-rgt-neg-inN/A
*-commutativeN/A
*-lowering-*.f64N/A
*-commutativeN/A
distribute-rgt-neg-inN/A
*-lowering-*.f64N/A
sub-negN/A
+-commutativeN/A
distribute-neg-inN/A
unsub-negN/A
remove-double-negN/A
--lowering--.f64N/A
*-lowering-*.f6498.2%
Simplified98.2%
Taylor expanded in t around inf
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f6458.9%
Simplified58.9%
if 6.19999999999999992e-165 < (*.f64 x x) < 1.66000000000000001e74Initial program 94.2%
sub-negN/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
*-commutativeN/A
associate-*l*N/A
distribute-rgt-neg-inN/A
*-commutativeN/A
*-lowering-*.f64N/A
*-commutativeN/A
distribute-rgt-neg-inN/A
*-lowering-*.f64N/A
sub-negN/A
+-commutativeN/A
distribute-neg-inN/A
unsub-negN/A
remove-double-negN/A
--lowering--.f64N/A
*-lowering-*.f6494.2%
Simplified94.2%
Taylor expanded in z around inf
associate-*r*N/A
*-commutativeN/A
associate-*l*N/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6450.0%
Simplified50.0%
associate-*r*N/A
associate-*r*N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f6455.6%
Applied egg-rr55.6%
if 1.66000000000000001e74 < (*.f64 x x) Initial program 88.7%
sub-negN/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
*-commutativeN/A
associate-*l*N/A
distribute-rgt-neg-inN/A
*-commutativeN/A
*-lowering-*.f64N/A
*-commutativeN/A
distribute-rgt-neg-inN/A
*-lowering-*.f64N/A
sub-negN/A
+-commutativeN/A
distribute-neg-inN/A
unsub-negN/A
remove-double-negN/A
--lowering--.f64N/A
*-lowering-*.f6488.7%
Simplified88.7%
Taylor expanded in x around inf
unpow2N/A
*-lowering-*.f6477.0%
Simplified77.0%
Final simplification65.0%
(FPCore (x y z t) :precision binary64 (if (<= (* z z) 1e+282) (+ (* x x) (* 4.0 (* y (- t (* z z))))) (* (* z (* y z)) -4.0)))
double code(double x, double y, double z, double t) {
double tmp;
if ((z * z) <= 1e+282) {
tmp = (x * x) + (4.0 * (y * (t - (z * z))));
} else {
tmp = (z * (y * z)) * -4.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 * z) <= 1d+282) then
tmp = (x * x) + (4.0d0 * (y * (t - (z * z))))
else
tmp = (z * (y * z)) * (-4.0d0)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((z * z) <= 1e+282) {
tmp = (x * x) + (4.0 * (y * (t - (z * z))));
} else {
tmp = (z * (y * z)) * -4.0;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (z * z) <= 1e+282: tmp = (x * x) + (4.0 * (y * (t - (z * z)))) else: tmp = (z * (y * z)) * -4.0 return tmp
function code(x, y, z, t) tmp = 0.0 if (Float64(z * z) <= 1e+282) tmp = Float64(Float64(x * x) + Float64(4.0 * Float64(y * Float64(t - Float64(z * z))))); else tmp = Float64(Float64(z * Float64(y * z)) * -4.0); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((z * z) <= 1e+282) tmp = (x * x) + (4.0 * (y * (t - (z * z)))); else tmp = (z * (y * z)) * -4.0; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[N[(z * z), $MachinePrecision], 1e+282], N[(N[(x * x), $MachinePrecision] + N[(4.0 * N[(y * N[(t - N[(z * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(z * N[(y * z), $MachinePrecision]), $MachinePrecision] * -4.0), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \cdot z \leq 10^{+282}:\\
\;\;\;\;x \cdot x + 4 \cdot \left(y \cdot \left(t - z \cdot z\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(z \cdot \left(y \cdot z\right)\right) \cdot -4\\
\end{array}
\end{array}
if (*.f64 z z) < 1.00000000000000003e282Initial program 98.9%
sub-negN/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
*-commutativeN/A
associate-*l*N/A
distribute-rgt-neg-inN/A
*-commutativeN/A
*-lowering-*.f64N/A
*-commutativeN/A
distribute-rgt-neg-inN/A
*-lowering-*.f64N/A
sub-negN/A
+-commutativeN/A
distribute-neg-inN/A
unsub-negN/A
remove-double-negN/A
--lowering--.f64N/A
*-lowering-*.f6499.4%
Simplified99.4%
if 1.00000000000000003e282 < (*.f64 z z) Initial program 71.4%
sub-negN/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
*-commutativeN/A
associate-*l*N/A
distribute-rgt-neg-inN/A
*-commutativeN/A
*-lowering-*.f64N/A
*-commutativeN/A
distribute-rgt-neg-inN/A
*-lowering-*.f64N/A
sub-negN/A
+-commutativeN/A
distribute-neg-inN/A
unsub-negN/A
remove-double-negN/A
--lowering--.f64N/A
*-lowering-*.f6471.4%
Simplified71.4%
Taylor expanded in z around inf
associate-*r*N/A
*-commutativeN/A
associate-*l*N/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6479.2%
Simplified79.2%
associate-*r*N/A
associate-*r*N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f6492.1%
Applied egg-rr92.1%
Final simplification98.0%
(FPCore (x y z t) :precision binary64 (if (<= (* z z) 5e+55) (+ (* x x) (* 4.0 (* y t))) (+ (* x x) (* z (* (* y z) -4.0)))))
double code(double x, double y, double z, double t) {
double tmp;
if ((z * z) <= 5e+55) {
tmp = (x * x) + (4.0 * (y * t));
} else {
tmp = (x * x) + (z * ((y * z) * -4.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 * z) <= 5d+55) then
tmp = (x * x) + (4.0d0 * (y * t))
else
tmp = (x * x) + (z * ((y * z) * (-4.0d0)))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((z * z) <= 5e+55) {
tmp = (x * x) + (4.0 * (y * t));
} else {
tmp = (x * x) + (z * ((y * z) * -4.0));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (z * z) <= 5e+55: tmp = (x * x) + (4.0 * (y * t)) else: tmp = (x * x) + (z * ((y * z) * -4.0)) return tmp
function code(x, y, z, t) tmp = 0.0 if (Float64(z * z) <= 5e+55) tmp = Float64(Float64(x * x) + Float64(4.0 * Float64(y * t))); else tmp = Float64(Float64(x * x) + Float64(z * Float64(Float64(y * z) * -4.0))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((z * z) <= 5e+55) tmp = (x * x) + (4.0 * (y * t)); else tmp = (x * x) + (z * ((y * z) * -4.0)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[N[(z * z), $MachinePrecision], 5e+55], N[(N[(x * x), $MachinePrecision] + N[(4.0 * N[(y * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x * x), $MachinePrecision] + N[(z * N[(N[(y * z), $MachinePrecision] * -4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \cdot z \leq 5 \cdot 10^{+55}:\\
\;\;\;\;x \cdot x + 4 \cdot \left(y \cdot t\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot x + z \cdot \left(\left(y \cdot z\right) \cdot -4\right)\\
\end{array}
\end{array}
if (*.f64 z z) < 5.00000000000000046e55Initial program 99.3%
sub-negN/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
*-commutativeN/A
associate-*l*N/A
distribute-rgt-neg-inN/A
*-commutativeN/A
*-lowering-*.f64N/A
*-commutativeN/A
distribute-rgt-neg-inN/A
*-lowering-*.f64N/A
sub-negN/A
+-commutativeN/A
distribute-neg-inN/A
unsub-negN/A
remove-double-negN/A
--lowering--.f64N/A
*-lowering-*.f6499.9%
Simplified99.9%
Taylor expanded in z around 0
+-commutativeN/A
+-lowering-+.f64N/A
unpow2N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f6491.0%
Simplified91.0%
if 5.00000000000000046e55 < (*.f64 z z) Initial program 84.9%
sub-negN/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
*-commutativeN/A
associate-*l*N/A
distribute-rgt-neg-inN/A
*-commutativeN/A
*-lowering-*.f64N/A
*-commutativeN/A
distribute-rgt-neg-inN/A
*-lowering-*.f64N/A
sub-negN/A
+-commutativeN/A
distribute-neg-inN/A
unsub-negN/A
remove-double-negN/A
--lowering--.f64N/A
*-lowering-*.f6484.9%
Simplified84.9%
Taylor expanded in t around 0
+-commutativeN/A
+-lowering-+.f64N/A
unpow2N/A
*-lowering-*.f64N/A
associate-*r*N/A
*-commutativeN/A
associate-*l*N/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6480.1%
Simplified80.1%
+-commutativeN/A
+-lowering-+.f64N/A
associate-*r*N/A
associate-*l*N/A
*-commutativeN/A
associate-*l*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f6489.3%
Applied egg-rr89.3%
Final simplification90.3%
(FPCore (x y z t) :precision binary64 (if (<= x 1.4e-83) (* 4.0 (* y t)) (if (<= x 1.02e+37) (* y (* (* z z) -4.0)) (* x x))))
double code(double x, double y, double z, double t) {
double tmp;
if (x <= 1.4e-83) {
tmp = 4.0 * (y * t);
} else if (x <= 1.02e+37) {
tmp = y * ((z * z) * -4.0);
} else {
tmp = x * x;
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (x <= 1.4d-83) then
tmp = 4.0d0 * (y * t)
else if (x <= 1.02d+37) then
tmp = y * ((z * z) * (-4.0d0))
else
tmp = x * x
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (x <= 1.4e-83) {
tmp = 4.0 * (y * t);
} else if (x <= 1.02e+37) {
tmp = y * ((z * z) * -4.0);
} else {
tmp = x * x;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if x <= 1.4e-83: tmp = 4.0 * (y * t) elif x <= 1.02e+37: tmp = y * ((z * z) * -4.0) else: tmp = x * x return tmp
function code(x, y, z, t) tmp = 0.0 if (x <= 1.4e-83) tmp = Float64(4.0 * Float64(y * t)); elseif (x <= 1.02e+37) tmp = Float64(y * Float64(Float64(z * z) * -4.0)); else tmp = Float64(x * x); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (x <= 1.4e-83) tmp = 4.0 * (y * t); elseif (x <= 1.02e+37) tmp = y * ((z * z) * -4.0); else tmp = x * x; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[x, 1.4e-83], N[(4.0 * N[(y * t), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 1.02e+37], N[(y * N[(N[(z * z), $MachinePrecision] * -4.0), $MachinePrecision]), $MachinePrecision], N[(x * x), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq 1.4 \cdot 10^{-83}:\\
\;\;\;\;4 \cdot \left(y \cdot t\right)\\
\mathbf{elif}\;x \leq 1.02 \cdot 10^{+37}:\\
\;\;\;\;y \cdot \left(\left(z \cdot z\right) \cdot -4\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot x\\
\end{array}
\end{array}
if x < 1.4e-83Initial program 95.0%
sub-negN/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
*-commutativeN/A
associate-*l*N/A
distribute-rgt-neg-inN/A
*-commutativeN/A
*-lowering-*.f64N/A
*-commutativeN/A
distribute-rgt-neg-inN/A
*-lowering-*.f64N/A
sub-negN/A
+-commutativeN/A
distribute-neg-inN/A
unsub-negN/A
remove-double-negN/A
--lowering--.f64N/A
*-lowering-*.f6495.6%
Simplified95.6%
Taylor expanded in t around inf
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f6445.6%
Simplified45.6%
if 1.4e-83 < x < 1.01999999999999995e37Initial program 92.4%
sub-negN/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
*-commutativeN/A
associate-*l*N/A
distribute-rgt-neg-inN/A
*-commutativeN/A
*-lowering-*.f64N/A
*-commutativeN/A
distribute-rgt-neg-inN/A
*-lowering-*.f64N/A
sub-negN/A
+-commutativeN/A
distribute-neg-inN/A
unsub-negN/A
remove-double-negN/A
--lowering--.f64N/A
*-lowering-*.f6492.4%
Simplified92.4%
Taylor expanded in z around inf
associate-*r*N/A
*-commutativeN/A
associate-*l*N/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6453.0%
Simplified53.0%
if 1.01999999999999995e37 < x Initial program 88.8%
sub-negN/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
*-commutativeN/A
associate-*l*N/A
distribute-rgt-neg-inN/A
*-commutativeN/A
*-lowering-*.f64N/A
*-commutativeN/A
distribute-rgt-neg-inN/A
*-lowering-*.f64N/A
sub-negN/A
+-commutativeN/A
distribute-neg-inN/A
unsub-negN/A
remove-double-negN/A
--lowering--.f64N/A
*-lowering-*.f6488.8%
Simplified88.8%
Taylor expanded in x around inf
unpow2N/A
*-lowering-*.f6474.7%
Simplified74.7%
(FPCore (x y z t) :precision binary64 (if (<= (* x x) 1.1e+74) (* 4.0 (* y (- t (* z z)))) (+ (* x x) (* 4.0 (* y t)))))
double code(double x, double y, double z, double t) {
double tmp;
if ((x * x) <= 1.1e+74) {
tmp = 4.0 * (y * (t - (z * z)));
} else {
tmp = (x * x) + (4.0 * (y * t));
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if ((x * x) <= 1.1d+74) then
tmp = 4.0d0 * (y * (t - (z * z)))
else
tmp = (x * x) + (4.0d0 * (y * t))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((x * x) <= 1.1e+74) {
tmp = 4.0 * (y * (t - (z * z)));
} else {
tmp = (x * x) + (4.0 * (y * t));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (x * x) <= 1.1e+74: tmp = 4.0 * (y * (t - (z * z))) else: tmp = (x * x) + (4.0 * (y * t)) return tmp
function code(x, y, z, t) tmp = 0.0 if (Float64(x * x) <= 1.1e+74) tmp = Float64(4.0 * Float64(y * Float64(t - Float64(z * z)))); else tmp = Float64(Float64(x * x) + Float64(4.0 * Float64(y * t))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((x * x) <= 1.1e+74) tmp = 4.0 * (y * (t - (z * z))); else tmp = (x * x) + (4.0 * (y * t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[N[(x * x), $MachinePrecision], 1.1e+74], N[(4.0 * N[(y * N[(t - N[(z * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x * x), $MachinePrecision] + N[(4.0 * N[(y * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \cdot x \leq 1.1 \cdot 10^{+74}:\\
\;\;\;\;4 \cdot \left(y \cdot \left(t - z \cdot z\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot x + 4 \cdot \left(y \cdot t\right)\\
\end{array}
\end{array}
if (*.f64 x x) < 1.1000000000000001e74Initial program 96.3%
sub-negN/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
*-commutativeN/A
associate-*l*N/A
distribute-rgt-neg-inN/A
*-commutativeN/A
*-lowering-*.f64N/A
*-commutativeN/A
distribute-rgt-neg-inN/A
*-lowering-*.f64N/A
sub-negN/A
+-commutativeN/A
distribute-neg-inN/A
unsub-negN/A
remove-double-negN/A
--lowering--.f64N/A
*-lowering-*.f6496.9%
Simplified96.9%
Taylor expanded in x around 0
*-lowering-*.f64N/A
*-lowering-*.f64N/A
--lowering--.f64N/A
unpow2N/A
*-lowering-*.f6488.5%
Simplified88.5%
if 1.1000000000000001e74 < (*.f64 x x) Initial program 88.7%
sub-negN/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
*-commutativeN/A
associate-*l*N/A
distribute-rgt-neg-inN/A
*-commutativeN/A
*-lowering-*.f64N/A
*-commutativeN/A
distribute-rgt-neg-inN/A
*-lowering-*.f64N/A
sub-negN/A
+-commutativeN/A
distribute-neg-inN/A
unsub-negN/A
remove-double-negN/A
--lowering--.f64N/A
*-lowering-*.f6488.7%
Simplified88.7%
Taylor expanded in z around 0
+-commutativeN/A
+-lowering-+.f64N/A
unpow2N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f6484.1%
Simplified84.1%
(FPCore (x y z t) :precision binary64 (if (<= (* x x) 2.1e+74) (* 4.0 (* y (- t (* z z)))) (* x x)))
double code(double x, double y, double z, double t) {
double tmp;
if ((x * x) <= 2.1e+74) {
tmp = 4.0 * (y * (t - (z * z)));
} else {
tmp = x * x;
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if ((x * x) <= 2.1d+74) then
tmp = 4.0d0 * (y * (t - (z * z)))
else
tmp = x * x
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((x * x) <= 2.1e+74) {
tmp = 4.0 * (y * (t - (z * z)));
} else {
tmp = x * x;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (x * x) <= 2.1e+74: tmp = 4.0 * (y * (t - (z * z))) else: tmp = x * x return tmp
function code(x, y, z, t) tmp = 0.0 if (Float64(x * x) <= 2.1e+74) tmp = Float64(4.0 * Float64(y * Float64(t - Float64(z * z)))); else tmp = Float64(x * x); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((x * x) <= 2.1e+74) tmp = 4.0 * (y * (t - (z * z))); else tmp = x * x; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[N[(x * x), $MachinePrecision], 2.1e+74], N[(4.0 * N[(y * N[(t - N[(z * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x * x), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \cdot x \leq 2.1 \cdot 10^{+74}:\\
\;\;\;\;4 \cdot \left(y \cdot \left(t - z \cdot z\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot x\\
\end{array}
\end{array}
if (*.f64 x x) < 2.0999999999999999e74Initial program 96.3%
sub-negN/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
*-commutativeN/A
associate-*l*N/A
distribute-rgt-neg-inN/A
*-commutativeN/A
*-lowering-*.f64N/A
*-commutativeN/A
distribute-rgt-neg-inN/A
*-lowering-*.f64N/A
sub-negN/A
+-commutativeN/A
distribute-neg-inN/A
unsub-negN/A
remove-double-negN/A
--lowering--.f64N/A
*-lowering-*.f6496.9%
Simplified96.9%
Taylor expanded in x around 0
*-lowering-*.f64N/A
*-lowering-*.f64N/A
--lowering--.f64N/A
unpow2N/A
*-lowering-*.f6488.5%
Simplified88.5%
if 2.0999999999999999e74 < (*.f64 x x) Initial program 88.7%
sub-negN/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
*-commutativeN/A
associate-*l*N/A
distribute-rgt-neg-inN/A
*-commutativeN/A
*-lowering-*.f64N/A
*-commutativeN/A
distribute-rgt-neg-inN/A
*-lowering-*.f64N/A
sub-negN/A
+-commutativeN/A
distribute-neg-inN/A
unsub-negN/A
remove-double-negN/A
--lowering--.f64N/A
*-lowering-*.f6488.7%
Simplified88.7%
Taylor expanded in x around inf
unpow2N/A
*-lowering-*.f6477.0%
Simplified77.0%
(FPCore (x y z t) :precision binary64 (+ (* x x) (* 4.0 (- (* y t) (* z (* y z))))))
double code(double x, double y, double z, double t) {
return (x * x) + (4.0 * ((y * t) - (z * (y * z))));
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = (x * x) + (4.0d0 * ((y * t) - (z * (y * z))))
end function
public static double code(double x, double y, double z, double t) {
return (x * x) + (4.0 * ((y * t) - (z * (y * z))));
}
def code(x, y, z, t): return (x * x) + (4.0 * ((y * t) - (z * (y * z))))
function code(x, y, z, t) return Float64(Float64(x * x) + Float64(4.0 * Float64(Float64(y * t) - Float64(z * Float64(y * z))))) end
function tmp = code(x, y, z, t) tmp = (x * x) + (4.0 * ((y * t) - (z * (y * z)))); end
code[x_, y_, z_, t_] := N[(N[(x * x), $MachinePrecision] + N[(4.0 * N[(N[(y * t), $MachinePrecision] - N[(z * N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x \cdot x + 4 \cdot \left(y \cdot t - z \cdot \left(y \cdot z\right)\right)
\end{array}
Initial program 93.5%
sub-negN/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
*-commutativeN/A
associate-*l*N/A
distribute-rgt-neg-inN/A
*-commutativeN/A
*-lowering-*.f64N/A
*-commutativeN/A
distribute-rgt-neg-inN/A
*-lowering-*.f64N/A
sub-negN/A
+-commutativeN/A
distribute-neg-inN/A
unsub-negN/A
remove-double-negN/A
--lowering--.f64N/A
*-lowering-*.f6493.8%
Simplified93.8%
sub-negN/A
distribute-rgt-inN/A
fma-defineN/A
distribute-lft-neg-outN/A
fmm-undefN/A
--lowering--.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f6493.0%
Applied egg-rr93.0%
associate-*l*N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f6496.8%
Applied egg-rr96.8%
Final simplification96.8%
(FPCore (x y z t) :precision binary64 (if (<= x 6.4e+17) (* 4.0 (* y t)) (* x x)))
double code(double x, double y, double z, double t) {
double tmp;
if (x <= 6.4e+17) {
tmp = 4.0 * (y * t);
} else {
tmp = x * x;
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (x <= 6.4d+17) then
tmp = 4.0d0 * (y * t)
else
tmp = x * x
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (x <= 6.4e+17) {
tmp = 4.0 * (y * t);
} else {
tmp = x * x;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if x <= 6.4e+17: tmp = 4.0 * (y * t) else: tmp = x * x return tmp
function code(x, y, z, t) tmp = 0.0 if (x <= 6.4e+17) tmp = Float64(4.0 * Float64(y * t)); else tmp = Float64(x * x); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (x <= 6.4e+17) tmp = 4.0 * (y * t); else tmp = x * x; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[x, 6.4e+17], N[(4.0 * N[(y * t), $MachinePrecision]), $MachinePrecision], N[(x * x), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq 6.4 \cdot 10^{+17}:\\
\;\;\;\;4 \cdot \left(y \cdot t\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot x\\
\end{array}
\end{array}
if x < 6.4e17Initial program 94.5%
sub-negN/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
*-commutativeN/A
associate-*l*N/A
distribute-rgt-neg-inN/A
*-commutativeN/A
*-lowering-*.f64N/A
*-commutativeN/A
distribute-rgt-neg-inN/A
*-lowering-*.f64N/A
sub-negN/A
+-commutativeN/A
distribute-neg-inN/A
unsub-negN/A
remove-double-negN/A
--lowering--.f64N/A
*-lowering-*.f6495.0%
Simplified95.0%
Taylor expanded in t around inf
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f6443.2%
Simplified43.2%
if 6.4e17 < x Initial program 89.9%
sub-negN/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
*-commutativeN/A
associate-*l*N/A
distribute-rgt-neg-inN/A
*-commutativeN/A
*-lowering-*.f64N/A
*-commutativeN/A
distribute-rgt-neg-inN/A
*-lowering-*.f64N/A
sub-negN/A
+-commutativeN/A
distribute-neg-inN/A
unsub-negN/A
remove-double-negN/A
--lowering--.f64N/A
*-lowering-*.f6489.9%
Simplified89.9%
Taylor expanded in x around inf
unpow2N/A
*-lowering-*.f6469.0%
Simplified69.0%
(FPCore (x y z t) :precision binary64 (* x x))
double code(double x, double y, double z, double t) {
return x * 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 * x
end function
public static double code(double x, double y, double z, double t) {
return x * x;
}
def code(x, y, z, t): return x * x
function code(x, y, z, t) return Float64(x * x) end
function tmp = code(x, y, z, t) tmp = x * x; end
code[x_, y_, z_, t_] := N[(x * x), $MachinePrecision]
\begin{array}{l}
\\
x \cdot x
\end{array}
Initial program 93.5%
sub-negN/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
*-commutativeN/A
associate-*l*N/A
distribute-rgt-neg-inN/A
*-commutativeN/A
*-lowering-*.f64N/A
*-commutativeN/A
distribute-rgt-neg-inN/A
*-lowering-*.f64N/A
sub-negN/A
+-commutativeN/A
distribute-neg-inN/A
unsub-negN/A
remove-double-negN/A
--lowering--.f64N/A
*-lowering-*.f6493.8%
Simplified93.8%
Taylor expanded in x around inf
unpow2N/A
*-lowering-*.f6435.8%
Simplified35.8%
(FPCore (x y z t) :precision binary64 (- (* x x) (* 4.0 (* y (- (* z z) t)))))
double code(double x, double y, double z, double t) {
return (x * x) - (4.0 * (y * ((z * z) - t)));
}
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 * x) - (4.0d0 * (y * ((z * z) - t)))
end function
public static double code(double x, double y, double z, double t) {
return (x * x) - (4.0 * (y * ((z * z) - t)));
}
def code(x, y, z, t): return (x * x) - (4.0 * (y * ((z * z) - t)))
function code(x, y, z, t) return Float64(Float64(x * x) - Float64(4.0 * Float64(y * Float64(Float64(z * z) - t)))) end
function tmp = code(x, y, z, t) tmp = (x * x) - (4.0 * (y * ((z * z) - t))); end
code[x_, y_, z_, t_] := N[(N[(x * x), $MachinePrecision] - N[(4.0 * N[(y * N[(N[(z * z), $MachinePrecision] - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x \cdot x - 4 \cdot \left(y \cdot \left(z \cdot z - t\right)\right)
\end{array}
herbie shell --seed 2024145
(FPCore (x y z t)
:name "Graphics.Rasterific.Shading:$sradialGradientWithFocusShader from Rasterific-0.6.1, B"
:precision binary64
:alt
(! :herbie-platform default (- (* x x) (* 4 (* y (- (* z z) t)))))
(- (* x x) (* (* y 4.0) (- (* z z) t))))