
(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) 2e+302) (fma (* y 4.0) (fma z (- z) t) (* x x)) (* z (* z (* y -4.0)))))
double code(double x, double y, double z, double t) {
double tmp;
if ((z * z) <= 2e+302) {
tmp = fma((y * 4.0), fma(z, -z, t), (x * x));
} else {
tmp = z * (z * (y * -4.0));
}
return tmp;
}
function code(x, y, z, t) tmp = 0.0 if (Float64(z * z) <= 2e+302) tmp = fma(Float64(y * 4.0), fma(z, Float64(-z), t), Float64(x * x)); else tmp = Float64(z * Float64(z * Float64(y * -4.0))); end return tmp end
code[x_, y_, z_, t_] := If[LessEqual[N[(z * z), $MachinePrecision], 2e+302], N[(N[(y * 4.0), $MachinePrecision] * N[(z * (-z) + t), $MachinePrecision] + N[(x * x), $MachinePrecision]), $MachinePrecision], N[(z * N[(z * N[(y * -4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \cdot z \leq 2 \cdot 10^{+302}:\\
\;\;\;\;\mathsf{fma}\left(y \cdot 4, \mathsf{fma}\left(z, -z, t\right), x \cdot x\right)\\
\mathbf{else}:\\
\;\;\;\;z \cdot \left(z \cdot \left(y \cdot -4\right)\right)\\
\end{array}
\end{array}
if (*.f64 z z) < 2.0000000000000002e302Initial program 99.0%
cancel-sign-sub-inv99.0%
distribute-lft-neg-out99.0%
+-commutative99.0%
distribute-lft-neg-out99.0%
distribute-lft-neg-in99.0%
distribute-rgt-neg-in99.0%
fma-define100.0%
neg-sub0100.0%
associate-+l-100.0%
neg-sub0100.0%
distribute-rgt-neg-out100.0%
fma-define100.0%
Simplified100.0%
if 2.0000000000000002e302 < (*.f64 z z) Initial program 71.5%
fmm-def81.9%
distribute-lft-neg-in81.9%
*-commutative81.9%
distribute-rgt-neg-in81.9%
metadata-eval81.9%
Simplified81.9%
Taylor expanded in z around inf 81.9%
associate-*r*81.9%
*-commutative81.9%
*-commutative81.9%
Simplified81.9%
add-sqr-sqrt36.9%
pow236.9%
sqrt-prod36.9%
sqrt-pow143.5%
metadata-eval43.5%
pow143.5%
Applied egg-rr43.5%
unpow243.5%
swap-sqr36.9%
add-sqr-sqrt81.9%
associate-*l*90.1%
*-commutative90.1%
Applied egg-rr90.1%
Final simplification97.7%
(FPCore (x y z t) :precision binary64 (if (<= (* z z) 2e+302) (fma (* y 4.0) (- t (* z z)) (* x x)) (* z (* z (* y -4.0)))))
double code(double x, double y, double z, double t) {
double tmp;
if ((z * z) <= 2e+302) {
tmp = fma((y * 4.0), (t - (z * z)), (x * x));
} else {
tmp = z * (z * (y * -4.0));
}
return tmp;
}
function code(x, y, z, t) tmp = 0.0 if (Float64(z * z) <= 2e+302) tmp = fma(Float64(y * 4.0), Float64(t - Float64(z * z)), Float64(x * x)); else tmp = Float64(z * Float64(z * Float64(y * -4.0))); end return tmp end
code[x_, y_, z_, t_] := If[LessEqual[N[(z * z), $MachinePrecision], 2e+302], N[(N[(y * 4.0), $MachinePrecision] * N[(t - N[(z * z), $MachinePrecision]), $MachinePrecision] + N[(x * x), $MachinePrecision]), $MachinePrecision], N[(z * N[(z * N[(y * -4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \cdot z \leq 2 \cdot 10^{+302}:\\
\;\;\;\;\mathsf{fma}\left(y \cdot 4, t - z \cdot z, x \cdot x\right)\\
\mathbf{else}:\\
\;\;\;\;z \cdot \left(z \cdot \left(y \cdot -4\right)\right)\\
\end{array}
\end{array}
if (*.f64 z z) < 2.0000000000000002e302Initial program 99.0%
cancel-sign-sub-inv99.0%
distribute-lft-neg-out99.0%
+-commutative99.0%
distribute-lft-neg-out99.0%
distribute-lft-neg-in99.0%
distribute-rgt-neg-in99.0%
fma-define100.0%
sub-neg100.0%
+-commutative100.0%
distribute-neg-in100.0%
remove-double-neg100.0%
sub-neg100.0%
Simplified100.0%
if 2.0000000000000002e302 < (*.f64 z z) Initial program 71.5%
fmm-def81.9%
distribute-lft-neg-in81.9%
*-commutative81.9%
distribute-rgt-neg-in81.9%
metadata-eval81.9%
Simplified81.9%
Taylor expanded in z around inf 81.9%
associate-*r*81.9%
*-commutative81.9%
*-commutative81.9%
Simplified81.9%
add-sqr-sqrt36.9%
pow236.9%
sqrt-prod36.9%
sqrt-pow143.5%
metadata-eval43.5%
pow143.5%
Applied egg-rr43.5%
unpow243.5%
swap-sqr36.9%
add-sqr-sqrt81.9%
associate-*l*90.1%
*-commutative90.1%
Applied egg-rr90.1%
Final simplification97.7%
(FPCore (x y z t) :precision binary64 (if (<= (* z z) 2e+296) (fma x x (* (* y -4.0) (- (* z z) t))) (* z (* z (* y -4.0)))))
double code(double x, double y, double z, double t) {
double tmp;
if ((z * z) <= 2e+296) {
tmp = fma(x, x, ((y * -4.0) * ((z * z) - t)));
} else {
tmp = z * (z * (y * -4.0));
}
return tmp;
}
function code(x, y, z, t) tmp = 0.0 if (Float64(z * z) <= 2e+296) tmp = fma(x, x, Float64(Float64(y * -4.0) * Float64(Float64(z * z) - t))); else tmp = Float64(z * Float64(z * Float64(y * -4.0))); end return tmp end
code[x_, y_, z_, t_] := If[LessEqual[N[(z * z), $MachinePrecision], 2e+296], N[(x * x + N[(N[(y * -4.0), $MachinePrecision] * N[(N[(z * z), $MachinePrecision] - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(z * N[(z * N[(y * -4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \cdot z \leq 2 \cdot 10^{+296}:\\
\;\;\;\;\mathsf{fma}\left(x, x, \left(y \cdot -4\right) \cdot \left(z \cdot z - t\right)\right)\\
\mathbf{else}:\\
\;\;\;\;z \cdot \left(z \cdot \left(y \cdot -4\right)\right)\\
\end{array}
\end{array}
if (*.f64 z z) < 1.99999999999999996e296Initial program 99.5%
fmm-def99.5%
distribute-lft-neg-in99.5%
*-commutative99.5%
distribute-rgt-neg-in99.5%
metadata-eval99.5%
Simplified99.5%
if 1.99999999999999996e296 < (*.f64 z z) Initial program 70.3%
fmm-def80.5%
distribute-lft-neg-in80.5%
*-commutative80.5%
distribute-rgt-neg-in80.5%
metadata-eval80.5%
Simplified80.5%
Taylor expanded in z around inf 80.5%
associate-*r*80.5%
*-commutative80.5%
*-commutative80.5%
Simplified80.5%
add-sqr-sqrt36.3%
pow236.3%
sqrt-prod36.3%
sqrt-pow142.7%
metadata-eval42.7%
pow142.7%
Applied egg-rr42.7%
unpow242.7%
swap-sqr36.3%
add-sqr-sqrt80.5%
associate-*l*88.5%
*-commutative88.5%
Applied egg-rr88.5%
Final simplification96.9%
(FPCore (x y z t) :precision binary64 (if (<= (* z z) 1e+296) (+ (* x x) (* (* y 4.0) (- t (* z z)))) (* z (* z (* y -4.0)))))
double code(double x, double y, double z, double t) {
double tmp;
if ((z * z) <= 1e+296) {
tmp = (x * x) + ((y * 4.0) * (t - (z * z)));
} else {
tmp = z * (z * (y * -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+296) then
tmp = (x * x) + ((y * 4.0d0) * (t - (z * z)))
else
tmp = z * (z * (y * (-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+296) {
tmp = (x * x) + ((y * 4.0) * (t - (z * z)));
} else {
tmp = z * (z * (y * -4.0));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (z * z) <= 1e+296: tmp = (x * x) + ((y * 4.0) * (t - (z * z))) else: tmp = z * (z * (y * -4.0)) return tmp
function code(x, y, z, t) tmp = 0.0 if (Float64(z * z) <= 1e+296) tmp = Float64(Float64(x * x) + Float64(Float64(y * 4.0) * Float64(t - Float64(z * z)))); else tmp = Float64(z * Float64(z * Float64(y * -4.0))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((z * z) <= 1e+296) tmp = (x * x) + ((y * 4.0) * (t - (z * z))); else tmp = z * (z * (y * -4.0)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[N[(z * z), $MachinePrecision], 1e+296], N[(N[(x * x), $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}
\\
\begin{array}{l}
\mathbf{if}\;z \cdot z \leq 10^{+296}:\\
\;\;\;\;x \cdot x + \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 (*.f64 z z) < 9.99999999999999981e295Initial program 100.0%
if 9.99999999999999981e295 < (*.f64 z z) Initial program 69.1%
fmm-def79.1%
distribute-lft-neg-in79.1%
*-commutative79.1%
distribute-rgt-neg-in79.1%
metadata-eval79.1%
Simplified79.1%
Taylor expanded in z around inf 79.1%
associate-*r*79.1%
*-commutative79.1%
*-commutative79.1%
Simplified79.1%
add-sqr-sqrt35.7%
pow235.7%
sqrt-prod35.7%
sqrt-pow142.0%
metadata-eval42.0%
pow142.0%
Applied egg-rr42.0%
unpow242.0%
swap-sqr35.7%
add-sqr-sqrt79.1%
associate-*l*87.0%
*-commutative87.0%
Applied egg-rr87.0%
Final simplification96.9%
(FPCore (x y z t) :precision binary64 (if (<= (* z z) 4e+130) (- (* x x) (* y (* t -4.0))) (* z (* z (* y -4.0)))))
double code(double x, double y, double z, double t) {
double tmp;
if ((z * z) <= 4e+130) {
tmp = (x * x) - (y * (t * -4.0));
} else {
tmp = z * (z * (y * -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) <= 4d+130) then
tmp = (x * x) - (y * (t * (-4.0d0)))
else
tmp = z * (z * (y * (-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) <= 4e+130) {
tmp = (x * x) - (y * (t * -4.0));
} else {
tmp = z * (z * (y * -4.0));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (z * z) <= 4e+130: tmp = (x * x) - (y * (t * -4.0)) else: tmp = z * (z * (y * -4.0)) return tmp
function code(x, y, z, t) tmp = 0.0 if (Float64(z * z) <= 4e+130) tmp = Float64(Float64(x * x) - Float64(y * Float64(t * -4.0))); else tmp = Float64(z * Float64(z * Float64(y * -4.0))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((z * z) <= 4e+130) tmp = (x * x) - (y * (t * -4.0)); else tmp = z * (z * (y * -4.0)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[N[(z * z), $MachinePrecision], 4e+130], N[(N[(x * x), $MachinePrecision] - N[(y * N[(t * -4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(z * N[(z * N[(y * -4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \cdot z \leq 4 \cdot 10^{+130}:\\
\;\;\;\;x \cdot x - 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 (*.f64 z z) < 4.0000000000000002e130Initial program 100.0%
Taylor expanded in z around 0 94.0%
*-commutative94.0%
*-commutative94.0%
associate-*l*94.0%
Simplified94.0%
if 4.0000000000000002e130 < (*.f64 z z) Initial program 80.9%
fmm-def87.1%
distribute-lft-neg-in87.1%
*-commutative87.1%
distribute-rgt-neg-in87.1%
metadata-eval87.1%
Simplified87.1%
Taylor expanded in z around inf 75.0%
associate-*r*75.0%
*-commutative75.0%
*-commutative75.0%
Simplified75.0%
add-sqr-sqrt35.7%
pow235.7%
sqrt-prod35.7%
sqrt-pow139.6%
metadata-eval39.6%
pow139.6%
Applied egg-rr39.6%
unpow239.6%
swap-sqr35.7%
add-sqr-sqrt75.0%
associate-*l*79.9%
*-commutative79.9%
Applied egg-rr79.9%
Final simplification88.6%
(FPCore (x y z t) :precision binary64 (if (<= (* z z) 1e+82) (* y (* 4.0 t)) (* z (* z (* y -4.0)))))
double code(double x, double y, double z, double t) {
double tmp;
if ((z * z) <= 1e+82) {
tmp = y * (4.0 * t);
} else {
tmp = z * (z * (y * -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+82) then
tmp = y * (4.0d0 * t)
else
tmp = z * (z * (y * (-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+82) {
tmp = y * (4.0 * t);
} else {
tmp = z * (z * (y * -4.0));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (z * z) <= 1e+82: tmp = y * (4.0 * t) else: tmp = z * (z * (y * -4.0)) return tmp
function code(x, y, z, t) tmp = 0.0 if (Float64(z * z) <= 1e+82) tmp = Float64(y * Float64(4.0 * t)); else tmp = Float64(z * Float64(z * Float64(y * -4.0))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((z * z) <= 1e+82) tmp = y * (4.0 * t); else tmp = z * (z * (y * -4.0)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[N[(z * z), $MachinePrecision], 1e+82], N[(y * N[(4.0 * t), $MachinePrecision]), $MachinePrecision], N[(z * N[(z * N[(y * -4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \cdot z \leq 10^{+82}:\\
\;\;\;\;y \cdot \left(4 \cdot t\right)\\
\mathbf{else}:\\
\;\;\;\;z \cdot \left(z \cdot \left(y \cdot -4\right)\right)\\
\end{array}
\end{array}
if (*.f64 z z) < 9.9999999999999996e81Initial program 100.0%
fmm-def100.0%
distribute-lft-neg-in100.0%
*-commutative100.0%
distribute-rgt-neg-in100.0%
metadata-eval100.0%
Simplified100.0%
Taylor expanded in t around inf 48.2%
*-commutative48.2%
Simplified48.2%
*-commutative48.2%
metadata-eval48.2%
distribute-rgt-neg-in48.2%
associate-*r*48.9%
add-sqr-sqrt25.4%
sqrt-unprod19.3%
associate-*r*19.3%
associate-*r*19.3%
swap-sqr19.3%
metadata-eval19.3%
metadata-eval19.3%
swap-sqr19.3%
*-commutative19.3%
*-commutative19.3%
sqrt-unprod6.5%
add-sqr-sqrt7.8%
*-commutative7.8%
metadata-eval7.8%
distribute-rgt-neg-in7.8%
associate-*r*7.7%
distribute-rgt-neg-in7.7%
*-commutative7.7%
distribute-lft-neg-in7.7%
Applied egg-rr7.7%
add-sqr-sqrt7.2%
sqrt-unprod26.3%
sqr-neg26.3%
sqrt-unprod29.2%
add-sqr-sqrt48.9%
*-commutative48.9%
Applied egg-rr48.9%
if 9.9999999999999996e81 < (*.f64 z z) Initial program 82.3%
fmm-def88.0%
distribute-lft-neg-in88.0%
*-commutative88.0%
distribute-rgt-neg-in88.0%
metadata-eval88.0%
Simplified88.0%
Taylor expanded in z around inf 73.1%
associate-*r*73.1%
*-commutative73.1%
*-commutative73.1%
Simplified73.1%
add-sqr-sqrt35.8%
pow235.8%
sqrt-prod35.8%
sqrt-pow139.4%
metadata-eval39.4%
pow139.4%
Applied egg-rr39.4%
unpow239.4%
swap-sqr35.8%
add-sqr-sqrt73.1%
associate-*l*77.7%
*-commutative77.7%
Applied egg-rr77.7%
Final simplification60.7%
(FPCore (x y z t) :precision binary64 (if (<= (* z z) 6.5e+81) (* y (* 4.0 t)) (* (* z z) (* y -4.0))))
double code(double x, double y, double z, double t) {
double tmp;
if ((z * z) <= 6.5e+81) {
tmp = y * (4.0 * t);
} else {
tmp = (z * z) * (y * -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) <= 6.5d+81) then
tmp = y * (4.0d0 * t)
else
tmp = (z * z) * (y * (-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) <= 6.5e+81) {
tmp = y * (4.0 * t);
} else {
tmp = (z * z) * (y * -4.0);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (z * z) <= 6.5e+81: tmp = y * (4.0 * t) else: tmp = (z * z) * (y * -4.0) return tmp
function code(x, y, z, t) tmp = 0.0 if (Float64(z * z) <= 6.5e+81) tmp = Float64(y * Float64(4.0 * t)); else tmp = Float64(Float64(z * z) * Float64(y * -4.0)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((z * z) <= 6.5e+81) tmp = y * (4.0 * t); else tmp = (z * z) * (y * -4.0); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[N[(z * z), $MachinePrecision], 6.5e+81], N[(y * N[(4.0 * t), $MachinePrecision]), $MachinePrecision], N[(N[(z * z), $MachinePrecision] * N[(y * -4.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \cdot z \leq 6.5 \cdot 10^{+81}:\\
\;\;\;\;y \cdot \left(4 \cdot t\right)\\
\mathbf{else}:\\
\;\;\;\;\left(z \cdot z\right) \cdot \left(y \cdot -4\right)\\
\end{array}
\end{array}
if (*.f64 z z) < 6.4999999999999996e81Initial program 100.0%
fmm-def100.0%
distribute-lft-neg-in100.0%
*-commutative100.0%
distribute-rgt-neg-in100.0%
metadata-eval100.0%
Simplified100.0%
Taylor expanded in t around inf 48.2%
*-commutative48.2%
Simplified48.2%
*-commutative48.2%
metadata-eval48.2%
distribute-rgt-neg-in48.2%
associate-*r*48.9%
add-sqr-sqrt25.4%
sqrt-unprod19.3%
associate-*r*19.3%
associate-*r*19.3%
swap-sqr19.3%
metadata-eval19.3%
metadata-eval19.3%
swap-sqr19.3%
*-commutative19.3%
*-commutative19.3%
sqrt-unprod6.5%
add-sqr-sqrt7.8%
*-commutative7.8%
metadata-eval7.8%
distribute-rgt-neg-in7.8%
associate-*r*7.7%
distribute-rgt-neg-in7.7%
*-commutative7.7%
distribute-lft-neg-in7.7%
Applied egg-rr7.7%
add-sqr-sqrt7.2%
sqrt-unprod26.3%
sqr-neg26.3%
sqrt-unprod29.2%
add-sqr-sqrt48.9%
*-commutative48.9%
Applied egg-rr48.9%
if 6.4999999999999996e81 < (*.f64 z z) Initial program 82.3%
fmm-def88.0%
distribute-lft-neg-in88.0%
*-commutative88.0%
distribute-rgt-neg-in88.0%
metadata-eval88.0%
Simplified88.0%
Taylor expanded in z around inf 73.1%
associate-*r*73.1%
*-commutative73.1%
*-commutative73.1%
Simplified73.1%
unpow273.1%
Applied egg-rr73.1%
Final simplification58.8%
(FPCore (x y z t) :precision binary64 (* y (* 4.0 t)))
double code(double x, double y, double z, double t) {
return y * (4.0 * 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 = y * (4.0d0 * t)
end function
public static double code(double x, double y, double z, double t) {
return y * (4.0 * t);
}
def code(x, y, z, t): return y * (4.0 * t)
function code(x, y, z, t) return Float64(y * Float64(4.0 * t)) end
function tmp = code(x, y, z, t) tmp = y * (4.0 * t); end
code[x_, y_, z_, t_] := N[(y * N[(4.0 * t), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
y \cdot \left(4 \cdot t\right)
\end{array}
Initial program 92.7%
fmm-def95.1%
distribute-lft-neg-in95.1%
*-commutative95.1%
distribute-rgt-neg-in95.1%
metadata-eval95.1%
Simplified95.1%
Taylor expanded in t around inf 32.7%
*-commutative32.7%
Simplified32.7%
*-commutative32.7%
metadata-eval32.7%
distribute-rgt-neg-in32.7%
associate-*r*33.1%
add-sqr-sqrt17.7%
sqrt-unprod17.9%
associate-*r*17.9%
associate-*r*17.9%
swap-sqr17.9%
metadata-eval17.9%
metadata-eval17.9%
swap-sqr17.9%
*-commutative17.9%
*-commutative17.9%
sqrt-unprod5.4%
add-sqr-sqrt6.7%
*-commutative6.7%
metadata-eval6.7%
distribute-rgt-neg-in6.7%
associate-*r*6.7%
distribute-rgt-neg-in6.7%
*-commutative6.7%
distribute-lft-neg-in6.7%
Applied egg-rr6.7%
add-sqr-sqrt4.8%
sqrt-unprod20.6%
sqr-neg20.6%
sqrt-unprod18.8%
add-sqr-sqrt33.1%
*-commutative33.1%
Applied egg-rr33.1%
Final simplification33.1%
(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.7%
fmm-def95.1%
distribute-lft-neg-in95.1%
*-commutative95.1%
distribute-rgt-neg-in95.1%
metadata-eval95.1%
Simplified95.1%
Taylor expanded in t around inf 32.7%
*-commutative32.7%
Simplified32.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 2024179
(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))))