
(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) 5e+217) (fma (* y 4.0) (- t (* z z)) (* x x)) (- (* x x) (* (* z y) (* z 4.0)))))
double code(double x, double y, double z, double t) {
double tmp;
if ((z * z) <= 5e+217) {
tmp = fma((y * 4.0), (t - (z * z)), (x * x));
} else {
tmp = (x * x) - ((z * y) * (z * 4.0));
}
return tmp;
}
function code(x, y, z, t) tmp = 0.0 if (Float64(z * z) <= 5e+217) tmp = fma(Float64(y * 4.0), Float64(t - Float64(z * z)), Float64(x * x)); else tmp = Float64(Float64(x * x) - Float64(Float64(z * y) * Float64(z * 4.0))); end return tmp end
code[x_, y_, z_, t_] := If[LessEqual[N[(z * z), $MachinePrecision], 5e+217], N[(N[(y * 4.0), $MachinePrecision] * N[(t - N[(z * z), $MachinePrecision]), $MachinePrecision] + N[(x * x), $MachinePrecision]), $MachinePrecision], N[(N[(x * x), $MachinePrecision] - N[(N[(z * y), $MachinePrecision] * N[(z * 4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \cdot z \leq 5 \cdot 10^{+217}:\\
\;\;\;\;\mathsf{fma}\left(y \cdot 4, t - z \cdot z, x \cdot x\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot x - \left(z \cdot y\right) \cdot \left(z \cdot 4\right)\\
\end{array}
\end{array}
if (*.f64 z z) < 5.00000000000000041e217Initial program 96.4%
cancel-sign-sub-inv96.4%
distribute-lft-neg-out96.4%
+-commutative96.4%
associate-*l*96.4%
distribute-lft-neg-in96.4%
associate-*l*96.4%
distribute-rgt-neg-in96.4%
fma-define99.4%
sub-neg99.4%
+-commutative99.4%
distribute-neg-in99.4%
remove-double-neg99.4%
sub-neg99.4%
Simplified99.4%
if 5.00000000000000041e217 < (*.f64 z z) Initial program 74.5%
sub-neg74.5%
flip-+6.0%
pow26.0%
pow26.0%
pow-prod-up6.0%
metadata-eval6.0%
pow26.0%
Applied egg-rr6.0%
clear-num6.0%
un-div-inv6.0%
clear-num6.0%
metadata-eval6.0%
pow-prod-up6.0%
flip-+74.5%
unpow274.5%
fma-define74.5%
add-sqr-sqrt34.4%
sqrt-prod74.5%
sqr-neg74.5%
sqrt-prod40.1%
add-sqr-sqrt74.5%
Applied egg-rr74.5%
Taylor expanded in z around inf 74.5%
add-sqr-sqrt74.5%
times-frac74.5%
sqrt-div74.5%
metadata-eval74.5%
sqrt-pow144.7%
metadata-eval44.7%
pow144.7%
sqrt-div44.7%
metadata-eval44.7%
sqrt-pow196.4%
metadata-eval96.4%
pow196.4%
Applied egg-rr96.4%
associate-/r/96.4%
/-rgt-identity96.4%
associate-/r/96.4%
metadata-eval96.4%
Simplified96.4%
Final simplification98.4%
(FPCore (x y z t) :precision binary64 (if (<= (* z z) 5e+217) (fma x x (* (- (* z z) t) (* y -4.0))) (- (* x x) (* (* z y) (* z 4.0)))))
double code(double x, double y, double z, double t) {
double tmp;
if ((z * z) <= 5e+217) {
tmp = fma(x, x, (((z * z) - t) * (y * -4.0)));
} else {
tmp = (x * x) - ((z * y) * (z * 4.0));
}
return tmp;
}
function code(x, y, z, t) tmp = 0.0 if (Float64(z * z) <= 5e+217) tmp = fma(x, x, Float64(Float64(Float64(z * z) - t) * Float64(y * -4.0))); else tmp = Float64(Float64(x * x) - Float64(Float64(z * y) * Float64(z * 4.0))); end return tmp end
code[x_, y_, z_, t_] := If[LessEqual[N[(z * z), $MachinePrecision], 5e+217], N[(x * x + N[(N[(N[(z * z), $MachinePrecision] - t), $MachinePrecision] * N[(y * -4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x * x), $MachinePrecision] - N[(N[(z * y), $MachinePrecision] * N[(z * 4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \cdot z \leq 5 \cdot 10^{+217}:\\
\;\;\;\;\mathsf{fma}\left(x, x, \left(z \cdot z - t\right) \cdot \left(y \cdot -4\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot x - \left(z \cdot y\right) \cdot \left(z \cdot 4\right)\\
\end{array}
\end{array}
if (*.f64 z z) < 5.00000000000000041e217Initial program 96.4%
fma-neg97.0%
distribute-lft-neg-in97.0%
*-commutative97.0%
distribute-rgt-neg-in97.0%
metadata-eval97.0%
Simplified97.0%
if 5.00000000000000041e217 < (*.f64 z z) Initial program 74.5%
sub-neg74.5%
flip-+6.0%
pow26.0%
pow26.0%
pow-prod-up6.0%
metadata-eval6.0%
pow26.0%
Applied egg-rr6.0%
clear-num6.0%
un-div-inv6.0%
clear-num6.0%
metadata-eval6.0%
pow-prod-up6.0%
flip-+74.5%
unpow274.5%
fma-define74.5%
add-sqr-sqrt34.4%
sqrt-prod74.5%
sqr-neg74.5%
sqrt-prod40.1%
add-sqr-sqrt74.5%
Applied egg-rr74.5%
Taylor expanded in z around inf 74.5%
add-sqr-sqrt74.5%
times-frac74.5%
sqrt-div74.5%
metadata-eval74.5%
sqrt-pow144.7%
metadata-eval44.7%
pow144.7%
sqrt-div44.7%
metadata-eval44.7%
sqrt-pow196.4%
metadata-eval96.4%
pow196.4%
Applied egg-rr96.4%
associate-/r/96.4%
/-rgt-identity96.4%
associate-/r/96.4%
metadata-eval96.4%
Simplified96.4%
Final simplification96.8%
(FPCore (x y z t) :precision binary64 (if (<= (* z z) 5e+217) (+ (* x x) (* (* y 4.0) (- t (* z z)))) (- (* x x) (* (* z y) (* z 4.0)))))
double code(double x, double y, double z, double t) {
double tmp;
if ((z * z) <= 5e+217) {
tmp = (x * x) + ((y * 4.0) * (t - (z * z)));
} else {
tmp = (x * x) - ((z * y) * (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) :: tmp
if ((z * z) <= 5d+217) then
tmp = (x * x) + ((y * 4.0d0) * (t - (z * z)))
else
tmp = (x * x) - ((z * y) * (z * 4.0d0))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((z * z) <= 5e+217) {
tmp = (x * x) + ((y * 4.0) * (t - (z * z)));
} else {
tmp = (x * x) - ((z * y) * (z * 4.0));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (z * z) <= 5e+217: tmp = (x * x) + ((y * 4.0) * (t - (z * z))) else: tmp = (x * x) - ((z * y) * (z * 4.0)) return tmp
function code(x, y, z, t) tmp = 0.0 if (Float64(z * z) <= 5e+217) tmp = Float64(Float64(x * x) + Float64(Float64(y * 4.0) * Float64(t - Float64(z * z)))); else tmp = Float64(Float64(x * x) - Float64(Float64(z * y) * Float64(z * 4.0))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((z * z) <= 5e+217) tmp = (x * x) + ((y * 4.0) * (t - (z * z))); else tmp = (x * x) - ((z * y) * (z * 4.0)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[N[(z * z), $MachinePrecision], 5e+217], 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[(N[(z * y), $MachinePrecision] * N[(z * 4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \cdot z \leq 5 \cdot 10^{+217}:\\
\;\;\;\;x \cdot x + \left(y \cdot 4\right) \cdot \left(t - z \cdot z\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot x - \left(z \cdot y\right) \cdot \left(z \cdot 4\right)\\
\end{array}
\end{array}
if (*.f64 z z) < 5.00000000000000041e217Initial program 96.4%
if 5.00000000000000041e217 < (*.f64 z z) Initial program 74.5%
sub-neg74.5%
flip-+6.0%
pow26.0%
pow26.0%
pow-prod-up6.0%
metadata-eval6.0%
pow26.0%
Applied egg-rr6.0%
clear-num6.0%
un-div-inv6.0%
clear-num6.0%
metadata-eval6.0%
pow-prod-up6.0%
flip-+74.5%
unpow274.5%
fma-define74.5%
add-sqr-sqrt34.4%
sqrt-prod74.5%
sqr-neg74.5%
sqrt-prod40.1%
add-sqr-sqrt74.5%
Applied egg-rr74.5%
Taylor expanded in z around inf 74.5%
add-sqr-sqrt74.5%
times-frac74.5%
sqrt-div74.5%
metadata-eval74.5%
sqrt-pow144.7%
metadata-eval44.7%
pow144.7%
sqrt-div44.7%
metadata-eval44.7%
sqrt-pow196.4%
metadata-eval96.4%
pow196.4%
Applied egg-rr96.4%
associate-/r/96.4%
/-rgt-identity96.4%
associate-/r/96.4%
metadata-eval96.4%
Simplified96.4%
Final simplification96.4%
(FPCore (x y z t) :precision binary64 (if (<= z 2e+62) (- (* x x) (* -4.0 (* y t))) (- (* x x) (* (* z y) (* z 4.0)))))
double code(double x, double y, double z, double t) {
double tmp;
if (z <= 2e+62) {
tmp = (x * x) - (-4.0 * (y * t));
} else {
tmp = (x * x) - ((z * y) * (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) :: tmp
if (z <= 2d+62) then
tmp = (x * x) - ((-4.0d0) * (y * t))
else
tmp = (x * x) - ((z * y) * (z * 4.0d0))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (z <= 2e+62) {
tmp = (x * x) - (-4.0 * (y * t));
} else {
tmp = (x * x) - ((z * y) * (z * 4.0));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if z <= 2e+62: tmp = (x * x) - (-4.0 * (y * t)) else: tmp = (x * x) - ((z * y) * (z * 4.0)) return tmp
function code(x, y, z, t) tmp = 0.0 if (z <= 2e+62) tmp = Float64(Float64(x * x) - Float64(-4.0 * Float64(y * t))); else tmp = Float64(Float64(x * x) - Float64(Float64(z * y) * Float64(z * 4.0))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (z <= 2e+62) tmp = (x * x) - (-4.0 * (y * t)); else tmp = (x * x) - ((z * y) * (z * 4.0)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[z, 2e+62], N[(N[(x * x), $MachinePrecision] - N[(-4.0 * N[(y * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x * x), $MachinePrecision] - N[(N[(z * y), $MachinePrecision] * N[(z * 4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq 2 \cdot 10^{+62}:\\
\;\;\;\;x \cdot x - -4 \cdot \left(y \cdot t\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot x - \left(z \cdot y\right) \cdot \left(z \cdot 4\right)\\
\end{array}
\end{array}
if z < 2.00000000000000007e62Initial program 90.6%
Taylor expanded in z around 0 76.9%
*-commutative76.9%
Simplified76.9%
if 2.00000000000000007e62 < z Initial program 82.7%
sub-neg82.7%
flip-+12.3%
pow212.3%
pow212.3%
pow-prod-up12.4%
metadata-eval12.4%
pow212.4%
Applied egg-rr12.4%
clear-num12.4%
un-div-inv12.4%
clear-num12.4%
metadata-eval12.4%
pow-prod-up12.3%
flip-+82.7%
unpow282.7%
fma-define82.7%
add-sqr-sqrt32.3%
sqrt-prod80.8%
sqr-neg80.8%
sqrt-prod49.8%
add-sqr-sqrt82.2%
Applied egg-rr82.2%
Taylor expanded in z around inf 82.2%
add-sqr-sqrt82.2%
times-frac82.2%
sqrt-div82.2%
metadata-eval82.2%
sqrt-pow182.2%
metadata-eval82.2%
pow182.2%
sqrt-div82.2%
metadata-eval82.2%
sqrt-pow197.3%
metadata-eval97.3%
pow197.3%
Applied egg-rr97.3%
associate-/r/97.3%
/-rgt-identity97.3%
associate-/r/97.3%
metadata-eval97.3%
Simplified97.3%
Final simplification80.9%
(FPCore (x y z t) :precision binary64 (if (<= (* x x) 1.45e+98) (* y (* 4.0 t)) (* x x)))
double code(double x, double y, double z, double t) {
double tmp;
if ((x * x) <= 1.45e+98) {
tmp = y * (4.0 * t);
} 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.45d+98) then
tmp = y * (4.0d0 * t)
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.45e+98) {
tmp = y * (4.0 * t);
} else {
tmp = x * x;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (x * x) <= 1.45e+98: tmp = y * (4.0 * t) else: tmp = x * x return tmp
function code(x, y, z, t) tmp = 0.0 if (Float64(x * x) <= 1.45e+98) tmp = Float64(y * Float64(4.0 * t)); else tmp = Float64(x * x); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((x * x) <= 1.45e+98) tmp = y * (4.0 * t); else tmp = x * x; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[N[(x * x), $MachinePrecision], 1.45e+98], N[(y * N[(4.0 * t), $MachinePrecision]), $MachinePrecision], N[(x * x), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \cdot x \leq 1.45 \cdot 10^{+98}:\\
\;\;\;\;y \cdot \left(4 \cdot t\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot x\\
\end{array}
\end{array}
if (*.f64 x x) < 1.45000000000000005e98Initial program 91.8%
Taylor expanded in t around inf 44.4%
associate-*r*44.4%
Simplified44.4%
if 1.45000000000000005e98 < (*.f64 x x) Initial program 85.8%
Taylor expanded in y around 0 85.8%
Simplified70.7%
Final simplification56.4%
(FPCore (x y z t) :precision binary64 (if (<= z 1.75e+153) (* y (* 4.0 t)) (* y (* t -4.0))))
double code(double x, double y, double z, double t) {
double tmp;
if (z <= 1.75e+153) {
tmp = y * (4.0 * t);
} else {
tmp = y * (t * -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) :: tmp
if (z <= 1.75d+153) then
tmp = y * (4.0d0 * t)
else
tmp = y * (t * (-4.0d0))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (z <= 1.75e+153) {
tmp = y * (4.0 * t);
} else {
tmp = y * (t * -4.0);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if z <= 1.75e+153: tmp = y * (4.0 * t) else: tmp = y * (t * -4.0) return tmp
function code(x, y, z, t) tmp = 0.0 if (z <= 1.75e+153) tmp = Float64(y * Float64(4.0 * t)); else tmp = Float64(y * Float64(t * -4.0)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (z <= 1.75e+153) tmp = y * (4.0 * t); else tmp = y * (t * -4.0); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[z, 1.75e+153], N[(y * N[(4.0 * t), $MachinePrecision]), $MachinePrecision], N[(y * N[(t * -4.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq 1.75 \cdot 10^{+153}:\\
\;\;\;\;y \cdot \left(4 \cdot t\right)\\
\mathbf{else}:\\
\;\;\;\;y \cdot \left(t \cdot -4\right)\\
\end{array}
\end{array}
if z < 1.75e153Initial program 91.1%
Taylor expanded in t around inf 34.6%
associate-*r*34.6%
Simplified34.6%
if 1.75e153 < z Initial program 77.4%
sub-neg77.4%
flip-+0.0%
pow20.0%
pow20.0%
pow-prod-up0.0%
metadata-eval0.0%
pow20.0%
Applied egg-rr0.0%
clear-num0.0%
un-div-inv0.0%
clear-num0.0%
metadata-eval0.0%
pow-prod-up0.0%
flip-+77.4%
unpow277.4%
fma-define77.4%
add-sqr-sqrt26.8%
sqrt-prod77.4%
sqr-neg77.4%
sqrt-prod50.5%
add-sqr-sqrt77.4%
Applied egg-rr77.4%
Taylor expanded in z around 0 33.0%
Taylor expanded in x around 0 18.2%
associate-*r*18.2%
metadata-eval18.2%
distribute-lft-neg-in18.2%
metadata-eval18.2%
associate-/r/18.2%
distribute-lft-neg-in18.2%
*-commutative18.2%
distribute-rgt-neg-in18.2%
associate-/r/18.2%
metadata-eval18.2%
distribute-lft-neg-in18.2%
metadata-eval18.2%
Simplified18.2%
Final simplification32.1%
(FPCore (x y z t) :precision binary64 (- (* x x) (* -4.0 (* y t))))
double code(double x, double y, double z, double t) {
return (x * x) - (-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 = (x * x) - ((-4.0d0) * (y * t))
end function
public static double code(double x, double y, double z, double t) {
return (x * x) - (-4.0 * (y * t));
}
def code(x, y, z, t): return (x * x) - (-4.0 * (y * t))
function code(x, y, z, t) return Float64(Float64(x * x) - Float64(-4.0 * Float64(y * t))) end
function tmp = code(x, y, z, t) tmp = (x * x) - (-4.0 * (y * t)); end
code[x_, y_, z_, t_] := N[(N[(x * x), $MachinePrecision] - N[(-4.0 * N[(y * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x \cdot x - -4 \cdot \left(y \cdot t\right)
\end{array}
Initial program 89.1%
Taylor expanded in z around 0 66.0%
*-commutative66.0%
Simplified66.0%
Final simplification66.0%
(FPCore (x y z t) :precision binary64 (* y (* t -4.0)))
double code(double x, double y, double z, double t) {
return 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 = y * (t * (-4.0d0))
end function
public static double code(double x, double y, double z, double t) {
return y * (t * -4.0);
}
def code(x, y, z, t): return y * (t * -4.0)
function code(x, y, z, t) return Float64(y * Float64(t * -4.0)) end
function tmp = code(x, y, z, t) tmp = y * (t * -4.0); end
code[x_, y_, z_, t_] := N[(y * N[(t * -4.0), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
y \cdot \left(t \cdot -4\right)
\end{array}
Initial program 89.1%
sub-neg89.1%
flip-+54.4%
pow254.4%
pow254.4%
pow-prod-up54.4%
metadata-eval54.4%
pow254.4%
Applied egg-rr54.4%
clear-num54.4%
un-div-inv54.4%
clear-num54.4%
metadata-eval54.4%
pow-prod-up54.4%
flip-+89.0%
unpow289.0%
fma-define89.0%
add-sqr-sqrt42.7%
sqrt-prod69.0%
sqr-neg69.0%
sqrt-prod32.2%
add-sqr-sqrt63.3%
Applied egg-rr63.3%
Taylor expanded in z around 0 42.8%
Taylor expanded in x around 0 6.7%
associate-*r*6.7%
metadata-eval6.7%
distribute-lft-neg-in6.7%
metadata-eval6.7%
associate-/r/6.7%
distribute-lft-neg-in6.7%
*-commutative6.7%
distribute-rgt-neg-in6.7%
associate-/r/6.7%
metadata-eval6.7%
distribute-lft-neg-in6.7%
metadata-eval6.7%
Simplified6.7%
Final simplification6.7%
(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 2024067
(FPCore (x y z t)
:name "Graphics.Rasterific.Shading:$sradialGradientWithFocusShader from Rasterific-0.6.1, B"
:precision binary64
:alt
(- (* x x) (* 4.0 (* y (- (* z z) t))))
(- (* x x) (* (* y 4.0) (- (* z z) t))))