
(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 8 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 (<= (* x x) 1e+308) (- (* x x) (fma (* (* y 4.0) z) z (* (* y -4.0) t))) (* x x)))
double code(double x, double y, double z, double t) {
double tmp;
if ((x * x) <= 1e+308) {
tmp = (x * x) - fma(((y * 4.0) * z), z, ((y * -4.0) * t));
} else {
tmp = x * x;
}
return tmp;
}
function code(x, y, z, t) tmp = 0.0 if (Float64(x * x) <= 1e+308) tmp = Float64(Float64(x * x) - fma(Float64(Float64(y * 4.0) * z), z, Float64(Float64(y * -4.0) * t))); else tmp = Float64(x * x); end return tmp end
code[x_, y_, z_, t_] := If[LessEqual[N[(x * x), $MachinePrecision], 1e+308], N[(N[(x * x), $MachinePrecision] - N[(N[(N[(y * 4.0), $MachinePrecision] * z), $MachinePrecision] * z + N[(N[(y * -4.0), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x * x), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \cdot x \leq 10^{+308}:\\
\;\;\;\;x \cdot x - \mathsf{fma}\left(\left(y \cdot 4\right) \cdot z, z, \left(y \cdot -4\right) \cdot t\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot x\\
\end{array}
\end{array}
if (*.f64 x x) < 1e308Initial program 95.5%
sub-negN/A
distribute-lft-inN/A
*-commutativeN/A
associate-*r*N/A
accelerator-lowering-fma.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
*-commutativeN/A
neg-mul-1N/A
associate-*r*N/A
*-commutativeN/A
neg-mul-1N/A
*-lowering-*.f64N/A
distribute-rgt-neg-inN/A
*-lowering-*.f64N/A
metadata-eval98.4
Applied egg-rr98.4%
if 1e308 < (*.f64 x x) Initial program 79.4%
Taylor expanded in x around inf
+-rgt-identityN/A
unpow2N/A
accelerator-lowering-fma.f6492.1
Simplified92.1%
+-rgt-identityN/A
*-lowering-*.f6492.1
Applied egg-rr92.1%
(FPCore (x y z t) :precision binary64 (if (<= (* x x) 1e-176) (* 4.0 (* y t)) (if (<= (* x x) 1.5e+15) (* (* y -4.0) (* z z)) (* x x))))
double code(double x, double y, double z, double t) {
double tmp;
if ((x * x) <= 1e-176) {
tmp = 4.0 * (y * t);
} else if ((x * x) <= 1.5e+15) {
tmp = (y * -4.0) * (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) <= 1d-176) then
tmp = 4.0d0 * (y * t)
else if ((x * x) <= 1.5d+15) then
tmp = (y * (-4.0d0)) * (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) <= 1e-176) {
tmp = 4.0 * (y * t);
} else if ((x * x) <= 1.5e+15) {
tmp = (y * -4.0) * (z * z);
} else {
tmp = x * x;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (x * x) <= 1e-176: tmp = 4.0 * (y * t) elif (x * x) <= 1.5e+15: tmp = (y * -4.0) * (z * z) else: tmp = x * x return tmp
function code(x, y, z, t) tmp = 0.0 if (Float64(x * x) <= 1e-176) tmp = Float64(4.0 * Float64(y * t)); elseif (Float64(x * x) <= 1.5e+15) tmp = Float64(Float64(y * -4.0) * 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) <= 1e-176) tmp = 4.0 * (y * t); elseif ((x * x) <= 1.5e+15) tmp = (y * -4.0) * (z * z); else tmp = x * x; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[N[(x * x), $MachinePrecision], 1e-176], N[(4.0 * N[(y * t), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(x * x), $MachinePrecision], 1.5e+15], N[(N[(y * -4.0), $MachinePrecision] * N[(z * z), $MachinePrecision]), $MachinePrecision], N[(x * x), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \cdot x \leq 10^{-176}:\\
\;\;\;\;4 \cdot \left(y \cdot t\right)\\
\mathbf{elif}\;x \cdot x \leq 1.5 \cdot 10^{+15}:\\
\;\;\;\;\left(y \cdot -4\right) \cdot \left(z \cdot z\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot x\\
\end{array}
\end{array}
if (*.f64 x x) < 1e-176Initial program 96.3%
Taylor expanded in t around inf
+-rgt-identityN/A
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
associate-*l*N/A
accelerator-lowering-fma.f64N/A
*-commutativeN/A
*-lowering-*.f6462.9
Simplified62.9%
+-rgt-identityN/A
associate-*r*N/A
*-lowering-*.f64N/A
*-lowering-*.f6462.9
Applied egg-rr62.9%
if 1e-176 < (*.f64 x x) < 1.5e15Initial program 99.9%
Taylor expanded in z around inf
+-rgt-identityN/A
accelerator-lowering-fma.f64N/A
*-lowering-*.f64N/A
+-rgt-identityN/A
unpow2N/A
accelerator-lowering-fma.f6462.6
Simplified62.6%
+-rgt-identityN/A
associate-*r*N/A
+-rgt-identityN/A
associate-*r*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f6462.5
Applied egg-rr62.5%
associate-*l*N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f6462.6
Applied egg-rr62.6%
if 1.5e15 < (*.f64 x x) Initial program 84.3%
Taylor expanded in x around inf
+-rgt-identityN/A
unpow2N/A
accelerator-lowering-fma.f6473.9
Simplified73.9%
+-rgt-identityN/A
*-lowering-*.f6473.9
Applied egg-rr73.9%
Final simplification67.7%
(FPCore (x y z t) :precision binary64 (if (<= (* z z) 1e+107) (fma x x (* y (* -4.0 (fma z z (- 0.0 t))))) (fma (* z (* y -4.0)) z (* x x))))
double code(double x, double y, double z, double t) {
double tmp;
if ((z * z) <= 1e+107) {
tmp = fma(x, x, (y * (-4.0 * fma(z, z, (0.0 - t)))));
} else {
tmp = fma((z * (y * -4.0)), z, (x * x));
}
return tmp;
}
function code(x, y, z, t) tmp = 0.0 if (Float64(z * z) <= 1e+107) tmp = fma(x, x, Float64(y * Float64(-4.0 * fma(z, z, Float64(0.0 - t))))); else tmp = fma(Float64(z * Float64(y * -4.0)), z, Float64(x * x)); end return tmp end
code[x_, y_, z_, t_] := If[LessEqual[N[(z * z), $MachinePrecision], 1e+107], N[(x * x + N[(y * N[(-4.0 * N[(z * z + N[(0.0 - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(z * N[(y * -4.0), $MachinePrecision]), $MachinePrecision] * z + N[(x * x), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \cdot z \leq 10^{+107}:\\
\;\;\;\;\mathsf{fma}\left(x, x, y \cdot \left(-4 \cdot \mathsf{fma}\left(z, z, 0 - t\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(z \cdot \left(y \cdot -4\right), z, x \cdot x\right)\\
\end{array}
\end{array}
if (*.f64 z z) < 9.9999999999999997e106Initial program 97.5%
sub-negN/A
accelerator-lowering-fma.f64N/A
associate-*l*N/A
distribute-rgt-neg-inN/A
*-lowering-*.f64N/A
*-commutativeN/A
distribute-rgt-neg-inN/A
*-lowering-*.f64N/A
sub-negN/A
accelerator-lowering-fma.f64N/A
neg-sub0N/A
--lowering--.f64N/A
metadata-eval98.7
Applied egg-rr98.7%
if 9.9999999999999997e106 < (*.f64 z z) Initial program 81.2%
Taylor expanded in z around inf
+-rgt-identityN/A
unpow2N/A
accelerator-lowering-fma.f6480.3
Simplified80.3%
sub-negN/A
distribute-lft-neg-inN/A
*-commutativeN/A
distribute-lft-neg-inN/A
metadata-evalN/A
associate-*r*N/A
+-commutativeN/A
associate-*r*N/A
+-rgt-identityN/A
associate-*r*N/A
accelerator-lowering-fma.f64N/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
+-rgt-identityN/A
accelerator-lowering-fma.f6492.6
Applied egg-rr92.6%
+-rgt-identityN/A
*-lowering-*.f6492.6
Applied egg-rr92.6%
Final simplification96.5%
(FPCore (x y z t) :precision binary64 (if (<= (* z z) 1e+107) (fma x x (* 4.0 (* y t))) (fma (* z (* y -4.0)) z (* x x))))
double code(double x, double y, double z, double t) {
double tmp;
if ((z * z) <= 1e+107) {
tmp = fma(x, x, (4.0 * (y * t)));
} else {
tmp = fma((z * (y * -4.0)), z, (x * x));
}
return tmp;
}
function code(x, y, z, t) tmp = 0.0 if (Float64(z * z) <= 1e+107) tmp = fma(x, x, Float64(4.0 * Float64(y * t))); else tmp = fma(Float64(z * Float64(y * -4.0)), z, Float64(x * x)); end return tmp end
code[x_, y_, z_, t_] := If[LessEqual[N[(z * z), $MachinePrecision], 1e+107], N[(x * x + N[(4.0 * N[(y * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(z * N[(y * -4.0), $MachinePrecision]), $MachinePrecision] * z + N[(x * x), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \cdot z \leq 10^{+107}:\\
\;\;\;\;\mathsf{fma}\left(x, x, 4 \cdot \left(y \cdot t\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(z \cdot \left(y \cdot -4\right), z, x \cdot x\right)\\
\end{array}
\end{array}
if (*.f64 z z) < 9.9999999999999997e106Initial program 97.5%
sub-negN/A
accelerator-lowering-fma.f64N/A
associate-*l*N/A
distribute-rgt-neg-inN/A
*-lowering-*.f64N/A
*-commutativeN/A
distribute-rgt-neg-inN/A
*-lowering-*.f64N/A
sub-negN/A
accelerator-lowering-fma.f64N/A
neg-sub0N/A
--lowering--.f64N/A
metadata-eval98.7
Applied egg-rr98.7%
Taylor expanded in z around 0
+-rgt-identityN/A
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
accelerator-lowering-fma.f64N/A
*-commutativeN/A
*-lowering-*.f6491.3
Simplified91.3%
+-rgt-identityN/A
associate-*r*N/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f6491.9
Applied egg-rr91.9%
if 9.9999999999999997e106 < (*.f64 z z) Initial program 81.2%
Taylor expanded in z around inf
+-rgt-identityN/A
unpow2N/A
accelerator-lowering-fma.f6480.3
Simplified80.3%
sub-negN/A
distribute-lft-neg-inN/A
*-commutativeN/A
distribute-lft-neg-inN/A
metadata-evalN/A
associate-*r*N/A
+-commutativeN/A
associate-*r*N/A
+-rgt-identityN/A
associate-*r*N/A
accelerator-lowering-fma.f64N/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
+-rgt-identityN/A
accelerator-lowering-fma.f6492.6
Applied egg-rr92.6%
+-rgt-identityN/A
*-lowering-*.f6492.6
Applied egg-rr92.6%
Final simplification92.2%
(FPCore (x y z t) :precision binary64 (if (<= (* z z) 2e+159) (fma y (* 4.0 t) (fma x x 0.0)) (* z (* z (* y -4.0)))))
double code(double x, double y, double z, double t) {
double tmp;
if ((z * z) <= 2e+159) {
tmp = fma(y, (4.0 * t), fma(x, x, 0.0));
} else {
tmp = z * (z * (y * -4.0));
}
return tmp;
}
function code(x, y, z, t) tmp = 0.0 if (Float64(z * z) <= 2e+159) tmp = fma(y, Float64(4.0 * t), fma(x, x, 0.0)); else tmp = Float64(z * Float64(z * Float64(y * -4.0))); end return tmp end
code[x_, y_, z_, t_] := If[LessEqual[N[(z * z), $MachinePrecision], 2e+159], N[(y * N[(4.0 * t), $MachinePrecision] + N[(x * x + 0.0), $MachinePrecision]), $MachinePrecision], N[(z * N[(z * N[(y * -4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \cdot z \leq 2 \cdot 10^{+159}:\\
\;\;\;\;\mathsf{fma}\left(y, 4 \cdot t, \mathsf{fma}\left(x, x, 0\right)\right)\\
\mathbf{else}:\\
\;\;\;\;z \cdot \left(z \cdot \left(y \cdot -4\right)\right)\\
\end{array}
\end{array}
if (*.f64 z z) < 1.9999999999999999e159Initial program 97.0%
Taylor expanded in z around 0
cancel-sign-sub-invN/A
metadata-evalN/A
+-commutativeN/A
associate-*r*N/A
*-commutativeN/A
accelerator-lowering-fma.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
+-rgt-identityN/A
unpow2N/A
accelerator-lowering-fma.f6491.4
Simplified91.4%
if 1.9999999999999999e159 < (*.f64 z z) Initial program 81.3%
Taylor expanded in z around inf
+-rgt-identityN/A
accelerator-lowering-fma.f64N/A
*-lowering-*.f64N/A
+-rgt-identityN/A
unpow2N/A
accelerator-lowering-fma.f6479.4
Simplified79.4%
+-rgt-identityN/A
associate-*r*N/A
+-rgt-identityN/A
associate-*r*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f6485.7
Applied egg-rr85.7%
Final simplification89.4%
(FPCore (x y z t) :precision binary64 (if (<= (* z z) 2e+159) (fma x x (* 4.0 (* y t))) (* z (* z (* y -4.0)))))
double code(double x, double y, double z, double t) {
double tmp;
if ((z * z) <= 2e+159) {
tmp = fma(x, x, (4.0 * (y * t)));
} else {
tmp = z * (z * (y * -4.0));
}
return tmp;
}
function code(x, y, z, t) tmp = 0.0 if (Float64(z * z) <= 2e+159) tmp = fma(x, x, Float64(4.0 * Float64(y * t))); else tmp = Float64(z * Float64(z * Float64(y * -4.0))); end return tmp end
code[x_, y_, z_, t_] := If[LessEqual[N[(z * z), $MachinePrecision], 2e+159], N[(x * x + N[(4.0 * N[(y * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(z * N[(z * N[(y * -4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \cdot z \leq 2 \cdot 10^{+159}:\\
\;\;\;\;\mathsf{fma}\left(x, x, 4 \cdot \left(y \cdot t\right)\right)\\
\mathbf{else}:\\
\;\;\;\;z \cdot \left(z \cdot \left(y \cdot -4\right)\right)\\
\end{array}
\end{array}
if (*.f64 z z) < 1.9999999999999999e159Initial program 97.0%
sub-negN/A
accelerator-lowering-fma.f64N/A
associate-*l*N/A
distribute-rgt-neg-inN/A
*-lowering-*.f64N/A
*-commutativeN/A
distribute-rgt-neg-inN/A
*-lowering-*.f64N/A
sub-negN/A
accelerator-lowering-fma.f64N/A
neg-sub0N/A
--lowering--.f64N/A
metadata-eval98.2
Applied egg-rr98.2%
Taylor expanded in z around 0
+-rgt-identityN/A
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
accelerator-lowering-fma.f64N/A
*-commutativeN/A
*-lowering-*.f6490.2
Simplified90.2%
+-rgt-identityN/A
associate-*r*N/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f6490.8
Applied egg-rr90.8%
if 1.9999999999999999e159 < (*.f64 z z) Initial program 81.3%
Taylor expanded in z around inf
+-rgt-identityN/A
accelerator-lowering-fma.f64N/A
*-lowering-*.f64N/A
+-rgt-identityN/A
unpow2N/A
accelerator-lowering-fma.f6479.4
Simplified79.4%
+-rgt-identityN/A
associate-*r*N/A
+-rgt-identityN/A
associate-*r*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f6485.7
Applied egg-rr85.7%
Final simplification89.1%
(FPCore (x y z t) :precision binary64 (if (<= (* x x) 2e+97) (* 4.0 (* y t)) (* x x)))
double code(double x, double y, double z, double t) {
double tmp;
if ((x * x) <= 2e+97) {
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 * x) <= 2d+97) 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 * x) <= 2e+97) {
tmp = 4.0 * (y * t);
} else {
tmp = x * x;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (x * x) <= 2e+97: tmp = 4.0 * (y * t) else: tmp = x * x return tmp
function code(x, y, z, t) tmp = 0.0 if (Float64(x * x) <= 2e+97) 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 * x) <= 2e+97) tmp = 4.0 * (y * t); else tmp = x * x; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[N[(x * x), $MachinePrecision], 2e+97], N[(4.0 * N[(y * t), $MachinePrecision]), $MachinePrecision], N[(x * x), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \cdot x \leq 2 \cdot 10^{+97}:\\
\;\;\;\;4 \cdot \left(y \cdot t\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot x\\
\end{array}
\end{array}
if (*.f64 x x) < 2.0000000000000001e97Initial program 96.3%
Taylor expanded in t around inf
+-rgt-identityN/A
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
associate-*l*N/A
accelerator-lowering-fma.f64N/A
*-commutativeN/A
*-lowering-*.f6454.0
Simplified54.0%
+-rgt-identityN/A
associate-*r*N/A
*-lowering-*.f64N/A
*-lowering-*.f6454.0
Applied egg-rr54.0%
if 2.0000000000000001e97 < (*.f64 x x) Initial program 84.0%
Taylor expanded in x around inf
+-rgt-identityN/A
unpow2N/A
accelerator-lowering-fma.f6480.0
Simplified80.0%
+-rgt-identityN/A
*-lowering-*.f6480.0
Applied egg-rr80.0%
Final simplification64.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 91.6%
Taylor expanded in x around inf
+-rgt-identityN/A
unpow2N/A
accelerator-lowering-fma.f6438.8
Simplified38.8%
+-rgt-identityN/A
*-lowering-*.f6438.8
Applied egg-rr38.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 2024196
(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))))