
(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 7 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}
x_m = (fabs.f64 x) (FPCore (x_m y z t) :precision binary64 (if (<= x_m 4e+203) (fma x_m x_m (* (- (* z z) t) (* y -4.0))) (* x_m x_m)))
x_m = fabs(x);
double code(double x_m, double y, double z, double t) {
double tmp;
if (x_m <= 4e+203) {
tmp = fma(x_m, x_m, (((z * z) - t) * (y * -4.0)));
} else {
tmp = x_m * x_m;
}
return tmp;
}
x_m = abs(x) function code(x_m, y, z, t) tmp = 0.0 if (x_m <= 4e+203) tmp = fma(x_m, x_m, Float64(Float64(Float64(z * z) - t) * Float64(y * -4.0))); else tmp = Float64(x_m * x_m); end return tmp end
x_m = N[Abs[x], $MachinePrecision] code[x$95$m_, y_, z_, t_] := If[LessEqual[x$95$m, 4e+203], N[(x$95$m * x$95$m + N[(N[(N[(z * z), $MachinePrecision] - t), $MachinePrecision] * N[(y * -4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x$95$m * x$95$m), $MachinePrecision]]
\begin{array}{l}
x_m = \left|x\right|
\\
\begin{array}{l}
\mathbf{if}\;x\_m \leq 4 \cdot 10^{+203}:\\
\;\;\;\;\mathsf{fma}\left(x\_m, x\_m, \left(z \cdot z - t\right) \cdot \left(y \cdot -4\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x\_m \cdot x\_m\\
\end{array}
\end{array}
if x < 4e203Initial program 91.7%
fma-neg93.9%
distribute-lft-neg-in93.9%
*-commutative93.9%
distribute-rgt-neg-in93.9%
metadata-eval93.9%
Simplified93.9%
if 4e203 < x Initial program 94.7%
Taylor expanded in x around inf 100.0%
pow2100.0%
Applied egg-rr100.0%
Final simplification94.3%
x_m = (fabs.f64 x)
(FPCore (x_m y z t)
:precision binary64
(let* ((t_1 (* 4.0 (* t y))))
(if (<= z 6e-171)
(* x_m x_m)
(if (<= z 5.8e-71)
t_1
(if (<= z 6.6e-32)
(* x_m x_m)
(if (<= z 2.9e+15) t_1 (* z (* z (* y -4.0)))))))))x_m = fabs(x);
double code(double x_m, double y, double z, double t) {
double t_1 = 4.0 * (t * y);
double tmp;
if (z <= 6e-171) {
tmp = x_m * x_m;
} else if (z <= 5.8e-71) {
tmp = t_1;
} else if (z <= 6.6e-32) {
tmp = x_m * x_m;
} else if (z <= 2.9e+15) {
tmp = t_1;
} else {
tmp = z * (z * (y * -4.0));
}
return tmp;
}
x_m = abs(x)
real(8) function code(x_m, y, z, t)
real(8), intent (in) :: x_m
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 <= 6d-171) then
tmp = x_m * x_m
else if (z <= 5.8d-71) then
tmp = t_1
else if (z <= 6.6d-32) then
tmp = x_m * x_m
else if (z <= 2.9d+15) then
tmp = t_1
else
tmp = z * (z * (y * (-4.0d0)))
end if
code = tmp
end function
x_m = Math.abs(x);
public static double code(double x_m, double y, double z, double t) {
double t_1 = 4.0 * (t * y);
double tmp;
if (z <= 6e-171) {
tmp = x_m * x_m;
} else if (z <= 5.8e-71) {
tmp = t_1;
} else if (z <= 6.6e-32) {
tmp = x_m * x_m;
} else if (z <= 2.9e+15) {
tmp = t_1;
} else {
tmp = z * (z * (y * -4.0));
}
return tmp;
}
x_m = math.fabs(x) def code(x_m, y, z, t): t_1 = 4.0 * (t * y) tmp = 0 if z <= 6e-171: tmp = x_m * x_m elif z <= 5.8e-71: tmp = t_1 elif z <= 6.6e-32: tmp = x_m * x_m elif z <= 2.9e+15: tmp = t_1 else: tmp = z * (z * (y * -4.0)) return tmp
x_m = abs(x) function code(x_m, y, z, t) t_1 = Float64(4.0 * Float64(t * y)) tmp = 0.0 if (z <= 6e-171) tmp = Float64(x_m * x_m); elseif (z <= 5.8e-71) tmp = t_1; elseif (z <= 6.6e-32) tmp = Float64(x_m * x_m); elseif (z <= 2.9e+15) tmp = t_1; else tmp = Float64(z * Float64(z * Float64(y * -4.0))); end return tmp end
x_m = abs(x); function tmp_2 = code(x_m, y, z, t) t_1 = 4.0 * (t * y); tmp = 0.0; if (z <= 6e-171) tmp = x_m * x_m; elseif (z <= 5.8e-71) tmp = t_1; elseif (z <= 6.6e-32) tmp = x_m * x_m; elseif (z <= 2.9e+15) tmp = t_1; else tmp = z * (z * (y * -4.0)); end tmp_2 = tmp; end
x_m = N[Abs[x], $MachinePrecision]
code[x$95$m_, y_, z_, t_] := Block[{t$95$1 = N[(4.0 * N[(t * y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, 6e-171], N[(x$95$m * x$95$m), $MachinePrecision], If[LessEqual[z, 5.8e-71], t$95$1, If[LessEqual[z, 6.6e-32], N[(x$95$m * x$95$m), $MachinePrecision], If[LessEqual[z, 2.9e+15], t$95$1, N[(z * N[(z * N[(y * -4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
x_m = \left|x\right|
\\
\begin{array}{l}
t_1 := 4 \cdot \left(t \cdot y\right)\\
\mathbf{if}\;z \leq 6 \cdot 10^{-171}:\\
\;\;\;\;x\_m \cdot x\_m\\
\mathbf{elif}\;z \leq 5.8 \cdot 10^{-71}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 6.6 \cdot 10^{-32}:\\
\;\;\;\;x\_m \cdot x\_m\\
\mathbf{elif}\;z \leq 2.9 \cdot 10^{+15}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;z \cdot \left(z \cdot \left(y \cdot -4\right)\right)\\
\end{array}
\end{array}
if z < 5.9999999999999999e-171 or 5.7999999999999997e-71 < z < 6.60000000000000051e-32Initial program 94.3%
Taylor expanded in x around inf 44.1%
pow244.1%
Applied egg-rr44.1%
if 5.9999999999999999e-171 < z < 5.7999999999999997e-71 or 6.60000000000000051e-32 < z < 2.9e15Initial program 99.8%
Taylor expanded in t around inf 62.4%
*-commutative62.4%
Simplified62.4%
if 2.9e15 < z Initial program 80.1%
Taylor expanded in z around inf 65.4%
associate-*r*65.4%
Simplified65.4%
add-cube-cbrt65.2%
pow365.1%
associate-*l*65.1%
Applied egg-rr65.1%
rem-cube-cbrt65.4%
associate-*r*65.4%
metadata-eval65.4%
distribute-lft-neg-in65.4%
*-commutative65.4%
unpow265.4%
associate-*r*63.6%
distribute-rgt-neg-in63.6%
metadata-eval63.6%
Applied egg-rr63.6%
Final simplification49.0%
x_m = (fabs.f64 x) (FPCore (x_m y z t) :precision binary64 (if (<= z 1.7e+141) (+ (* x_m x_m) (* (* y 4.0) (- t (* z z)))) (* z (* z (* y -4.0)))))
x_m = fabs(x);
double code(double x_m, double y, double z, double t) {
double tmp;
if (z <= 1.7e+141) {
tmp = (x_m * x_m) + ((y * 4.0) * (t - (z * z)));
} else {
tmp = z * (z * (y * -4.0));
}
return tmp;
}
x_m = abs(x)
real(8) function code(x_m, y, z, t)
real(8), intent (in) :: x_m
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (z <= 1.7d+141) then
tmp = (x_m * x_m) + ((y * 4.0d0) * (t - (z * z)))
else
tmp = z * (z * (y * (-4.0d0)))
end if
code = tmp
end function
x_m = Math.abs(x);
public static double code(double x_m, double y, double z, double t) {
double tmp;
if (z <= 1.7e+141) {
tmp = (x_m * x_m) + ((y * 4.0) * (t - (z * z)));
} else {
tmp = z * (z * (y * -4.0));
}
return tmp;
}
x_m = math.fabs(x) def code(x_m, y, z, t): tmp = 0 if z <= 1.7e+141: tmp = (x_m * x_m) + ((y * 4.0) * (t - (z * z))) else: tmp = z * (z * (y * -4.0)) return tmp
x_m = abs(x) function code(x_m, y, z, t) tmp = 0.0 if (z <= 1.7e+141) tmp = Float64(Float64(x_m * x_m) + Float64(Float64(y * 4.0) * Float64(t - Float64(z * z)))); else tmp = Float64(z * Float64(z * Float64(y * -4.0))); end return tmp end
x_m = abs(x); function tmp_2 = code(x_m, y, z, t) tmp = 0.0; if (z <= 1.7e+141) tmp = (x_m * x_m) + ((y * 4.0) * (t - (z * z))); else tmp = z * (z * (y * -4.0)); end tmp_2 = tmp; end
x_m = N[Abs[x], $MachinePrecision] code[x$95$m_, y_, z_, t_] := If[LessEqual[z, 1.7e+141], N[(N[(x$95$m * x$95$m), $MachinePrecision] + N[(N[(y * 4.0), $MachinePrecision] * N[(t - N[(z * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(z * N[(z * N[(y * -4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
x_m = \left|x\right|
\\
\begin{array}{l}
\mathbf{if}\;z \leq 1.7 \cdot 10^{+141}:\\
\;\;\;\;x\_m \cdot x\_m + \left(y \cdot 4\right) \cdot \left(t - z \cdot z\right)\\
\mathbf{else}:\\
\;\;\;\;z \cdot \left(z \cdot \left(y \cdot -4\right)\right)\\
\end{array}
\end{array}
if z < 1.6999999999999999e141Initial program 95.2%
if 1.6999999999999999e141 < z Initial program 69.6%
Taylor expanded in z around inf 75.9%
associate-*r*75.9%
Simplified75.9%
add-cube-cbrt75.8%
pow375.8%
associate-*l*75.8%
Applied egg-rr75.8%
rem-cube-cbrt75.9%
associate-*r*75.9%
metadata-eval75.9%
distribute-lft-neg-in75.9%
*-commutative75.9%
unpow275.9%
associate-*r*73.1%
distribute-rgt-neg-in73.1%
metadata-eval73.1%
Applied egg-rr73.1%
Final simplification92.4%
x_m = (fabs.f64 x) (FPCore (x_m y z t) :precision binary64 (if (<= z 9.5e+15) (- (* x_m x_m) (* y (* t -4.0))) (* z (* z (* y -4.0)))))
x_m = fabs(x);
double code(double x_m, double y, double z, double t) {
double tmp;
if (z <= 9.5e+15) {
tmp = (x_m * x_m) - (y * (t * -4.0));
} else {
tmp = z * (z * (y * -4.0));
}
return tmp;
}
x_m = abs(x)
real(8) function code(x_m, y, z, t)
real(8), intent (in) :: x_m
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (z <= 9.5d+15) then
tmp = (x_m * x_m) - (y * (t * (-4.0d0)))
else
tmp = z * (z * (y * (-4.0d0)))
end if
code = tmp
end function
x_m = Math.abs(x);
public static double code(double x_m, double y, double z, double t) {
double tmp;
if (z <= 9.5e+15) {
tmp = (x_m * x_m) - (y * (t * -4.0));
} else {
tmp = z * (z * (y * -4.0));
}
return tmp;
}
x_m = math.fabs(x) def code(x_m, y, z, t): tmp = 0 if z <= 9.5e+15: tmp = (x_m * x_m) - (y * (t * -4.0)) else: tmp = z * (z * (y * -4.0)) return tmp
x_m = abs(x) function code(x_m, y, z, t) tmp = 0.0 if (z <= 9.5e+15) tmp = Float64(Float64(x_m * x_m) - Float64(y * Float64(t * -4.0))); else tmp = Float64(z * Float64(z * Float64(y * -4.0))); end return tmp end
x_m = abs(x); function tmp_2 = code(x_m, y, z, t) tmp = 0.0; if (z <= 9.5e+15) tmp = (x_m * x_m) - (y * (t * -4.0)); else tmp = z * (z * (y * -4.0)); end tmp_2 = tmp; end
x_m = N[Abs[x], $MachinePrecision] code[x$95$m_, y_, z_, t_] := If[LessEqual[z, 9.5e+15], N[(N[(x$95$m * x$95$m), $MachinePrecision] - N[(y * N[(t * -4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(z * N[(z * N[(y * -4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
x_m = \left|x\right|
\\
\begin{array}{l}
\mathbf{if}\;z \leq 9.5 \cdot 10^{+15}:\\
\;\;\;\;x\_m \cdot x\_m - y \cdot \left(t \cdot -4\right)\\
\mathbf{else}:\\
\;\;\;\;z \cdot \left(z \cdot \left(y \cdot -4\right)\right)\\
\end{array}
\end{array}
if z < 9.5e15Initial program 94.8%
Taylor expanded in z around 0 71.5%
*-commutative71.5%
*-commutative71.5%
associate-*l*71.5%
Simplified71.5%
if 9.5e15 < z Initial program 80.1%
Taylor expanded in z around inf 65.4%
associate-*r*65.4%
Simplified65.4%
add-cube-cbrt65.2%
pow365.1%
associate-*l*65.1%
Applied egg-rr65.1%
rem-cube-cbrt65.4%
associate-*r*65.4%
metadata-eval65.4%
distribute-lft-neg-in65.4%
*-commutative65.4%
unpow265.4%
associate-*r*63.6%
distribute-rgt-neg-in63.6%
metadata-eval63.6%
Applied egg-rr63.6%
Final simplification70.0%
x_m = (fabs.f64 x) (FPCore (x_m y z t) :precision binary64 (if (<= (* x_m x_m) 5.5e-78) (* 4.0 (* t y)) (* x_m x_m)))
x_m = fabs(x);
double code(double x_m, double y, double z, double t) {
double tmp;
if ((x_m * x_m) <= 5.5e-78) {
tmp = 4.0 * (t * y);
} else {
tmp = x_m * x_m;
}
return tmp;
}
x_m = abs(x)
real(8) function code(x_m, y, z, t)
real(8), intent (in) :: x_m
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if ((x_m * x_m) <= 5.5d-78) then
tmp = 4.0d0 * (t * y)
else
tmp = x_m * x_m
end if
code = tmp
end function
x_m = Math.abs(x);
public static double code(double x_m, double y, double z, double t) {
double tmp;
if ((x_m * x_m) <= 5.5e-78) {
tmp = 4.0 * (t * y);
} else {
tmp = x_m * x_m;
}
return tmp;
}
x_m = math.fabs(x) def code(x_m, y, z, t): tmp = 0 if (x_m * x_m) <= 5.5e-78: tmp = 4.0 * (t * y) else: tmp = x_m * x_m return tmp
x_m = abs(x) function code(x_m, y, z, t) tmp = 0.0 if (Float64(x_m * x_m) <= 5.5e-78) tmp = Float64(4.0 * Float64(t * y)); else tmp = Float64(x_m * x_m); end return tmp end
x_m = abs(x); function tmp_2 = code(x_m, y, z, t) tmp = 0.0; if ((x_m * x_m) <= 5.5e-78) tmp = 4.0 * (t * y); else tmp = x_m * x_m; end tmp_2 = tmp; end
x_m = N[Abs[x], $MachinePrecision] code[x$95$m_, y_, z_, t_] := If[LessEqual[N[(x$95$m * x$95$m), $MachinePrecision], 5.5e-78], N[(4.0 * N[(t * y), $MachinePrecision]), $MachinePrecision], N[(x$95$m * x$95$m), $MachinePrecision]]
\begin{array}{l}
x_m = \left|x\right|
\\
\begin{array}{l}
\mathbf{if}\;x\_m \cdot x\_m \leq 5.5 \cdot 10^{-78}:\\
\;\;\;\;4 \cdot \left(t \cdot y\right)\\
\mathbf{else}:\\
\;\;\;\;x\_m \cdot x\_m\\
\end{array}
\end{array}
if (*.f64 x x) < 5.50000000000000017e-78Initial program 94.5%
Taylor expanded in t around inf 49.6%
*-commutative49.6%
Simplified49.6%
if 5.50000000000000017e-78 < (*.f64 x x) Initial program 89.6%
Taylor expanded in x around inf 70.7%
pow270.8%
Applied egg-rr70.8%
Final simplification60.7%
x_m = (fabs.f64 x) (FPCore (x_m y z t) :precision binary64 (if (<= (* x_m x_m) 1.25e-80) (* y (* t 4.0)) (* x_m x_m)))
x_m = fabs(x);
double code(double x_m, double y, double z, double t) {
double tmp;
if ((x_m * x_m) <= 1.25e-80) {
tmp = y * (t * 4.0);
} else {
tmp = x_m * x_m;
}
return tmp;
}
x_m = abs(x)
real(8) function code(x_m, y, z, t)
real(8), intent (in) :: x_m
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if ((x_m * x_m) <= 1.25d-80) then
tmp = y * (t * 4.0d0)
else
tmp = x_m * x_m
end if
code = tmp
end function
x_m = Math.abs(x);
public static double code(double x_m, double y, double z, double t) {
double tmp;
if ((x_m * x_m) <= 1.25e-80) {
tmp = y * (t * 4.0);
} else {
tmp = x_m * x_m;
}
return tmp;
}
x_m = math.fabs(x) def code(x_m, y, z, t): tmp = 0 if (x_m * x_m) <= 1.25e-80: tmp = y * (t * 4.0) else: tmp = x_m * x_m return tmp
x_m = abs(x) function code(x_m, y, z, t) tmp = 0.0 if (Float64(x_m * x_m) <= 1.25e-80) tmp = Float64(y * Float64(t * 4.0)); else tmp = Float64(x_m * x_m); end return tmp end
x_m = abs(x); function tmp_2 = code(x_m, y, z, t) tmp = 0.0; if ((x_m * x_m) <= 1.25e-80) tmp = y * (t * 4.0); else tmp = x_m * x_m; end tmp_2 = tmp; end
x_m = N[Abs[x], $MachinePrecision] code[x$95$m_, y_, z_, t_] := If[LessEqual[N[(x$95$m * x$95$m), $MachinePrecision], 1.25e-80], N[(y * N[(t * 4.0), $MachinePrecision]), $MachinePrecision], N[(x$95$m * x$95$m), $MachinePrecision]]
\begin{array}{l}
x_m = \left|x\right|
\\
\begin{array}{l}
\mathbf{if}\;x\_m \cdot x\_m \leq 1.25 \cdot 10^{-80}:\\
\;\;\;\;y \cdot \left(t \cdot 4\right)\\
\mathbf{else}:\\
\;\;\;\;x\_m \cdot x\_m\\
\end{array}
\end{array}
if (*.f64 x x) < 1.25e-80Initial program 94.5%
Taylor expanded in t around inf 49.6%
associate-*r*49.6%
*-commutative49.6%
Simplified49.6%
if 1.25e-80 < (*.f64 x x) Initial program 89.6%
Taylor expanded in x around inf 70.7%
pow270.8%
Applied egg-rr70.8%
Final simplification60.7%
x_m = (fabs.f64 x) (FPCore (x_m y z t) :precision binary64 (* x_m x_m))
x_m = fabs(x);
double code(double x_m, double y, double z, double t) {
return x_m * x_m;
}
x_m = abs(x)
real(8) function code(x_m, y, z, t)
real(8), intent (in) :: x_m
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = x_m * x_m
end function
x_m = Math.abs(x);
public static double code(double x_m, double y, double z, double t) {
return x_m * x_m;
}
x_m = math.fabs(x) def code(x_m, y, z, t): return x_m * x_m
x_m = abs(x) function code(x_m, y, z, t) return Float64(x_m * x_m) end
x_m = abs(x); function tmp = code(x_m, y, z, t) tmp = x_m * x_m; end
x_m = N[Abs[x], $MachinePrecision] code[x$95$m_, y_, z_, t_] := N[(x$95$m * x$95$m), $MachinePrecision]
\begin{array}{l}
x_m = \left|x\right|
\\
x\_m \cdot x\_m
\end{array}
Initial program 92.0%
Taylor expanded in x around inf 41.5%
pow241.5%
Applied egg-rr41.5%
Final simplification41.5%
(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 2024040
(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))))