
(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) 1e+293) (fma (* 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) <= 1e+293) {
tmp = fma((y * 4.0), (t - (z * z)), (x * x));
} else {
tmp = z * (y * (z * -4.0));
}
return tmp;
}
function code(x, y, z, t) tmp = 0.0 if (Float64(z * z) <= 1e+293) tmp = fma(Float64(y * 4.0), Float64(t - Float64(z * z)), Float64(x * x)); else tmp = Float64(z * Float64(y * Float64(z * -4.0))); end return tmp end
code[x_, y_, z_, t_] := If[LessEqual[N[(z * z), $MachinePrecision], 1e+293], N[(N[(y * 4.0), $MachinePrecision] * N[(t - N[(z * z), $MachinePrecision]), $MachinePrecision] + N[(x * x), $MachinePrecision]), $MachinePrecision], N[(z * N[(y * N[(z * -4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \cdot z \leq 10^{+293}:\\
\;\;\;\;\mathsf{fma}\left(y \cdot 4, t - z \cdot z, x \cdot x\right)\\
\mathbf{else}:\\
\;\;\;\;z \cdot \left(y \cdot \left(z \cdot -4\right)\right)\\
\end{array}
\end{array}
if (*.f64 z z) < 9.9999999999999992e292Initial program 98.4%
cancel-sign-sub-inv98.4%
distribute-lft-neg-out98.4%
+-commutative98.4%
associate-*l*98.4%
distribute-lft-neg-in98.4%
associate-*l*98.4%
distribute-rgt-neg-in98.4%
fma-define100.0%
sub-neg100.0%
+-commutative100.0%
distribute-neg-in100.0%
remove-double-neg100.0%
sub-neg100.0%
Simplified100.0%
if 9.9999999999999992e292 < (*.f64 z z) Initial program 70.0%
Taylor expanded in z around inf 78.4%
associate-*r*78.4%
*-commutative78.4%
associate-*l*78.4%
Simplified78.4%
add-sqr-sqrt37.2%
pow237.2%
pow237.2%
associate-*r*37.2%
sqrt-prod37.2%
sqrt-prod14.0%
add-sqr-sqrt42.3%
Applied egg-rr42.3%
unpow242.3%
swap-sqr37.2%
add-sqr-sqrt78.4%
associate-*r*78.4%
associate-*r*78.4%
associate-*r*87.5%
Applied egg-rr87.5%
Final simplification96.5%
(FPCore (x y z t) :precision binary64 (if (<= (* z z) 1e+293) (fma x x (* (- (* z z) t) (* y -4.0))) (* z (* y (* z -4.0)))))
double code(double x, double y, double z, double t) {
double tmp;
if ((z * z) <= 1e+293) {
tmp = fma(x, x, (((z * z) - t) * (y * -4.0)));
} else {
tmp = z * (y * (z * -4.0));
}
return tmp;
}
function code(x, y, z, t) tmp = 0.0 if (Float64(z * z) <= 1e+293) tmp = fma(x, x, Float64(Float64(Float64(z * z) - t) * Float64(y * -4.0))); else tmp = Float64(z * Float64(y * Float64(z * -4.0))); end return tmp end
code[x_, y_, z_, t_] := If[LessEqual[N[(z * z), $MachinePrecision], 1e+293], N[(x * x + N[(N[(N[(z * z), $MachinePrecision] - t), $MachinePrecision] * N[(y * -4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(z * N[(y * N[(z * -4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \cdot z \leq 10^{+293}:\\
\;\;\;\;\mathsf{fma}\left(x, x, \left(z \cdot z - t\right) \cdot \left(y \cdot -4\right)\right)\\
\mathbf{else}:\\
\;\;\;\;z \cdot \left(y \cdot \left(z \cdot -4\right)\right)\\
\end{array}
\end{array}
if (*.f64 z z) < 9.9999999999999992e292Initial program 98.4%
fma-neg98.4%
distribute-lft-neg-in98.4%
*-commutative98.4%
distribute-rgt-neg-in98.4%
metadata-eval98.4%
Simplified98.4%
if 9.9999999999999992e292 < (*.f64 z z) Initial program 70.0%
Taylor expanded in z around inf 78.4%
associate-*r*78.4%
*-commutative78.4%
associate-*l*78.4%
Simplified78.4%
add-sqr-sqrt37.2%
pow237.2%
pow237.2%
associate-*r*37.2%
sqrt-prod37.2%
sqrt-prod14.0%
add-sqr-sqrt42.3%
Applied egg-rr42.3%
unpow242.3%
swap-sqr37.2%
add-sqr-sqrt78.4%
associate-*r*78.4%
associate-*r*78.4%
associate-*r*87.5%
Applied egg-rr87.5%
Final simplification95.3%
(FPCore (x y z t) :precision binary64 (if (<= (* x x) 1.7e-244) (* 4.0 (* y t)) (if (<= (* x x) 2.8e+86) (* z (* y (* z -4.0))) (* x x))))
double code(double x, double y, double z, double t) {
double tmp;
if ((x * x) <= 1.7e-244) {
tmp = 4.0 * (y * t);
} else if ((x * x) <= 2.8e+86) {
tmp = z * (y * (z * -4.0));
} 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.7d-244) then
tmp = 4.0d0 * (y * t)
else if ((x * x) <= 2.8d+86) then
tmp = z * (y * (z * (-4.0d0)))
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.7e-244) {
tmp = 4.0 * (y * t);
} else if ((x * x) <= 2.8e+86) {
tmp = z * (y * (z * -4.0));
} else {
tmp = x * x;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (x * x) <= 1.7e-244: tmp = 4.0 * (y * t) elif (x * x) <= 2.8e+86: tmp = z * (y * (z * -4.0)) else: tmp = x * x return tmp
function code(x, y, z, t) tmp = 0.0 if (Float64(x * x) <= 1.7e-244) tmp = Float64(4.0 * Float64(y * t)); elseif (Float64(x * x) <= 2.8e+86) tmp = Float64(z * Float64(y * Float64(z * -4.0))); else tmp = Float64(x * x); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((x * x) <= 1.7e-244) tmp = 4.0 * (y * t); elseif ((x * x) <= 2.8e+86) tmp = z * (y * (z * -4.0)); else tmp = x * x; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[N[(x * x), $MachinePrecision], 1.7e-244], N[(4.0 * N[(y * t), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(x * x), $MachinePrecision], 2.8e+86], N[(z * N[(y * N[(z * -4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x * x), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \cdot x \leq 1.7 \cdot 10^{-244}:\\
\;\;\;\;4 \cdot \left(y \cdot t\right)\\
\mathbf{elif}\;x \cdot x \leq 2.8 \cdot 10^{+86}:\\
\;\;\;\;z \cdot \left(y \cdot \left(z \cdot -4\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot x\\
\end{array}
\end{array}
if (*.f64 x x) < 1.70000000000000004e-244Initial program 94.1%
Taylor expanded in t around inf 61.1%
*-commutative61.1%
Simplified61.1%
if 1.70000000000000004e-244 < (*.f64 x x) < 2.80000000000000004e86Initial program 96.4%
Taylor expanded in z around inf 49.2%
associate-*r*49.2%
*-commutative49.2%
associate-*l*49.2%
Simplified49.2%
add-sqr-sqrt18.7%
pow218.7%
pow218.7%
associate-*r*18.7%
sqrt-prod18.3%
sqrt-prod12.1%
add-sqr-sqrt21.9%
Applied egg-rr21.9%
unpow221.9%
swap-sqr18.3%
add-sqr-sqrt49.2%
associate-*r*49.2%
associate-*r*49.2%
associate-*r*52.7%
Applied egg-rr52.7%
if 2.80000000000000004e86 < (*.f64 x x) Initial program 85.7%
Taylor expanded in y around 0 85.7%
Simplified77.5%
--rgt-identity77.5%
Applied egg-rr77.5%
Final simplification67.4%
(FPCore (x y z t) :precision binary64 (if (<= (* x x) 4.4e-246) (* 4.0 (* y t)) (if (<= (* x x) 4.4e+86) (* y (* (* z z) -4.0)) (* x x))))
double code(double x, double y, double z, double t) {
double tmp;
if ((x * x) <= 4.4e-246) {
tmp = 4.0 * (y * t);
} else if ((x * x) <= 4.4e+86) {
tmp = y * ((z * z) * -4.0);
} 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) <= 4.4d-246) then
tmp = 4.0d0 * (y * t)
else if ((x * x) <= 4.4d+86) then
tmp = y * ((z * z) * (-4.0d0))
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) <= 4.4e-246) {
tmp = 4.0 * (y * t);
} else if ((x * x) <= 4.4e+86) {
tmp = y * ((z * z) * -4.0);
} else {
tmp = x * x;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (x * x) <= 4.4e-246: tmp = 4.0 * (y * t) elif (x * x) <= 4.4e+86: tmp = y * ((z * z) * -4.0) else: tmp = x * x return tmp
function code(x, y, z, t) tmp = 0.0 if (Float64(x * x) <= 4.4e-246) tmp = Float64(4.0 * Float64(y * t)); elseif (Float64(x * x) <= 4.4e+86) tmp = Float64(y * Float64(Float64(z * z) * -4.0)); else tmp = Float64(x * x); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((x * x) <= 4.4e-246) tmp = 4.0 * (y * t); elseif ((x * x) <= 4.4e+86) tmp = y * ((z * z) * -4.0); else tmp = x * x; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[N[(x * x), $MachinePrecision], 4.4e-246], N[(4.0 * N[(y * t), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(x * x), $MachinePrecision], 4.4e+86], N[(y * N[(N[(z * z), $MachinePrecision] * -4.0), $MachinePrecision]), $MachinePrecision], N[(x * x), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \cdot x \leq 4.4 \cdot 10^{-246}:\\
\;\;\;\;4 \cdot \left(y \cdot t\right)\\
\mathbf{elif}\;x \cdot x \leq 4.4 \cdot 10^{+86}:\\
\;\;\;\;y \cdot \left(\left(z \cdot z\right) \cdot -4\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot x\\
\end{array}
\end{array}
if (*.f64 x x) < 4.39999999999999996e-246Initial program 94.1%
Taylor expanded in t around inf 61.1%
*-commutative61.1%
Simplified61.1%
if 4.39999999999999996e-246 < (*.f64 x x) < 4.40000000000000006e86Initial program 96.4%
Taylor expanded in z around inf 49.2%
associate-*r*49.2%
*-commutative49.2%
associate-*l*49.2%
Simplified49.2%
pow249.2%
Applied egg-rr49.2%
if 4.40000000000000006e86 < (*.f64 x x) Initial program 85.7%
Taylor expanded in y around 0 85.7%
Simplified77.5%
--rgt-identity77.5%
Applied egg-rr77.5%
Final simplification66.6%
(FPCore (x y z t) :precision binary64 (if (<= (* z z) 1e+293) (+ (* x x) (* (* y 4.0) (- t (* z z)))) (* z (* y (* z -4.0)))))
double code(double x, double y, double z, double t) {
double tmp;
if ((z * z) <= 1e+293) {
tmp = (x * x) + ((y * 4.0) * (t - (z * z)));
} else {
tmp = 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) <= 1d+293) then
tmp = (x * x) + ((y * 4.0d0) * (t - (z * z)))
else
tmp = 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) <= 1e+293) {
tmp = (x * x) + ((y * 4.0) * (t - (z * z)));
} else {
tmp = z * (y * (z * -4.0));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (z * z) <= 1e+293: tmp = (x * x) + ((y * 4.0) * (t - (z * z))) else: tmp = z * (y * (z * -4.0)) return tmp
function code(x, y, z, t) tmp = 0.0 if (Float64(z * z) <= 1e+293) tmp = Float64(Float64(x * x) + Float64(Float64(y * 4.0) * Float64(t - Float64(z * z)))); else tmp = Float64(z * Float64(y * Float64(z * -4.0))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((z * z) <= 1e+293) tmp = (x * x) + ((y * 4.0) * (t - (z * z))); else tmp = z * (y * (z * -4.0)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[N[(z * z), $MachinePrecision], 1e+293], N[(N[(x * x), $MachinePrecision] + N[(N[(y * 4.0), $MachinePrecision] * N[(t - N[(z * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(z * N[(y * N[(z * -4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \cdot z \leq 10^{+293}:\\
\;\;\;\;x \cdot x + \left(y \cdot 4\right) \cdot \left(t - z \cdot z\right)\\
\mathbf{else}:\\
\;\;\;\;z \cdot \left(y \cdot \left(z \cdot -4\right)\right)\\
\end{array}
\end{array}
if (*.f64 z z) < 9.9999999999999992e292Initial program 98.4%
if 9.9999999999999992e292 < (*.f64 z z) Initial program 70.0%
Taylor expanded in z around inf 78.4%
associate-*r*78.4%
*-commutative78.4%
associate-*l*78.4%
Simplified78.4%
add-sqr-sqrt37.2%
pow237.2%
pow237.2%
associate-*r*37.2%
sqrt-prod37.2%
sqrt-prod14.0%
add-sqr-sqrt42.3%
Applied egg-rr42.3%
unpow242.3%
swap-sqr37.2%
add-sqr-sqrt78.4%
associate-*r*78.4%
associate-*r*78.4%
associate-*r*87.5%
Applied egg-rr87.5%
Final simplification95.3%
(FPCore (x y z t) :precision binary64 (if (<= (* z z) 1e+293) (- (* x x) (* y (* t -4.0))) (* z (* y (* z -4.0)))))
double code(double x, double y, double z, double t) {
double tmp;
if ((z * z) <= 1e+293) {
tmp = (x * x) - (y * (t * -4.0));
} else {
tmp = 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) <= 1d+293) then
tmp = (x * x) - (y * (t * (-4.0d0)))
else
tmp = 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) <= 1e+293) {
tmp = (x * x) - (y * (t * -4.0));
} else {
tmp = z * (y * (z * -4.0));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (z * z) <= 1e+293: tmp = (x * x) - (y * (t * -4.0)) else: tmp = z * (y * (z * -4.0)) return tmp
function code(x, y, z, t) tmp = 0.0 if (Float64(z * z) <= 1e+293) tmp = Float64(Float64(x * x) - Float64(y * Float64(t * -4.0))); else tmp = Float64(z * Float64(y * Float64(z * -4.0))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((z * z) <= 1e+293) tmp = (x * x) - (y * (t * -4.0)); else tmp = z * (y * (z * -4.0)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[N[(z * z), $MachinePrecision], 1e+293], N[(N[(x * x), $MachinePrecision] - N[(y * N[(t * -4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(z * N[(y * N[(z * -4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \cdot z \leq 10^{+293}:\\
\;\;\;\;x \cdot x - y \cdot \left(t \cdot -4\right)\\
\mathbf{else}:\\
\;\;\;\;z \cdot \left(y \cdot \left(z \cdot -4\right)\right)\\
\end{array}
\end{array}
if (*.f64 z z) < 9.9999999999999992e292Initial program 98.4%
Taylor expanded in z around 0 89.5%
*-commutative89.5%
*-commutative89.5%
associate-*l*89.5%
Simplified89.5%
if 9.9999999999999992e292 < (*.f64 z z) Initial program 70.0%
Taylor expanded in z around inf 78.4%
associate-*r*78.4%
*-commutative78.4%
associate-*l*78.4%
Simplified78.4%
add-sqr-sqrt37.2%
pow237.2%
pow237.2%
associate-*r*37.2%
sqrt-prod37.2%
sqrt-prod14.0%
add-sqr-sqrt42.3%
Applied egg-rr42.3%
unpow242.3%
swap-sqr37.2%
add-sqr-sqrt78.4%
associate-*r*78.4%
associate-*r*78.4%
associate-*r*87.5%
Applied egg-rr87.5%
Final simplification88.9%
(FPCore (x y z t) :precision binary64 (if (<= (* x x) 2.05e+27) (* 4.0 (* y t)) (* x x)))
double code(double x, double y, double z, double t) {
double tmp;
if ((x * x) <= 2.05e+27) {
tmp = 4.0 * (y * 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) <= 2.05d+27) then
tmp = 4.0d0 * (y * 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) <= 2.05e+27) {
tmp = 4.0 * (y * t);
} else {
tmp = x * x;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (x * x) <= 2.05e+27: tmp = 4.0 * (y * t) else: tmp = x * x return tmp
function code(x, y, z, t) tmp = 0.0 if (Float64(x * x) <= 2.05e+27) tmp = Float64(4.0 * Float64(y * t)); else tmp = Float64(x * x); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((x * x) <= 2.05e+27) tmp = 4.0 * (y * t); else tmp = x * x; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[N[(x * x), $MachinePrecision], 2.05e+27], N[(4.0 * N[(y * t), $MachinePrecision]), $MachinePrecision], N[(x * x), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \cdot x \leq 2.05 \cdot 10^{+27}:\\
\;\;\;\;4 \cdot \left(y \cdot t\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot x\\
\end{array}
\end{array}
if (*.f64 x x) < 2.0500000000000001e27Initial program 94.7%
Taylor expanded in t around inf 51.6%
*-commutative51.6%
Simplified51.6%
if 2.0500000000000001e27 < (*.f64 x x) Initial program 86.6%
Taylor expanded in y around 0 86.6%
Simplified74.4%
--rgt-identity74.4%
Applied egg-rr74.4%
(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 90.5%
Taylor expanded in y around 0 90.5%
Simplified44.0%
--rgt-identity44.0%
Applied egg-rr44.0%
(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 2024137
(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))))