
(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}
NOTE: z should be positive before calling this function (FPCore (x y z t) :precision binary64 (if (<= z 1.26e+169) (fma x x (* (- (* z z) t) (* y -4.0))) (- (* x x) (* z (* z (* y 4.0))))))
z = abs(z);
double code(double x, double y, double z, double t) {
double tmp;
if (z <= 1.26e+169) {
tmp = fma(x, x, (((z * z) - t) * (y * -4.0)));
} else {
tmp = (x * x) - (z * (z * (y * 4.0)));
}
return tmp;
}
z = abs(z) function code(x, y, z, t) tmp = 0.0 if (z <= 1.26e+169) tmp = fma(x, x, Float64(Float64(Float64(z * z) - t) * Float64(y * -4.0))); else tmp = Float64(Float64(x * x) - Float64(z * Float64(z * Float64(y * 4.0)))); end return tmp end
NOTE: z should be positive before calling this function code[x_, y_, z_, t_] := If[LessEqual[z, 1.26e+169], N[(x * x + N[(N[(N[(z * z), $MachinePrecision] - t), $MachinePrecision] * N[(y * -4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x * x), $MachinePrecision] - N[(z * N[(z * N[(y * 4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
z = |z|\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq 1.26 \cdot 10^{+169}:\\
\;\;\;\;\mathsf{fma}\left(x, x, \left(z \cdot z - t\right) \cdot \left(y \cdot -4\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot x - z \cdot \left(z \cdot \left(y \cdot 4\right)\right)\\
\end{array}
\end{array}
if z < 1.2599999999999999e169Initial program 92.4%
fma-neg95.6%
distribute-lft-neg-in95.6%
*-commutative95.6%
distribute-rgt-neg-in95.6%
metadata-eval95.6%
Simplified95.6%
if 1.2599999999999999e169 < z Initial program 64.9%
fma-neg64.9%
Applied egg-rr64.9%
Applied egg-rr64.9%
Taylor expanded in z around inf 64.9%
associate-/r/64.9%
/-rgt-identity64.9%
pow264.9%
associate-*r*90.8%
Applied egg-rr90.8%
Final simplification95.0%
NOTE: z should be positive before calling this function
(FPCore (x y z t)
:precision binary64
(if (or (<= (* z z) 30000000000000.0)
(and (not (<= (* z z) 3.6e+41)) (<= (* z z) 1.3e+131)))
(- (* x x) (* y (* t -4.0)))
(- (* x x) (* (* z z) (* y 4.0)))))z = abs(z);
double code(double x, double y, double z, double t) {
double tmp;
if (((z * z) <= 30000000000000.0) || (!((z * z) <= 3.6e+41) && ((z * z) <= 1.3e+131))) {
tmp = (x * x) - (y * (t * -4.0));
} else {
tmp = (x * x) - ((z * z) * (y * 4.0));
}
return tmp;
}
NOTE: z should be positive before calling this function
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 (((z * z) <= 30000000000000.0d0) .or. (.not. ((z * z) <= 3.6d+41)) .and. ((z * z) <= 1.3d+131)) then
tmp = (x * x) - (y * (t * (-4.0d0)))
else
tmp = (x * x) - ((z * z) * (y * 4.0d0))
end if
code = tmp
end function
z = Math.abs(z);
public static double code(double x, double y, double z, double t) {
double tmp;
if (((z * z) <= 30000000000000.0) || (!((z * z) <= 3.6e+41) && ((z * z) <= 1.3e+131))) {
tmp = (x * x) - (y * (t * -4.0));
} else {
tmp = (x * x) - ((z * z) * (y * 4.0));
}
return tmp;
}
z = abs(z) def code(x, y, z, t): tmp = 0 if ((z * z) <= 30000000000000.0) or (not ((z * z) <= 3.6e+41) and ((z * z) <= 1.3e+131)): tmp = (x * x) - (y * (t * -4.0)) else: tmp = (x * x) - ((z * z) * (y * 4.0)) return tmp
z = abs(z) function code(x, y, z, t) tmp = 0.0 if ((Float64(z * z) <= 30000000000000.0) || (!(Float64(z * z) <= 3.6e+41) && (Float64(z * z) <= 1.3e+131))) tmp = Float64(Float64(x * x) - Float64(y * Float64(t * -4.0))); else tmp = Float64(Float64(x * x) - Float64(Float64(z * z) * Float64(y * 4.0))); end return tmp end
z = abs(z) function tmp_2 = code(x, y, z, t) tmp = 0.0; if (((z * z) <= 30000000000000.0) || (~(((z * z) <= 3.6e+41)) && ((z * z) <= 1.3e+131))) tmp = (x * x) - (y * (t * -4.0)); else tmp = (x * x) - ((z * z) * (y * 4.0)); end tmp_2 = tmp; end
NOTE: z should be positive before calling this function code[x_, y_, z_, t_] := If[Or[LessEqual[N[(z * z), $MachinePrecision], 30000000000000.0], And[N[Not[LessEqual[N[(z * z), $MachinePrecision], 3.6e+41]], $MachinePrecision], LessEqual[N[(z * z), $MachinePrecision], 1.3e+131]]], N[(N[(x * x), $MachinePrecision] - N[(y * N[(t * -4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x * x), $MachinePrecision] - N[(N[(z * z), $MachinePrecision] * N[(y * 4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
z = |z|\\
\\
\begin{array}{l}
\mathbf{if}\;z \cdot z \leq 30000000000000 \lor \neg \left(z \cdot z \leq 3.6 \cdot 10^{+41}\right) \land z \cdot z \leq 1.3 \cdot 10^{+131}:\\
\;\;\;\;x \cdot x - y \cdot \left(t \cdot -4\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot x - \left(z \cdot z\right) \cdot \left(y \cdot 4\right)\\
\end{array}
\end{array}
if (*.f64 z z) < 3e13 or 3.60000000000000025e41 < (*.f64 z z) < 1.3e131Initial program 100.0%
Taylor expanded in z around 0 93.6%
*-commutative93.6%
*-commutative93.6%
associate-*l*93.6%
Simplified93.6%
if 3e13 < (*.f64 z z) < 3.60000000000000025e41 or 1.3e131 < (*.f64 z z) Initial program 73.9%
add-cbrt-cube61.7%
pow361.7%
pow261.7%
Applied egg-rr61.7%
Taylor expanded in z around inf 60.9%
pow1/360.7%
pow-pow71.7%
metadata-eval71.7%
unpow271.7%
Applied egg-rr71.7%
Final simplification84.3%
NOTE: z should be positive before calling this function (FPCore (x y z t) :precision binary64 (if (or (<= (* z z) 1e-7) (and (not (<= (* z z) 1e+41)) (<= (* z z) 2e+131))) (- (* x x) (* y (* t -4.0))) (- (* x x) (* z (* z (* y 4.0))))))
z = abs(z);
double code(double x, double y, double z, double t) {
double tmp;
if (((z * z) <= 1e-7) || (!((z * z) <= 1e+41) && ((z * z) <= 2e+131))) {
tmp = (x * x) - (y * (t * -4.0));
} else {
tmp = (x * x) - (z * (z * (y * 4.0)));
}
return tmp;
}
NOTE: z should be positive before calling this function
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 (((z * z) <= 1d-7) .or. (.not. ((z * z) <= 1d+41)) .and. ((z * z) <= 2d+131)) then
tmp = (x * x) - (y * (t * (-4.0d0)))
else
tmp = (x * x) - (z * (z * (y * 4.0d0)))
end if
code = tmp
end function
z = Math.abs(z);
public static double code(double x, double y, double z, double t) {
double tmp;
if (((z * z) <= 1e-7) || (!((z * z) <= 1e+41) && ((z * z) <= 2e+131))) {
tmp = (x * x) - (y * (t * -4.0));
} else {
tmp = (x * x) - (z * (z * (y * 4.0)));
}
return tmp;
}
z = abs(z) def code(x, y, z, t): tmp = 0 if ((z * z) <= 1e-7) or (not ((z * z) <= 1e+41) and ((z * z) <= 2e+131)): tmp = (x * x) - (y * (t * -4.0)) else: tmp = (x * x) - (z * (z * (y * 4.0))) return tmp
z = abs(z) function code(x, y, z, t) tmp = 0.0 if ((Float64(z * z) <= 1e-7) || (!(Float64(z * z) <= 1e+41) && (Float64(z * z) <= 2e+131))) tmp = Float64(Float64(x * x) - Float64(y * Float64(t * -4.0))); else tmp = Float64(Float64(x * x) - Float64(z * Float64(z * Float64(y * 4.0)))); end return tmp end
z = abs(z) function tmp_2 = code(x, y, z, t) tmp = 0.0; if (((z * z) <= 1e-7) || (~(((z * z) <= 1e+41)) && ((z * z) <= 2e+131))) tmp = (x * x) - (y * (t * -4.0)); else tmp = (x * x) - (z * (z * (y * 4.0))); end tmp_2 = tmp; end
NOTE: z should be positive before calling this function code[x_, y_, z_, t_] := If[Or[LessEqual[N[(z * z), $MachinePrecision], 1e-7], And[N[Not[LessEqual[N[(z * z), $MachinePrecision], 1e+41]], $MachinePrecision], LessEqual[N[(z * z), $MachinePrecision], 2e+131]]], N[(N[(x * x), $MachinePrecision] - N[(y * N[(t * -4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x * x), $MachinePrecision] - N[(z * N[(z * N[(y * 4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
z = |z|\\
\\
\begin{array}{l}
\mathbf{if}\;z \cdot z \leq 10^{-7} \lor \neg \left(z \cdot z \leq 10^{+41}\right) \land z \cdot z \leq 2 \cdot 10^{+131}:\\
\;\;\;\;x \cdot x - y \cdot \left(t \cdot -4\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot x - z \cdot \left(z \cdot \left(y \cdot 4\right)\right)\\
\end{array}
\end{array}
if (*.f64 z z) < 9.9999999999999995e-8 or 1.00000000000000001e41 < (*.f64 z z) < 1.9999999999999998e131Initial program 100.0%
Taylor expanded in z around 0 93.6%
*-commutative93.6%
*-commutative93.6%
associate-*l*93.6%
Simplified93.6%
if 9.9999999999999995e-8 < (*.f64 z z) < 1.00000000000000001e41 or 1.9999999999999998e131 < (*.f64 z z) Initial program 73.9%
fma-neg73.9%
Applied egg-rr73.9%
Applied egg-rr70.6%
Taylor expanded in z around inf 71.7%
associate-/r/71.7%
/-rgt-identity71.7%
pow271.7%
associate-*r*84.8%
Applied egg-rr84.8%
Final simplification89.9%
NOTE: z should be positive before calling this function (FPCore (x y z t) :precision binary64 (if (<= z 1.2e+115) (+ (* x x) (* (* y 4.0) (- t (* z z)))) (- (* x x) (* z (* z (* y 4.0))))))
z = abs(z);
double code(double x, double y, double z, double t) {
double tmp;
if (z <= 1.2e+115) {
tmp = (x * x) + ((y * 4.0) * (t - (z * z)));
} else {
tmp = (x * x) - (z * (z * (y * 4.0)));
}
return tmp;
}
NOTE: z should be positive before calling this function
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 (z <= 1.2d+115) then
tmp = (x * x) + ((y * 4.0d0) * (t - (z * z)))
else
tmp = (x * x) - (z * (z * (y * 4.0d0)))
end if
code = tmp
end function
z = Math.abs(z);
public static double code(double x, double y, double z, double t) {
double tmp;
if (z <= 1.2e+115) {
tmp = (x * x) + ((y * 4.0) * (t - (z * z)));
} else {
tmp = (x * x) - (z * (z * (y * 4.0)));
}
return tmp;
}
z = abs(z) def code(x, y, z, t): tmp = 0 if z <= 1.2e+115: tmp = (x * x) + ((y * 4.0) * (t - (z * z))) else: tmp = (x * x) - (z * (z * (y * 4.0))) return tmp
z = abs(z) function code(x, y, z, t) tmp = 0.0 if (z <= 1.2e+115) tmp = Float64(Float64(x * x) + Float64(Float64(y * 4.0) * Float64(t - Float64(z * z)))); else tmp = Float64(Float64(x * x) - Float64(z * Float64(z * Float64(y * 4.0)))); end return tmp end
z = abs(z) function tmp_2 = code(x, y, z, t) tmp = 0.0; if (z <= 1.2e+115) tmp = (x * x) + ((y * 4.0) * (t - (z * z))); else tmp = (x * x) - (z * (z * (y * 4.0))); end tmp_2 = tmp; end
NOTE: z should be positive before calling this function code[x_, y_, z_, t_] := If[LessEqual[z, 1.2e+115], N[(N[(x * x), $MachinePrecision] + N[(N[(y * 4.0), $MachinePrecision] * N[(t - N[(z * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x * x), $MachinePrecision] - N[(z * N[(z * N[(y * 4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
z = |z|\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq 1.2 \cdot 10^{+115}:\\
\;\;\;\;x \cdot x + \left(y \cdot 4\right) \cdot \left(t - z \cdot z\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot x - z \cdot \left(z \cdot \left(y \cdot 4\right)\right)\\
\end{array}
\end{array}
if z < 1.2e115Initial program 94.2%
if 1.2e115 < z Initial program 66.9%
fma-neg66.9%
Applied egg-rr66.9%
Applied egg-rr66.9%
Taylor expanded in z around inf 66.9%
associate-/r/66.9%
/-rgt-identity66.9%
pow266.9%
associate-*r*85.9%
Applied egg-rr85.9%
Final simplification92.6%
NOTE: z should be positive before calling this function (FPCore (x y z t) :precision binary64 (- (* x x) (* y (* t -4.0))))
z = abs(z);
double code(double x, double y, double z, double t) {
return (x * x) - (y * (t * -4.0));
}
NOTE: z should be positive before calling this function
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
z = Math.abs(z);
public static double code(double x, double y, double z, double t) {
return (x * x) - (y * (t * -4.0));
}
z = abs(z) def code(x, y, z, t): return (x * x) - (y * (t * -4.0))
z = abs(z) function code(x, y, z, t) return Float64(Float64(x * x) - Float64(y * Float64(t * -4.0))) end
z = abs(z) function tmp = code(x, y, z, t) tmp = (x * x) - (y * (t * -4.0)); end
NOTE: z should be positive before calling this function code[x_, y_, z_, t_] := N[(N[(x * x), $MachinePrecision] - N[(y * N[(t * -4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
z = |z|\\
\\
x \cdot x - y \cdot \left(t \cdot -4\right)
\end{array}
Initial program 88.9%
Taylor expanded in z around 0 65.1%
*-commutative65.1%
*-commutative65.1%
associate-*l*65.1%
Simplified65.1%
Final simplification65.1%
NOTE: z should be positive before calling this function (FPCore (x y z t) :precision binary64 (if (<= z 5.7e+137) (* y (* t 4.0)) (* y (* t -4.0))))
z = abs(z);
double code(double x, double y, double z, double t) {
double tmp;
if (z <= 5.7e+137) {
tmp = y * (t * 4.0);
} else {
tmp = y * (t * -4.0);
}
return tmp;
}
NOTE: z should be positive before calling this function
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 (z <= 5.7d+137) then
tmp = y * (t * 4.0d0)
else
tmp = y * (t * (-4.0d0))
end if
code = tmp
end function
z = Math.abs(z);
public static double code(double x, double y, double z, double t) {
double tmp;
if (z <= 5.7e+137) {
tmp = y * (t * 4.0);
} else {
tmp = y * (t * -4.0);
}
return tmp;
}
z = abs(z) def code(x, y, z, t): tmp = 0 if z <= 5.7e+137: tmp = y * (t * 4.0) else: tmp = y * (t * -4.0) return tmp
z = abs(z) function code(x, y, z, t) tmp = 0.0 if (z <= 5.7e+137) tmp = Float64(y * Float64(t * 4.0)); else tmp = Float64(y * Float64(t * -4.0)); end return tmp end
z = abs(z) function tmp_2 = code(x, y, z, t) tmp = 0.0; if (z <= 5.7e+137) tmp = y * (t * 4.0); else tmp = y * (t * -4.0); end tmp_2 = tmp; end
NOTE: z should be positive before calling this function code[x_, y_, z_, t_] := If[LessEqual[z, 5.7e+137], N[(y * N[(t * 4.0), $MachinePrecision]), $MachinePrecision], N[(y * N[(t * -4.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
z = |z|\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq 5.7 \cdot 10^{+137}:\\
\;\;\;\;y \cdot \left(t \cdot 4\right)\\
\mathbf{else}:\\
\;\;\;\;y \cdot \left(t \cdot -4\right)\\
\end{array}
\end{array}
if z < 5.6999999999999999e137Initial program 94.0%
Taylor expanded in z around 0 73.9%
*-commutative73.9%
*-commutative73.9%
associate-*l*73.9%
Simplified73.9%
Taylor expanded in x around 0 44.3%
*-commutative44.3%
*-commutative44.3%
associate-*r*44.3%
*-commutative44.3%
Simplified44.3%
if 5.6999999999999999e137 < z Initial program 63.0%
fma-neg63.0%
Applied egg-rr63.0%
Applied egg-rr63.0%
Taylor expanded in t around inf 16.0%
associate-*r*16.0%
*-commutative16.0%
*-commutative16.0%
Simplified16.0%
Final simplification39.7%
NOTE: z should be positive before calling this function (FPCore (x y z t) :precision binary64 (* 4.0 (* t y)))
z = abs(z);
double code(double x, double y, double z, double t) {
return 4.0 * (t * y);
}
NOTE: z should be positive before calling this function
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 * (t * y)
end function
z = Math.abs(z);
public static double code(double x, double y, double z, double t) {
return 4.0 * (t * y);
}
z = abs(z) def code(x, y, z, t): return 4.0 * (t * y)
z = abs(z) function code(x, y, z, t) return Float64(4.0 * Float64(t * y)) end
z = abs(z) function tmp = code(x, y, z, t) tmp = 4.0 * (t * y); end
NOTE: z should be positive before calling this function code[x_, y_, z_, t_] := N[(4.0 * N[(t * y), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
z = |z|\\
\\
4 \cdot \left(t \cdot y\right)
\end{array}
Initial program 88.9%
Taylor expanded in t around inf 37.8%
*-commutative37.8%
Simplified37.8%
Final simplification37.8%
NOTE: z should be positive before calling this function (FPCore (x y z t) :precision binary64 (* y (* t 4.0)))
z = abs(z);
double code(double x, double y, double z, double t) {
return y * (t * 4.0);
}
NOTE: z should be positive before calling this function
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 = y * (t * 4.0d0)
end function
z = Math.abs(z);
public static double code(double x, double y, double z, double t) {
return y * (t * 4.0);
}
z = abs(z) def code(x, y, z, t): return y * (t * 4.0)
z = abs(z) function code(x, y, z, t) return Float64(y * Float64(t * 4.0)) end
z = abs(z) function tmp = code(x, y, z, t) tmp = y * (t * 4.0); end
NOTE: z should be positive before calling this function code[x_, y_, z_, t_] := N[(y * N[(t * 4.0), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
z = |z|\\
\\
y \cdot \left(t \cdot 4\right)
\end{array}
Initial program 88.9%
Taylor expanded in z around 0 65.1%
*-commutative65.1%
*-commutative65.1%
associate-*l*65.1%
Simplified65.1%
Taylor expanded in x around 0 37.8%
*-commutative37.8%
*-commutative37.8%
associate-*r*37.8%
*-commutative37.8%
Simplified37.8%
Final simplification37.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 2023311
(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))))