
(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 9 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) 1e+303)
(fma (* y 4.0) (- t (* z z)) (* x x))
(-
(* x x)
(pow (* (cbrt (* y 4.0)) (pow (cbrt (pow (cbrt z) 2.0)) 3.0)) 3.0))))
double code(double x, double y, double z, double t) {
double tmp;
if ((z * z) <= 1e+303) {
tmp = fma((y * 4.0), (t - (z * z)), (x * x));
} else {
tmp = (x * x) - pow((cbrt((y * 4.0)) * pow(cbrt(pow(cbrt(z), 2.0)), 3.0)), 3.0);
}
return tmp;
}
function code(x, y, z, t) tmp = 0.0 if (Float64(z * z) <= 1e+303) tmp = fma(Float64(y * 4.0), Float64(t - Float64(z * z)), Float64(x * x)); else tmp = Float64(Float64(x * x) - (Float64(cbrt(Float64(y * 4.0)) * (cbrt((cbrt(z) ^ 2.0)) ^ 3.0)) ^ 3.0)); end return tmp end
code[x_, y_, z_, t_] := If[LessEqual[N[(z * z), $MachinePrecision], 1e+303], N[(N[(y * 4.0), $MachinePrecision] * N[(t - N[(z * z), $MachinePrecision]), $MachinePrecision] + N[(x * x), $MachinePrecision]), $MachinePrecision], N[(N[(x * x), $MachinePrecision] - N[Power[N[(N[Power[N[(y * 4.0), $MachinePrecision], 1/3], $MachinePrecision] * N[Power[N[Power[N[Power[N[Power[z, 1/3], $MachinePrecision], 2.0], $MachinePrecision], 1/3], $MachinePrecision], 3.0], $MachinePrecision]), $MachinePrecision], 3.0], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \cdot z \leq 10^{+303}:\\
\;\;\;\;\mathsf{fma}\left(y \cdot 4, t - z \cdot z, x \cdot x\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot x - {\left(\sqrt[3]{y \cdot 4} \cdot {\left(\sqrt[3]{{\left(\sqrt[3]{z}\right)}^{2}}\right)}^{3}\right)}^{3}\\
\end{array}
\end{array}
if (*.f64 z z) < 1e303Initial program 97.4%
cancel-sign-sub-inv97.4%
distribute-lft-neg-out97.4%
+-commutative97.4%
associate-*l*97.4%
distribute-lft-neg-in97.4%
associate-*l*97.4%
distribute-rgt-neg-in97.4%
fma-define99.0%
sub-neg99.0%
+-commutative99.0%
distribute-neg-in99.0%
remove-double-neg99.0%
sub-neg99.0%
Simplified99.0%
if 1e303 < (*.f64 z z) Initial program 75.7%
*-commutative75.7%
add-sqr-sqrt32.7%
sqrt-unprod28.8%
swap-sqr28.8%
metadata-eval28.8%
metadata-eval28.8%
swap-sqr28.8%
sqrt-unprod0.0%
add-sqr-sqrt5.1%
add-cube-cbrt5.1%
pow35.1%
Applied egg-rr75.7%
pow1/332.7%
associate-*r*32.7%
unpow-prod-down32.7%
pow1/332.7%
Applied egg-rr32.7%
unpow1/375.7%
*-commutative75.7%
Simplified75.7%
Taylor expanded in t around 0 75.7%
unpow1/375.7%
Simplified75.7%
add-cube-cbrt75.7%
pow375.7%
unpow275.7%
cbrt-prod92.7%
pow292.7%
Applied egg-rr92.7%
Final simplification97.5%
(FPCore (x y z t) :precision binary64 (if (<= (* z z) 1e+303) (fma (* y 4.0) (- t (* z z)) (* x x)) (- (* x x) (pow (* (cbrt (* y 4.0)) (pow (cbrt z) 2.0)) 3.0))))
double code(double x, double y, double z, double t) {
double tmp;
if ((z * z) <= 1e+303) {
tmp = fma((y * 4.0), (t - (z * z)), (x * x));
} else {
tmp = (x * x) - pow((cbrt((y * 4.0)) * pow(cbrt(z), 2.0)), 3.0);
}
return tmp;
}
function code(x, y, z, t) tmp = 0.0 if (Float64(z * z) <= 1e+303) tmp = fma(Float64(y * 4.0), Float64(t - Float64(z * z)), Float64(x * x)); else tmp = Float64(Float64(x * x) - (Float64(cbrt(Float64(y * 4.0)) * (cbrt(z) ^ 2.0)) ^ 3.0)); end return tmp end
code[x_, y_, z_, t_] := If[LessEqual[N[(z * z), $MachinePrecision], 1e+303], N[(N[(y * 4.0), $MachinePrecision] * N[(t - N[(z * z), $MachinePrecision]), $MachinePrecision] + N[(x * x), $MachinePrecision]), $MachinePrecision], N[(N[(x * x), $MachinePrecision] - N[Power[N[(N[Power[N[(y * 4.0), $MachinePrecision], 1/3], $MachinePrecision] * N[Power[N[Power[z, 1/3], $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision], 3.0], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \cdot z \leq 10^{+303}:\\
\;\;\;\;\mathsf{fma}\left(y \cdot 4, t - z \cdot z, x \cdot x\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot x - {\left(\sqrt[3]{y \cdot 4} \cdot {\left(\sqrt[3]{z}\right)}^{2}\right)}^{3}\\
\end{array}
\end{array}
if (*.f64 z z) < 1e303Initial program 97.4%
cancel-sign-sub-inv97.4%
distribute-lft-neg-out97.4%
+-commutative97.4%
associate-*l*97.4%
distribute-lft-neg-in97.4%
associate-*l*97.4%
distribute-rgt-neg-in97.4%
fma-define99.0%
sub-neg99.0%
+-commutative99.0%
distribute-neg-in99.0%
remove-double-neg99.0%
sub-neg99.0%
Simplified99.0%
if 1e303 < (*.f64 z z) Initial program 75.7%
*-commutative75.7%
add-sqr-sqrt32.7%
sqrt-unprod28.8%
swap-sqr28.8%
metadata-eval28.8%
metadata-eval28.8%
swap-sqr28.8%
sqrt-unprod0.0%
add-sqr-sqrt5.1%
add-cube-cbrt5.1%
pow35.1%
Applied egg-rr75.7%
pow1/332.7%
associate-*r*32.7%
unpow-prod-down32.7%
pow1/332.7%
Applied egg-rr32.7%
unpow1/375.7%
*-commutative75.7%
Simplified75.7%
Taylor expanded in t around 0 75.7%
unpow1/375.7%
Simplified75.7%
add075.7%
*-commutative75.7%
fma-define75.7%
unpow275.7%
cbrt-prod92.7%
pow292.7%
Applied egg-rr92.7%
fma-undefine92.7%
add092.7%
*-commutative92.7%
Simplified92.7%
Final simplification97.5%
(FPCore (x y z t)
:precision binary64
(if (<= (* z z) 1e+303)
(fma (* y 4.0) (- t (* z z)) (* x x))
(+
(* x x)
(- 0.0 (pow (* (cbrt (* y 4.0)) (pow z 0.6666666666666666)) 3.0)))))
double code(double x, double y, double z, double t) {
double tmp;
if ((z * z) <= 1e+303) {
tmp = fma((y * 4.0), (t - (z * z)), (x * x));
} else {
tmp = (x * x) + (0.0 - pow((cbrt((y * 4.0)) * pow(z, 0.6666666666666666)), 3.0));
}
return tmp;
}
function code(x, y, z, t) tmp = 0.0 if (Float64(z * z) <= 1e+303) tmp = fma(Float64(y * 4.0), Float64(t - Float64(z * z)), Float64(x * x)); else tmp = Float64(Float64(x * x) + Float64(0.0 - (Float64(cbrt(Float64(y * 4.0)) * (z ^ 0.6666666666666666)) ^ 3.0))); end return tmp end
code[x_, y_, z_, t_] := If[LessEqual[N[(z * z), $MachinePrecision], 1e+303], N[(N[(y * 4.0), $MachinePrecision] * N[(t - N[(z * z), $MachinePrecision]), $MachinePrecision] + N[(x * x), $MachinePrecision]), $MachinePrecision], N[(N[(x * x), $MachinePrecision] + N[(0.0 - N[Power[N[(N[Power[N[(y * 4.0), $MachinePrecision], 1/3], $MachinePrecision] * N[Power[z, 0.6666666666666666], $MachinePrecision]), $MachinePrecision], 3.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \cdot z \leq 10^{+303}:\\
\;\;\;\;\mathsf{fma}\left(y \cdot 4, t - z \cdot z, x \cdot x\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot x + \left(0 - {\left(\sqrt[3]{y \cdot 4} \cdot {z}^{0.6666666666666666}\right)}^{3}\right)\\
\end{array}
\end{array}
if (*.f64 z z) < 1e303Initial program 97.4%
cancel-sign-sub-inv97.4%
distribute-lft-neg-out97.4%
+-commutative97.4%
associate-*l*97.4%
distribute-lft-neg-in97.4%
associate-*l*97.4%
distribute-rgt-neg-in97.4%
fma-define99.0%
sub-neg99.0%
+-commutative99.0%
distribute-neg-in99.0%
remove-double-neg99.0%
sub-neg99.0%
Simplified99.0%
if 1e303 < (*.f64 z z) Initial program 75.7%
*-commutative75.7%
add-sqr-sqrt32.7%
sqrt-unprod28.8%
swap-sqr28.8%
metadata-eval28.8%
metadata-eval28.8%
swap-sqr28.8%
sqrt-unprod0.0%
add-sqr-sqrt5.1%
add-cube-cbrt5.1%
pow35.1%
Applied egg-rr75.7%
pow1/332.7%
associate-*r*32.7%
unpow-prod-down32.7%
pow1/332.7%
Applied egg-rr32.7%
unpow1/375.7%
*-commutative75.7%
Simplified75.7%
Taylor expanded in t around 0 75.7%
unpow1/375.7%
Simplified75.7%
pow1/375.7%
pow-pow41.5%
metadata-eval41.5%
Applied egg-rr41.5%
Final simplification85.7%
(FPCore (x y z t) :precision binary64 (if (<= x 5e+211) (fma x x (* (- (* z z) t) (* y -4.0))) (pow x 2.0)))
double code(double x, double y, double z, double t) {
double tmp;
if (x <= 5e+211) {
tmp = fma(x, x, (((z * z) - t) * (y * -4.0)));
} else {
tmp = pow(x, 2.0);
}
return tmp;
}
function code(x, y, z, t) tmp = 0.0 if (x <= 5e+211) tmp = fma(x, x, Float64(Float64(Float64(z * z) - t) * Float64(y * -4.0))); else tmp = x ^ 2.0; end return tmp end
code[x_, y_, z_, t_] := If[LessEqual[x, 5e+211], N[(x * x + N[(N[(N[(z * z), $MachinePrecision] - t), $MachinePrecision] * N[(y * -4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[Power[x, 2.0], $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq 5 \cdot 10^{+211}:\\
\;\;\;\;\mathsf{fma}\left(x, x, \left(z \cdot z - t\right) \cdot \left(y \cdot -4\right)\right)\\
\mathbf{else}:\\
\;\;\;\;{x}^{2}\\
\end{array}
\end{array}
if x < 4.9999999999999995e211Initial program 92.6%
fma-neg94.3%
*-commutative94.3%
distribute-rgt-neg-in94.3%
distribute-rgt-neg-in94.3%
metadata-eval94.3%
Simplified94.3%
if 4.9999999999999995e211 < x Initial program 90.5%
Taylor expanded in x around inf 100.0%
Final simplification94.8%
(FPCore (x y z t) :precision binary64 (if (<= x 1.75e+140) (+ (* x x) (* (* y 4.0) (- t (* z z)))) (pow x 2.0)))
double code(double x, double y, double z, double t) {
double tmp;
if (x <= 1.75e+140) {
tmp = (x * x) + ((y * 4.0) * (t - (z * z)));
} else {
tmp = pow(x, 2.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 (x <= 1.75d+140) then
tmp = (x * x) + ((y * 4.0d0) * (t - (z * z)))
else
tmp = x ** 2.0d0
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (x <= 1.75e+140) {
tmp = (x * x) + ((y * 4.0) * (t - (z * z)));
} else {
tmp = Math.pow(x, 2.0);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if x <= 1.75e+140: tmp = (x * x) + ((y * 4.0) * (t - (z * z))) else: tmp = math.pow(x, 2.0) return tmp
function code(x, y, z, t) tmp = 0.0 if (x <= 1.75e+140) tmp = Float64(Float64(x * x) + Float64(Float64(y * 4.0) * Float64(t - Float64(z * z)))); else tmp = x ^ 2.0; end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (x <= 1.75e+140) tmp = (x * x) + ((y * 4.0) * (t - (z * z))); else tmp = x ^ 2.0; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[x, 1.75e+140], N[(N[(x * x), $MachinePrecision] + N[(N[(y * 4.0), $MachinePrecision] * N[(t - N[(z * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[Power[x, 2.0], $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq 1.75 \cdot 10^{+140}:\\
\;\;\;\;x \cdot x + \left(y \cdot 4\right) \cdot \left(t - z \cdot z\right)\\
\mathbf{else}:\\
\;\;\;\;{x}^{2}\\
\end{array}
\end{array}
if x < 1.74999999999999995e140Initial program 93.4%
if 1.74999999999999995e140 < x Initial program 86.1%
Taylor expanded in x around inf 91.7%
Final simplification93.2%
(FPCore (x y z t) :precision binary64 (let* ((t_1 (+ (* x x) (* (* y 4.0) (- t (* z z)))))) (if (<= t_1 INFINITY) t_1 (* z (* z (* y 4.0))))))
double code(double x, double y, double z, double t) {
double t_1 = (x * x) + ((y * 4.0) * (t - (z * z)));
double tmp;
if (t_1 <= ((double) INFINITY)) {
tmp = t_1;
} else {
tmp = z * (z * (y * 4.0));
}
return tmp;
}
public static double code(double x, double y, double z, double t) {
double t_1 = (x * x) + ((y * 4.0) * (t - (z * z)));
double tmp;
if (t_1 <= Double.POSITIVE_INFINITY) {
tmp = t_1;
} else {
tmp = z * (z * (y * 4.0));
}
return tmp;
}
def code(x, y, z, t): t_1 = (x * x) + ((y * 4.0) * (t - (z * z))) tmp = 0 if t_1 <= math.inf: tmp = t_1 else: tmp = z * (z * (y * 4.0)) return tmp
function code(x, y, z, t) t_1 = Float64(Float64(x * x) + Float64(Float64(y * 4.0) * Float64(t - Float64(z * z)))) tmp = 0.0 if (t_1 <= Inf) tmp = t_1; else tmp = Float64(z * Float64(z * Float64(y * 4.0))); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = (x * x) + ((y * 4.0) * (t - (z * z))); tmp = 0.0; if (t_1 <= Inf) tmp = t_1; else tmp = z * (z * (y * 4.0)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(x * x), $MachinePrecision] + N[(N[(y * 4.0), $MachinePrecision] * N[(t - N[(z * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, Infinity], t$95$1, N[(z * N[(z * N[(y * 4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot x + \left(y \cdot 4\right) \cdot \left(t - z \cdot z\right)\\
\mathbf{if}\;t\_1 \leq \infty:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;z \cdot \left(z \cdot \left(y \cdot 4\right)\right)\\
\end{array}
\end{array}
if (-.f64 (*.f64 x x) (*.f64 (*.f64 y 4) (-.f64 (*.f64 z z) t))) < +inf.0Initial program 95.8%
if +inf.0 < (-.f64 (*.f64 x x) (*.f64 (*.f64 y 4) (-.f64 (*.f64 z z) t))) Initial program 0.0%
Taylor expanded in z around inf 44.6%
*-commutative44.6%
associate-*l*44.6%
Simplified44.6%
add-cube-cbrt44.6%
pow344.6%
*-commutative44.6%
associate-*l*44.6%
Applied egg-rr44.6%
rem-cube-cbrt44.6%
*-commutative44.6%
unpow244.6%
associate-*r*44.6%
add-sqr-sqrt0.2%
sqrt-unprod44.6%
*-commutative44.6%
*-commutative44.6%
swap-sqr44.6%
metadata-eval44.6%
metadata-eval44.6%
swap-sqr44.6%
sqrt-unprod44.4%
add-sqr-sqrt44.6%
Applied egg-rr44.6%
Final simplification94.0%
(FPCore (x y z t) :precision binary64 (- (* x x) (* y (* t -4.0))))
double code(double x, double y, double z, double t) {
return (x * x) - (y * (t * -4.0));
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = (x * x) - (y * (t * (-4.0d0)))
end function
public static double code(double x, double y, double z, double t) {
return (x * x) - (y * (t * -4.0));
}
def code(x, y, z, t): return (x * x) - (y * (t * -4.0))
function code(x, y, z, t) return Float64(Float64(x * x) - Float64(y * Float64(t * -4.0))) end
function tmp = code(x, y, z, t) tmp = (x * x) - (y * (t * -4.0)); end
code[x_, y_, z_, t_] := N[(N[(x * x), $MachinePrecision] - N[(y * N[(t * -4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x \cdot x - y \cdot \left(t \cdot -4\right)
\end{array}
Initial program 92.4%
Taylor expanded in z around 0 70.4%
*-commutative70.4%
*-commutative70.4%
associate-*l*70.4%
Simplified70.4%
Final simplification70.4%
(FPCore (x y z t) :precision binary64 (* 4.0 (* y t)))
double code(double x, double y, double z, double t) {
return 4.0 * (y * 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 = 4.0d0 * (y * t)
end function
public static double code(double x, double y, double z, double t) {
return 4.0 * (y * t);
}
def code(x, y, z, t): return 4.0 * (y * t)
function code(x, y, z, t) return Float64(4.0 * Float64(y * t)) end
function tmp = code(x, y, z, t) tmp = 4.0 * (y * t); end
code[x_, y_, z_, t_] := N[(4.0 * N[(y * t), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
4 \cdot \left(y \cdot t\right)
\end{array}
Initial program 92.4%
Taylor expanded in t around inf 33.3%
*-commutative33.3%
Simplified33.3%
Final simplification33.3%
(FPCore (x y z t) :precision binary64 -1.0)
double code(double x, double y, double z, double t) {
return -1.0;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = -1.0d0
end function
public static double code(double x, double y, double z, double t) {
return -1.0;
}
def code(x, y, z, t): return -1.0
function code(x, y, z, t) return -1.0 end
function tmp = code(x, y, z, t) tmp = -1.0; end
code[x_, y_, z_, t_] := -1.0
\begin{array}{l}
\\
-1
\end{array}
Initial program 92.4%
Taylor expanded in z around 0 70.4%
*-commutative70.4%
*-commutative70.4%
associate-*l*70.4%
Simplified70.4%
associate-*r*70.4%
cancel-sign-sub-inv70.4%
distribute-lft-neg-in70.4%
distribute-rgt-neg-in70.4%
metadata-eval70.4%
*-commutative70.4%
add-sqr-sqrt40.3%
sqrt-unprod51.9%
*-commutative51.9%
*-commutative51.9%
swap-sqr51.9%
metadata-eval51.9%
metadata-eval51.9%
swap-sqr51.9%
associate-*r*51.9%
associate-*r*51.9%
sqrt-unprod21.0%
add-sqr-sqrt40.1%
expm1-log1p-u38.5%
fma-define38.5%
add-sqr-sqrt20.4%
Applied egg-rr56.7%
Taylor expanded in x around inf 17.3%
log-rec17.3%
Simplified17.3%
Taylor expanded in x around 0 2.2%
Final simplification2.2%
(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 2024034
(FPCore (x y z t)
:name "Graphics.Rasterific.Shading:$sradialGradientWithFocusShader from Rasterific-0.6.1, B"
:precision binary64
:herbie-target
(- (* x x) (* 4.0 (* y (- (* z z) t))))
(- (* x x) (* (* y 4.0) (- (* z z) t))))