
(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+270) (fma (- (* z z) t) (* y -4.0) (* x x)) (fma x x (* (* (* y -4.0) z) z))))
double code(double x, double y, double z, double t) {
double tmp;
if ((z * z) <= 4e+270) {
tmp = fma(((z * z) - t), (y * -4.0), (x * x));
} else {
tmp = fma(x, x, (((y * -4.0) * z) * z));
}
return tmp;
}
function code(x, y, z, t) tmp = 0.0 if (Float64(z * z) <= 4e+270) tmp = fma(Float64(Float64(z * z) - t), Float64(y * -4.0), Float64(x * x)); else tmp = fma(x, x, Float64(Float64(Float64(y * -4.0) * z) * z)); end return tmp end
code[x_, y_, z_, t_] := If[LessEqual[N[(z * z), $MachinePrecision], 4e+270], N[(N[(N[(z * z), $MachinePrecision] - t), $MachinePrecision] * N[(y * -4.0), $MachinePrecision] + N[(x * x), $MachinePrecision]), $MachinePrecision], N[(x * x + N[(N[(N[(y * -4.0), $MachinePrecision] * z), $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \cdot z \leq 4 \cdot 10^{+270}:\\
\;\;\;\;\mathsf{fma}\left(z \cdot z - t, y \cdot -4, x \cdot x\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(x, x, \left(\left(y \cdot -4\right) \cdot z\right) \cdot z\right)\\
\end{array}
\end{array}
if (*.f64 z z) < 4.0000000000000002e270Initial program 97.2%
lift--.f64N/A
sub-negN/A
+-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
distribute-rgt-neg-inN/A
lower-fma.f64N/A
lift-*.f64N/A
*-commutativeN/A
distribute-lft-neg-inN/A
lower-*.f64N/A
metadata-eval98.9
Applied rewrites98.9%
if 4.0000000000000002e270 < (*.f64 z z) Initial program 80.2%
Taylor expanded in t around 0
cancel-sign-sub-invN/A
metadata-evalN/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
unpow2N/A
lower-*.f6478.7
Applied rewrites78.7%
Applied rewrites97.0%
Final simplification98.4%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* (* 4.0 t) y)))
(if (<= z 1.8e-234)
(* x x)
(if (<= z 1.75e-173)
t_1
(if (<= z 1.05e-60)
(* x x)
(if (<= z 1.25e-10) t_1 (* (* (* y z) z) -4.0)))))))
double code(double x, double y, double z, double t) {
double t_1 = (4.0 * t) * y;
double tmp;
if (z <= 1.8e-234) {
tmp = x * x;
} else if (z <= 1.75e-173) {
tmp = t_1;
} else if (z <= 1.05e-60) {
tmp = x * x;
} else if (z <= 1.25e-10) {
tmp = t_1;
} else {
tmp = ((y * z) * 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) :: t_1
real(8) :: tmp
t_1 = (4.0d0 * t) * y
if (z <= 1.8d-234) then
tmp = x * x
else if (z <= 1.75d-173) then
tmp = t_1
else if (z <= 1.05d-60) then
tmp = x * x
else if (z <= 1.25d-10) then
tmp = t_1
else
tmp = ((y * z) * z) * (-4.0d0)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = (4.0 * t) * y;
double tmp;
if (z <= 1.8e-234) {
tmp = x * x;
} else if (z <= 1.75e-173) {
tmp = t_1;
} else if (z <= 1.05e-60) {
tmp = x * x;
} else if (z <= 1.25e-10) {
tmp = t_1;
} else {
tmp = ((y * z) * z) * -4.0;
}
return tmp;
}
def code(x, y, z, t): t_1 = (4.0 * t) * y tmp = 0 if z <= 1.8e-234: tmp = x * x elif z <= 1.75e-173: tmp = t_1 elif z <= 1.05e-60: tmp = x * x elif z <= 1.25e-10: tmp = t_1 else: tmp = ((y * z) * z) * -4.0 return tmp
function code(x, y, z, t) t_1 = Float64(Float64(4.0 * t) * y) tmp = 0.0 if (z <= 1.8e-234) tmp = Float64(x * x); elseif (z <= 1.75e-173) tmp = t_1; elseif (z <= 1.05e-60) tmp = Float64(x * x); elseif (z <= 1.25e-10) tmp = t_1; else tmp = Float64(Float64(Float64(y * z) * z) * -4.0); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = (4.0 * t) * y; tmp = 0.0; if (z <= 1.8e-234) tmp = x * x; elseif (z <= 1.75e-173) tmp = t_1; elseif (z <= 1.05e-60) tmp = x * x; elseif (z <= 1.25e-10) tmp = t_1; else tmp = ((y * z) * z) * -4.0; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(4.0 * t), $MachinePrecision] * y), $MachinePrecision]}, If[LessEqual[z, 1.8e-234], N[(x * x), $MachinePrecision], If[LessEqual[z, 1.75e-173], t$95$1, If[LessEqual[z, 1.05e-60], N[(x * x), $MachinePrecision], If[LessEqual[z, 1.25e-10], t$95$1, N[(N[(N[(y * z), $MachinePrecision] * z), $MachinePrecision] * -4.0), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(4 \cdot t\right) \cdot y\\
\mathbf{if}\;z \leq 1.8 \cdot 10^{-234}:\\
\;\;\;\;x \cdot x\\
\mathbf{elif}\;z \leq 1.75 \cdot 10^{-173}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 1.05 \cdot 10^{-60}:\\
\;\;\;\;x \cdot x\\
\mathbf{elif}\;z \leq 1.25 \cdot 10^{-10}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;\left(\left(y \cdot z\right) \cdot z\right) \cdot -4\\
\end{array}
\end{array}
if z < 1.7999999999999999e-234 or 1.75000000000000007e-173 < z < 1.04999999999999996e-60Initial program 93.9%
Taylor expanded in t around 0
cancel-sign-sub-invN/A
metadata-evalN/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
unpow2N/A
lower-*.f6469.8
Applied rewrites69.8%
Applied rewrites72.8%
Taylor expanded in x around inf
unpow2N/A
lower-*.f6445.4
Applied rewrites45.4%
if 1.7999999999999999e-234 < z < 1.75000000000000007e-173 or 1.04999999999999996e-60 < z < 1.25000000000000008e-10Initial program 100.0%
Taylor expanded in t around inf
*-commutativeN/A
lower-*.f64N/A
lower-*.f6469.9
Applied rewrites69.9%
Applied rewrites69.9%
if 1.25000000000000008e-10 < z Initial program 86.6%
Taylor expanded in z around inf
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
unpow2N/A
lower-*.f6469.0
Applied rewrites69.0%
Applied rewrites75.6%
Final simplification55.8%
(FPCore (x y z t) :precision binary64 (if (<= (* z z) 2e+287) (fma x x (* (* y (- (* z z) t)) -4.0)) (fma x x (* (* (* y -4.0) z) z))))
double code(double x, double y, double z, double t) {
double tmp;
if ((z * z) <= 2e+287) {
tmp = fma(x, x, ((y * ((z * z) - t)) * -4.0));
} else {
tmp = fma(x, x, (((y * -4.0) * z) * z));
}
return tmp;
}
function code(x, y, z, t) tmp = 0.0 if (Float64(z * z) <= 2e+287) tmp = fma(x, x, Float64(Float64(y * Float64(Float64(z * z) - t)) * -4.0)); else tmp = fma(x, x, Float64(Float64(Float64(y * -4.0) * z) * z)); end return tmp end
code[x_, y_, z_, t_] := If[LessEqual[N[(z * z), $MachinePrecision], 2e+287], N[(x * x + N[(N[(y * N[(N[(z * z), $MachinePrecision] - t), $MachinePrecision]), $MachinePrecision] * -4.0), $MachinePrecision]), $MachinePrecision], N[(x * x + N[(N[(N[(y * -4.0), $MachinePrecision] * z), $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \cdot z \leq 2 \cdot 10^{+287}:\\
\;\;\;\;\mathsf{fma}\left(x, x, \left(y \cdot \left(z \cdot z - t\right)\right) \cdot -4\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(x, x, \left(\left(y \cdot -4\right) \cdot z\right) \cdot z\right)\\
\end{array}
\end{array}
if (*.f64 z z) < 2.0000000000000002e287Initial program 96.8%
lift--.f64N/A
sub-negN/A
lift-*.f64N/A
lower-fma.f64N/A
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
associate-*r*N/A
distribute-rgt-neg-inN/A
lower-*.f64N/A
lower-*.f64N/A
metadata-eval98.3
Applied rewrites98.3%
if 2.0000000000000002e287 < (*.f64 z z) Initial program 80.2%
Taylor expanded in t around 0
cancel-sign-sub-invN/A
metadata-evalN/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
unpow2N/A
lower-*.f6480.2
Applied rewrites80.2%
Applied rewrites98.4%
Final simplification98.4%
(FPCore (x y z t) :precision binary64 (if (<= (* z z) 2e-29) (fma (* 4.0 t) y (* x x)) (fma x x (* (* (* y -4.0) z) z))))
double code(double x, double y, double z, double t) {
double tmp;
if ((z * z) <= 2e-29) {
tmp = fma((4.0 * t), y, (x * x));
} else {
tmp = fma(x, x, (((y * -4.0) * z) * z));
}
return tmp;
}
function code(x, y, z, t) tmp = 0.0 if (Float64(z * z) <= 2e-29) tmp = fma(Float64(4.0 * t), y, Float64(x * x)); else tmp = fma(x, x, Float64(Float64(Float64(y * -4.0) * z) * z)); end return tmp end
code[x_, y_, z_, t_] := If[LessEqual[N[(z * z), $MachinePrecision], 2e-29], N[(N[(4.0 * t), $MachinePrecision] * y + N[(x * x), $MachinePrecision]), $MachinePrecision], N[(x * x + N[(N[(N[(y * -4.0), $MachinePrecision] * z), $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \cdot z \leq 2 \cdot 10^{-29}:\\
\;\;\;\;\mathsf{fma}\left(4 \cdot t, y, x \cdot x\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(x, x, \left(\left(y \cdot -4\right) \cdot z\right) \cdot z\right)\\
\end{array}
\end{array}
if (*.f64 z z) < 1.99999999999999989e-29Initial program 97.7%
Taylor expanded in z around 0
cancel-sign-sub-invN/A
metadata-evalN/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f6494.5
Applied rewrites94.5%
Applied rewrites96.0%
if 1.99999999999999989e-29 < (*.f64 z z) Initial program 87.5%
Taylor expanded in t around 0
cancel-sign-sub-invN/A
metadata-evalN/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
unpow2N/A
lower-*.f6480.6
Applied rewrites80.6%
Applied rewrites91.4%
Final simplification93.8%
(FPCore (x y z t) :precision binary64 (if (<= z 5.9e-20) (fma (* 4.0 t) y (* x x)) (if (<= z 2.2e+164) (* (* y (- (* z z) t)) -4.0) (* (* (* y z) z) -4.0))))
double code(double x, double y, double z, double t) {
double tmp;
if (z <= 5.9e-20) {
tmp = fma((4.0 * t), y, (x * x));
} else if (z <= 2.2e+164) {
tmp = (y * ((z * z) - t)) * -4.0;
} else {
tmp = ((y * z) * z) * -4.0;
}
return tmp;
}
function code(x, y, z, t) tmp = 0.0 if (z <= 5.9e-20) tmp = fma(Float64(4.0 * t), y, Float64(x * x)); elseif (z <= 2.2e+164) tmp = Float64(Float64(y * Float64(Float64(z * z) - t)) * -4.0); else tmp = Float64(Float64(Float64(y * z) * z) * -4.0); end return tmp end
code[x_, y_, z_, t_] := If[LessEqual[z, 5.9e-20], N[(N[(4.0 * t), $MachinePrecision] * y + N[(x * x), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 2.2e+164], N[(N[(y * N[(N[(z * z), $MachinePrecision] - t), $MachinePrecision]), $MachinePrecision] * -4.0), $MachinePrecision], N[(N[(N[(y * z), $MachinePrecision] * z), $MachinePrecision] * -4.0), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq 5.9 \cdot 10^{-20}:\\
\;\;\;\;\mathsf{fma}\left(4 \cdot t, y, x \cdot x\right)\\
\mathbf{elif}\;z \leq 2.2 \cdot 10^{+164}:\\
\;\;\;\;\left(y \cdot \left(z \cdot z - t\right)\right) \cdot -4\\
\mathbf{else}:\\
\;\;\;\;\left(\left(y \cdot z\right) \cdot z\right) \cdot -4\\
\end{array}
\end{array}
if z < 5.89999999999999966e-20Initial program 94.7%
Taylor expanded in z around 0
cancel-sign-sub-invN/A
metadata-evalN/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f6474.1
Applied rewrites74.1%
Applied rewrites75.7%
if 5.89999999999999966e-20 < z < 2.20000000000000006e164Initial program 95.0%
Taylor expanded in x around 0
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower--.f64N/A
unpow2N/A
lower-*.f6473.9
Applied rewrites73.9%
if 2.20000000000000006e164 < z Initial program 75.4%
Taylor expanded in z around inf
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
unpow2N/A
lower-*.f6482.8
Applied rewrites82.8%
Applied rewrites96.6%
Final simplification77.6%
(FPCore (x y z t) :precision binary64 (if (<= z 1.8e+41) (fma (* 4.0 t) y (* x x)) (* (* (* y z) z) -4.0)))
double code(double x, double y, double z, double t) {
double tmp;
if (z <= 1.8e+41) {
tmp = fma((4.0 * t), y, (x * x));
} else {
tmp = ((y * z) * z) * -4.0;
}
return tmp;
}
function code(x, y, z, t) tmp = 0.0 if (z <= 1.8e+41) tmp = fma(Float64(4.0 * t), y, Float64(x * x)); else tmp = Float64(Float64(Float64(y * z) * z) * -4.0); end return tmp end
code[x_, y_, z_, t_] := If[LessEqual[z, 1.8e+41], N[(N[(4.0 * t), $MachinePrecision] * y + N[(x * x), $MachinePrecision]), $MachinePrecision], N[(N[(N[(y * z), $MachinePrecision] * z), $MachinePrecision] * -4.0), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq 1.8 \cdot 10^{+41}:\\
\;\;\;\;\mathsf{fma}\left(4 \cdot t, y, x \cdot x\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\left(y \cdot z\right) \cdot z\right) \cdot -4\\
\end{array}
\end{array}
if z < 1.80000000000000013e41Initial program 95.1%
Taylor expanded in z around 0
cancel-sign-sub-invN/A
metadata-evalN/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f6472.4
Applied rewrites72.4%
Applied rewrites73.9%
if 1.80000000000000013e41 < z Initial program 83.0%
Taylor expanded in z around inf
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
unpow2N/A
lower-*.f6470.0
Applied rewrites70.0%
Applied rewrites78.4%
Final simplification74.8%
(FPCore (x y z t) :precision binary64 (if (<= (* x x) 1.3e+55) (* (* 4.0 t) y) (* x x)))
double code(double x, double y, double z, double t) {
double tmp;
if ((x * x) <= 1.3e+55) {
tmp = (4.0 * t) * y;
} 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) <= 1.3d+55) then
tmp = (4.0d0 * t) * y
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) <= 1.3e+55) {
tmp = (4.0 * t) * y;
} else {
tmp = x * x;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (x * x) <= 1.3e+55: tmp = (4.0 * t) * y else: tmp = x * x return tmp
function code(x, y, z, t) tmp = 0.0 if (Float64(x * x) <= 1.3e+55) tmp = Float64(Float64(4.0 * t) * y); else tmp = Float64(x * x); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((x * x) <= 1.3e+55) tmp = (4.0 * t) * y; else tmp = x * x; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[N[(x * x), $MachinePrecision], 1.3e+55], N[(N[(4.0 * t), $MachinePrecision] * y), $MachinePrecision], N[(x * x), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \cdot x \leq 1.3 \cdot 10^{+55}:\\
\;\;\;\;\left(4 \cdot t\right) \cdot y\\
\mathbf{else}:\\
\;\;\;\;x \cdot x\\
\end{array}
\end{array}
if (*.f64 x x) < 1.3e55Initial program 95.6%
Taylor expanded in t around inf
*-commutativeN/A
lower-*.f64N/A
lower-*.f6446.6
Applied rewrites46.6%
Applied rewrites46.6%
if 1.3e55 < (*.f64 x x) Initial program 88.7%
Taylor expanded in t around 0
cancel-sign-sub-invN/A
metadata-evalN/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
unpow2N/A
lower-*.f6482.7
Applied rewrites82.7%
Applied rewrites89.3%
Taylor expanded in x around inf
unpow2N/A
lower-*.f6475.4
Applied rewrites75.4%
Final simplification58.5%
(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 92.7%
Taylor expanded in t around 0
cancel-sign-sub-invN/A
metadata-evalN/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
unpow2N/A
lower-*.f6468.0
Applied rewrites68.0%
Applied rewrites73.3%
Taylor expanded in x around inf
unpow2N/A
lower-*.f6438.8
Applied rewrites38.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 2024294
(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))))