
(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 (<= (* z z) 4e+248) (fma x x (* y (* (fma z z (- t)) -4.0))) (fma x x (* -4.0 (* z (* z y))))))
double code(double x, double y, double z, double t) {
double tmp;
if ((z * z) <= 4e+248) {
tmp = fma(x, x, (y * (fma(z, z, -t) * -4.0)));
} else {
tmp = fma(x, x, (-4.0 * (z * (z * y))));
}
return tmp;
}
function code(x, y, z, t) tmp = 0.0 if (Float64(z * z) <= 4e+248) tmp = fma(x, x, Float64(y * Float64(fma(z, z, Float64(-t)) * -4.0))); else tmp = fma(x, x, Float64(-4.0 * Float64(z * Float64(z * y)))); end return tmp end
code[x_, y_, z_, t_] := If[LessEqual[N[(z * z), $MachinePrecision], 4e+248], N[(x * x + N[(y * N[(N[(z * z + (-t)), $MachinePrecision] * -4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x * x + N[(-4.0 * N[(z * N[(z * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \cdot z \leq 4 \cdot 10^{+248}:\\
\;\;\;\;\mathsf{fma}\left(x, x, y \cdot \left(\mathsf{fma}\left(z, z, -t\right) \cdot -4\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(x, x, -4 \cdot \left(z \cdot \left(z \cdot y\right)\right)\right)\\
\end{array}
\end{array}
if (*.f64 z z) < 4.00000000000000018e248Initial program 99.3%
lift--.f64N/A
sub-negN/A
lift-*.f64N/A
lower-fma.f64N/A
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
distribute-rgt-neg-inN/A
lower-*.f64N/A
*-commutativeN/A
distribute-rgt-neg-inN/A
lower-*.f64N/A
lift--.f64N/A
sub-negN/A
lift-*.f64N/A
lower-fma.f64N/A
lower-neg.f64N/A
metadata-eval99.3
Applied rewrites99.3%
if 4.00000000000000018e248 < (*.f64 z z) Initial program 72.8%
lift--.f64N/A
sub-negN/A
lift-*.f64N/A
lower-fma.f64N/A
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
distribute-rgt-neg-inN/A
lower-*.f64N/A
*-commutativeN/A
distribute-rgt-neg-inN/A
lower-*.f64N/A
lift--.f64N/A
sub-negN/A
lift-*.f64N/A
lower-fma.f64N/A
lower-neg.f64N/A
metadata-eval83.3
Applied rewrites83.3%
Taylor expanded in z around 0
*-commutativeN/A
lower-*.f6422.8
Applied rewrites22.8%
Taylor expanded in z around inf
lower-*.f64N/A
unpow2N/A
associate-*r*N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f6499.9
Applied rewrites99.9%
Final simplification99.5%
(FPCore (x y z t)
:precision binary64
(if (<= (* z z) 5e-96)
(fma y (* t 4.0) (* x x))
(if (<= (* z z) 4e+248)
(fma -4.0 (* (* z z) y) (* x x))
(* z (* z (* y -4.0))))))
double code(double x, double y, double z, double t) {
double tmp;
if ((z * z) <= 5e-96) {
tmp = fma(y, (t * 4.0), (x * x));
} else if ((z * z) <= 4e+248) {
tmp = fma(-4.0, ((z * z) * y), (x * x));
} else {
tmp = z * (z * (y * -4.0));
}
return tmp;
}
function code(x, y, z, t) tmp = 0.0 if (Float64(z * z) <= 5e-96) tmp = fma(y, Float64(t * 4.0), Float64(x * x)); elseif (Float64(z * z) <= 4e+248) tmp = fma(-4.0, Float64(Float64(z * z) * y), Float64(x * x)); 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], 5e-96], N[(y * N[(t * 4.0), $MachinePrecision] + N[(x * x), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(z * z), $MachinePrecision], 4e+248], N[(-4.0 * N[(N[(z * z), $MachinePrecision] * y), $MachinePrecision] + N[(x * x), $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 5 \cdot 10^{-96}:\\
\;\;\;\;\mathsf{fma}\left(y, t \cdot 4, x \cdot x\right)\\
\mathbf{elif}\;z \cdot z \leq 4 \cdot 10^{+248}:\\
\;\;\;\;\mathsf{fma}\left(-4, \left(z \cdot z\right) \cdot y, x \cdot x\right)\\
\mathbf{else}:\\
\;\;\;\;z \cdot \left(z \cdot \left(y \cdot -4\right)\right)\\
\end{array}
\end{array}
if (*.f64 z z) < 4.99999999999999995e-96Initial program 98.9%
Taylor expanded in z around 0
cancel-sign-sub-invN/A
metadata-evalN/A
+-commutativeN/A
associate-*r*N/A
*-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
unpow2N/A
lower-*.f6497.3
Applied rewrites97.3%
if 4.99999999999999995e-96 < (*.f64 z z) < 4.00000000000000018e248Initial program 99.9%
Taylor expanded in t around 0
cancel-sign-sub-invN/A
metadata-evalN/A
+-commutativeN/A
lower-fma.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
unpow2N/A
lower-*.f6476.6
Applied rewrites76.6%
if 4.00000000000000018e248 < (*.f64 z z) Initial program 72.8%
Taylor expanded in z around inf
lower-*.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f6483.3
Applied rewrites83.3%
Applied rewrites91.0%
Final simplification89.1%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (- (* z z) t)))
(if (<= t_1 -1e+18)
(* y (* t 4.0))
(if (<= t_1 1e+215) (* x x) (* z (* z (* y -4.0)))))))
double code(double x, double y, double z, double t) {
double t_1 = (z * z) - t;
double tmp;
if (t_1 <= -1e+18) {
tmp = y * (t * 4.0);
} else if (t_1 <= 1e+215) {
tmp = x * x;
} else {
tmp = z * (z * (y * -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) :: t_1
real(8) :: tmp
t_1 = (z * z) - t
if (t_1 <= (-1d+18)) then
tmp = y * (t * 4.0d0)
else if (t_1 <= 1d+215) then
tmp = x * x
else
tmp = z * (z * (y * (-4.0d0)))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = (z * z) - t;
double tmp;
if (t_1 <= -1e+18) {
tmp = y * (t * 4.0);
} else if (t_1 <= 1e+215) {
tmp = x * x;
} else {
tmp = z * (z * (y * -4.0));
}
return tmp;
}
def code(x, y, z, t): t_1 = (z * z) - t tmp = 0 if t_1 <= -1e+18: tmp = y * (t * 4.0) elif t_1 <= 1e+215: tmp = x * x else: tmp = z * (z * (y * -4.0)) return tmp
function code(x, y, z, t) t_1 = Float64(Float64(z * z) - t) tmp = 0.0 if (t_1 <= -1e+18) tmp = Float64(y * Float64(t * 4.0)); elseif (t_1 <= 1e+215) tmp = Float64(x * x); else tmp = Float64(z * Float64(z * Float64(y * -4.0))); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = (z * z) - t; tmp = 0.0; if (t_1 <= -1e+18) tmp = y * (t * 4.0); elseif (t_1 <= 1e+215) tmp = x * x; else tmp = z * (z * (y * -4.0)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(z * z), $MachinePrecision] - t), $MachinePrecision]}, If[LessEqual[t$95$1, -1e+18], N[(y * N[(t * 4.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 1e+215], N[(x * x), $MachinePrecision], N[(z * N[(z * N[(y * -4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := z \cdot z - t\\
\mathbf{if}\;t\_1 \leq -1 \cdot 10^{+18}:\\
\;\;\;\;y \cdot \left(t \cdot 4\right)\\
\mathbf{elif}\;t\_1 \leq 10^{+215}:\\
\;\;\;\;x \cdot x\\
\mathbf{else}:\\
\;\;\;\;z \cdot \left(z \cdot \left(y \cdot -4\right)\right)\\
\end{array}
\end{array}
if (-.f64 (*.f64 z z) t) < -1e18Initial program 96.3%
Taylor expanded in t around inf
associate-*r*N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6468.0
Applied rewrites68.0%
if -1e18 < (-.f64 (*.f64 z z) t) < 9.99999999999999907e214Initial program 99.9%
Taylor expanded in x around inf
unpow2N/A
lower-*.f6450.5
Applied rewrites50.5%
if 9.99999999999999907e214 < (-.f64 (*.f64 z z) t) Initial program 77.1%
Taylor expanded in z around inf
lower-*.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f6478.4
Applied rewrites78.4%
Applied rewrites84.8%
Final simplification66.0%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* -4.0 (* (* z z) y))))
(if (<= x 4.5e-284)
t_1
(if (<= x 5e-166) (* y (* t 4.0)) (if (<= x 1.2e+61) t_1 (* x x))))))
double code(double x, double y, double z, double t) {
double t_1 = -4.0 * ((z * z) * y);
double tmp;
if (x <= 4.5e-284) {
tmp = t_1;
} else if (x <= 5e-166) {
tmp = y * (t * 4.0);
} else if (x <= 1.2e+61) {
tmp = t_1;
} 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) :: t_1
real(8) :: tmp
t_1 = (-4.0d0) * ((z * z) * y)
if (x <= 4.5d-284) then
tmp = t_1
else if (x <= 5d-166) then
tmp = y * (t * 4.0d0)
else if (x <= 1.2d+61) then
tmp = t_1
else
tmp = x * x
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = -4.0 * ((z * z) * y);
double tmp;
if (x <= 4.5e-284) {
tmp = t_1;
} else if (x <= 5e-166) {
tmp = y * (t * 4.0);
} else if (x <= 1.2e+61) {
tmp = t_1;
} else {
tmp = x * x;
}
return tmp;
}
def code(x, y, z, t): t_1 = -4.0 * ((z * z) * y) tmp = 0 if x <= 4.5e-284: tmp = t_1 elif x <= 5e-166: tmp = y * (t * 4.0) elif x <= 1.2e+61: tmp = t_1 else: tmp = x * x return tmp
function code(x, y, z, t) t_1 = Float64(-4.0 * Float64(Float64(z * z) * y)) tmp = 0.0 if (x <= 4.5e-284) tmp = t_1; elseif (x <= 5e-166) tmp = Float64(y * Float64(t * 4.0)); elseif (x <= 1.2e+61) tmp = t_1; else tmp = Float64(x * x); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = -4.0 * ((z * z) * y); tmp = 0.0; if (x <= 4.5e-284) tmp = t_1; elseif (x <= 5e-166) tmp = y * (t * 4.0); elseif (x <= 1.2e+61) tmp = t_1; else tmp = x * x; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(-4.0 * N[(N[(z * z), $MachinePrecision] * y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, 4.5e-284], t$95$1, If[LessEqual[x, 5e-166], N[(y * N[(t * 4.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 1.2e+61], t$95$1, N[(x * x), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := -4 \cdot \left(\left(z \cdot z\right) \cdot y\right)\\
\mathbf{if}\;x \leq 4.5 \cdot 10^{-284}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \leq 5 \cdot 10^{-166}:\\
\;\;\;\;y \cdot \left(t \cdot 4\right)\\
\mathbf{elif}\;x \leq 1.2 \cdot 10^{+61}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;x \cdot x\\
\end{array}
\end{array}
if x < 4.4999999999999999e-284 or 5e-166 < x < 1.1999999999999999e61Initial program 91.0%
Taylor expanded in z around inf
lower-*.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f6447.5
Applied rewrites47.5%
if 4.4999999999999999e-284 < x < 5e-166Initial program 91.7%
Taylor expanded in t around inf
associate-*r*N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6464.3
Applied rewrites64.3%
if 1.1999999999999999e61 < x Initial program 86.1%
Taylor expanded in x around inf
unpow2N/A
lower-*.f6472.9
Applied rewrites72.9%
Final simplification53.3%
(FPCore (x y z t) :precision binary64 (if (<= (* z z) 5e-96) (fma y (* t 4.0) (* x x)) (fma x x (* -4.0 (* z (* z y))))))
double code(double x, double y, double z, double t) {
double tmp;
if ((z * z) <= 5e-96) {
tmp = fma(y, (t * 4.0), (x * x));
} else {
tmp = fma(x, x, (-4.0 * (z * (z * y))));
}
return tmp;
}
function code(x, y, z, t) tmp = 0.0 if (Float64(z * z) <= 5e-96) tmp = fma(y, Float64(t * 4.0), Float64(x * x)); else tmp = fma(x, x, Float64(-4.0 * Float64(z * Float64(z * y)))); end return tmp end
code[x_, y_, z_, t_] := If[LessEqual[N[(z * z), $MachinePrecision], 5e-96], N[(y * N[(t * 4.0), $MachinePrecision] + N[(x * x), $MachinePrecision]), $MachinePrecision], N[(x * x + N[(-4.0 * N[(z * N[(z * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \cdot z \leq 5 \cdot 10^{-96}:\\
\;\;\;\;\mathsf{fma}\left(y, t \cdot 4, x \cdot x\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(x, x, -4 \cdot \left(z \cdot \left(z \cdot y\right)\right)\right)\\
\end{array}
\end{array}
if (*.f64 z z) < 4.99999999999999995e-96Initial program 98.9%
Taylor expanded in z around 0
cancel-sign-sub-invN/A
metadata-evalN/A
+-commutativeN/A
associate-*r*N/A
*-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
unpow2N/A
lower-*.f6497.3
Applied rewrites97.3%
if 4.99999999999999995e-96 < (*.f64 z z) Initial program 85.5%
lift--.f64N/A
sub-negN/A
lift-*.f64N/A
lower-fma.f64N/A
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
distribute-rgt-neg-inN/A
lower-*.f64N/A
*-commutativeN/A
distribute-rgt-neg-inN/A
lower-*.f64N/A
lift--.f64N/A
sub-negN/A
lift-*.f64N/A
lower-fma.f64N/A
lower-neg.f64N/A
metadata-eval91.1
Applied rewrites91.1%
Taylor expanded in z around 0
*-commutativeN/A
lower-*.f6440.7
Applied rewrites40.7%
Taylor expanded in z around inf
lower-*.f64N/A
unpow2N/A
associate-*r*N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f6489.0
Applied rewrites89.0%
Final simplification92.0%
(FPCore (x y z t) :precision binary64 (if (<= (* z z) 2e+212) (fma y (* t 4.0) (* x x)) (* z (* z (* y -4.0)))))
double code(double x, double y, double z, double t) {
double tmp;
if ((z * z) <= 2e+212) {
tmp = fma(y, (t * 4.0), (x * x));
} else {
tmp = z * (z * (y * -4.0));
}
return tmp;
}
function code(x, y, z, t) tmp = 0.0 if (Float64(z * z) <= 2e+212) tmp = fma(y, Float64(t * 4.0), Float64(x * x)); 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+212], N[(y * N[(t * 4.0), $MachinePrecision] + N[(x * x), $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^{+212}:\\
\;\;\;\;\mathsf{fma}\left(y, t \cdot 4, x \cdot x\right)\\
\mathbf{else}:\\
\;\;\;\;z \cdot \left(z \cdot \left(y \cdot -4\right)\right)\\
\end{array}
\end{array}
if (*.f64 z z) < 1.9999999999999998e212Initial program 99.3%
Taylor expanded in z around 0
cancel-sign-sub-invN/A
metadata-evalN/A
+-commutativeN/A
associate-*r*N/A
*-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
unpow2N/A
lower-*.f6484.3
Applied rewrites84.3%
if 1.9999999999999998e212 < (*.f64 z z) Initial program 75.4%
Taylor expanded in z around inf
lower-*.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f6482.9
Applied rewrites82.9%
Applied rewrites89.8%
Final simplification86.3%
(FPCore (x y z t) :precision binary64 (if (<= x 2.75e+16) (* y (* t 4.0)) (* x x)))
double code(double x, double y, double z, double t) {
double tmp;
if (x <= 2.75e+16) {
tmp = y * (t * 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 <= 2.75d+16) then
tmp = y * (t * 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 <= 2.75e+16) {
tmp = y * (t * 4.0);
} else {
tmp = x * x;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if x <= 2.75e+16: tmp = y * (t * 4.0) else: tmp = x * x return tmp
function code(x, y, z, t) tmp = 0.0 if (x <= 2.75e+16) tmp = Float64(y * Float64(t * 4.0)); else tmp = Float64(x * x); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (x <= 2.75e+16) tmp = y * (t * 4.0); else tmp = x * x; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[x, 2.75e+16], N[(y * N[(t * 4.0), $MachinePrecision]), $MachinePrecision], N[(x * x), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq 2.75 \cdot 10^{+16}:\\
\;\;\;\;y \cdot \left(t \cdot 4\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot x\\
\end{array}
\end{array}
if x < 2.75e16Initial program 91.1%
Taylor expanded in t around inf
associate-*r*N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6433.7
Applied rewrites33.7%
if 2.75e16 < x Initial program 86.8%
Taylor expanded in x around inf
unpow2N/A
lower-*.f6469.0
Applied rewrites69.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 90.4%
Taylor expanded in x around inf
unpow2N/A
lower-*.f6435.6
Applied rewrites35.6%
(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 2024232
(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))))