
(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+307) (+ (* 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) <= 5e+307) {
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) <= 5d+307) 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) <= 5e+307) {
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) <= 5e+307: 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) <= 5e+307) 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) <= 5e+307) 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], 5e+307], 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 5 \cdot 10^{+307}:\\
\;\;\;\;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) < 5e307Initial program 97.4%
if 5e307 < (*.f64 z z) Initial program 67.2%
Taylor expanded in z around inf
*-lowering-*.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6475.4%
Simplified75.4%
associate-*r*N/A
metadata-evalN/A
distribute-lft-neg-inN/A
*-commutativeN/A
associate-*r*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
distribute-rgt-neg-inN/A
metadata-evalN/A
*-lowering-*.f6493.5%
Applied egg-rr93.5%
Final simplification96.5%
(FPCore (x y z t)
:precision binary64
(if (<= (* z z) 2e-13)
(- (* x x) (* -4.0 (* y t)))
(if (<= (* z z) 5e+307)
(- (* x x) (* (* z z) (* y 4.0)))
(* z (* z (* y -4.0))))))
double code(double x, double y, double z, double t) {
double tmp;
if ((z * z) <= 2e-13) {
tmp = (x * x) - (-4.0 * (y * t));
} else if ((z * z) <= 5e+307) {
tmp = (x * x) - ((z * z) * (y * 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) <= 2d-13) then
tmp = (x * x) - ((-4.0d0) * (y * t))
else if ((z * z) <= 5d+307) then
tmp = (x * x) - ((z * z) * (y * 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) <= 2e-13) {
tmp = (x * x) - (-4.0 * (y * t));
} else if ((z * z) <= 5e+307) {
tmp = (x * x) - ((z * z) * (y * 4.0));
} else {
tmp = z * (z * (y * -4.0));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (z * z) <= 2e-13: tmp = (x * x) - (-4.0 * (y * t)) elif (z * z) <= 5e+307: tmp = (x * x) - ((z * z) * (y * 4.0)) else: tmp = z * (z * (y * -4.0)) return tmp
function code(x, y, z, t) tmp = 0.0 if (Float64(z * z) <= 2e-13) tmp = Float64(Float64(x * x) - Float64(-4.0 * Float64(y * t))); elseif (Float64(z * z) <= 5e+307) tmp = Float64(Float64(x * x) - Float64(Float64(z * z) * Float64(y * 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) <= 2e-13) tmp = (x * x) - (-4.0 * (y * t)); elseif ((z * z) <= 5e+307) tmp = (x * x) - ((z * z) * (y * 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], 2e-13], N[(N[(x * x), $MachinePrecision] - N[(-4.0 * N[(y * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(z * z), $MachinePrecision], 5e+307], N[(N[(x * x), $MachinePrecision] - N[(N[(z * z), $MachinePrecision] * N[(y * 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 2 \cdot 10^{-13}:\\
\;\;\;\;x \cdot x - -4 \cdot \left(y \cdot t\right)\\
\mathbf{elif}\;z \cdot z \leq 5 \cdot 10^{+307}:\\
\;\;\;\;x \cdot x - \left(z \cdot z\right) \cdot \left(y \cdot 4\right)\\
\mathbf{else}:\\
\;\;\;\;z \cdot \left(z \cdot \left(y \cdot -4\right)\right)\\
\end{array}
\end{array}
if (*.f64 z z) < 2.0000000000000001e-13Initial program 97.0%
Taylor expanded in z around 0
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f6494.6%
Simplified94.6%
if 2.0000000000000001e-13 < (*.f64 z z) < 5e307Initial program 98.3%
Taylor expanded in z around inf
unpow2N/A
*-lowering-*.f6483.2%
Simplified83.2%
if 5e307 < (*.f64 z z) Initial program 67.2%
Taylor expanded in z around inf
*-lowering-*.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6475.4%
Simplified75.4%
associate-*r*N/A
metadata-evalN/A
distribute-lft-neg-inN/A
*-commutativeN/A
associate-*r*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
distribute-rgt-neg-inN/A
metadata-evalN/A
*-lowering-*.f6493.5%
Applied egg-rr93.5%
Final simplification91.6%
(FPCore (x y z t) :precision binary64 (if (<= (* z z) 5e+155) (- (* x x) (* -4.0 (* y t))) (* z (* z (* y -4.0)))))
double code(double x, double y, double z, double t) {
double tmp;
if ((z * z) <= 5e+155) {
tmp = (x * x) - (-4.0 * (y * 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) <= 5d+155) then
tmp = (x * x) - ((-4.0d0) * (y * 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) <= 5e+155) {
tmp = (x * x) - (-4.0 * (y * t));
} else {
tmp = z * (z * (y * -4.0));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (z * z) <= 5e+155: tmp = (x * x) - (-4.0 * (y * t)) else: tmp = z * (z * (y * -4.0)) return tmp
function code(x, y, z, t) tmp = 0.0 if (Float64(z * z) <= 5e+155) tmp = Float64(Float64(x * x) - Float64(-4.0 * Float64(y * 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) <= 5e+155) tmp = (x * x) - (-4.0 * (y * t)); else tmp = z * (z * (y * -4.0)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[N[(z * z), $MachinePrecision], 5e+155], N[(N[(x * x), $MachinePrecision] - N[(-4.0 * N[(y * 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 5 \cdot 10^{+155}:\\
\;\;\;\;x \cdot x - -4 \cdot \left(y \cdot t\right)\\
\mathbf{else}:\\
\;\;\;\;z \cdot \left(z \cdot \left(y \cdot -4\right)\right)\\
\end{array}
\end{array}
if (*.f64 z z) < 4.9999999999999999e155Initial program 97.6%
Taylor expanded in z around 0
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f6488.9%
Simplified88.9%
if 4.9999999999999999e155 < (*.f64 z z) Initial program 76.4%
Taylor expanded in z around inf
*-lowering-*.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6473.4%
Simplified73.4%
associate-*r*N/A
metadata-evalN/A
distribute-lft-neg-inN/A
*-commutativeN/A
associate-*r*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
distribute-rgt-neg-inN/A
metadata-evalN/A
*-lowering-*.f6485.8%
Applied egg-rr85.8%
Final simplification87.8%
(FPCore (x y z t) :precision binary64 (if (<= (* x x) 4.6e+47) (* -4.0 (* y (- (* z z) t))) (* x x)))
double code(double x, double y, double z, double t) {
double tmp;
if ((x * x) <= 4.6e+47) {
tmp = -4.0 * (y * ((z * z) - 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) <= 4.6d+47) then
tmp = (-4.0d0) * (y * ((z * z) - 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) <= 4.6e+47) {
tmp = -4.0 * (y * ((z * z) - t));
} else {
tmp = x * x;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (x * x) <= 4.6e+47: tmp = -4.0 * (y * ((z * z) - t)) else: tmp = x * x return tmp
function code(x, y, z, t) tmp = 0.0 if (Float64(x * x) <= 4.6e+47) tmp = Float64(-4.0 * Float64(y * Float64(Float64(z * z) - t))); else tmp = Float64(x * x); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((x * x) <= 4.6e+47) tmp = -4.0 * (y * ((z * z) - t)); else tmp = x * x; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[N[(x * x), $MachinePrecision], 4.6e+47], N[(-4.0 * N[(y * N[(N[(z * z), $MachinePrecision] - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x * x), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \cdot x \leq 4.6 \cdot 10^{+47}:\\
\;\;\;\;-4 \cdot \left(y \cdot \left(z \cdot z - t\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot x\\
\end{array}
\end{array}
if (*.f64 x x) < 4.5999999999999997e47Initial program 91.5%
Taylor expanded in x around 0
*-lowering-*.f64N/A
*-lowering-*.f64N/A
--lowering--.f64N/A
unpow2N/A
*-lowering-*.f6482.9%
Simplified82.9%
if 4.5999999999999997e47 < (*.f64 x x) Initial program 88.7%
Taylor expanded in x around inf
unpow2N/A
*-lowering-*.f6473.6%
Simplified73.6%
(FPCore (x y z t) :precision binary64 (if (<= (* z z) 5e+155) (* x x) (* z (* z (* y -4.0)))))
double code(double x, double y, double z, double t) {
double tmp;
if ((z * z) <= 5e+155) {
tmp = x * x;
} 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) <= 5d+155) then
tmp = x * x
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) <= 5e+155) {
tmp = x * x;
} else {
tmp = z * (z * (y * -4.0));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (z * z) <= 5e+155: tmp = x * x else: tmp = z * (z * (y * -4.0)) return tmp
function code(x, y, z, t) tmp = 0.0 if (Float64(z * z) <= 5e+155) tmp = Float64(x * x); 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) <= 5e+155) tmp = x * x; else tmp = z * (z * (y * -4.0)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[N[(z * z), $MachinePrecision], 5e+155], N[(x * x), $MachinePrecision], N[(z * N[(z * N[(y * -4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \cdot z \leq 5 \cdot 10^{+155}:\\
\;\;\;\;x \cdot x\\
\mathbf{else}:\\
\;\;\;\;z \cdot \left(z \cdot \left(y \cdot -4\right)\right)\\
\end{array}
\end{array}
if (*.f64 z z) < 4.9999999999999999e155Initial program 97.6%
Taylor expanded in x around inf
unpow2N/A
*-lowering-*.f6453.8%
Simplified53.8%
if 4.9999999999999999e155 < (*.f64 z z) Initial program 76.4%
Taylor expanded in z around inf
*-lowering-*.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6473.4%
Simplified73.4%
associate-*r*N/A
metadata-evalN/A
distribute-lft-neg-inN/A
*-commutativeN/A
associate-*r*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
distribute-rgt-neg-inN/A
metadata-evalN/A
*-lowering-*.f6485.8%
Applied egg-rr85.8%
Final simplification64.9%
(FPCore (x y z t) :precision binary64 (if (<= (* z z) 2e+156) (* x x) (* -4.0 (* (* z z) y))))
double code(double x, double y, double z, double t) {
double tmp;
if ((z * z) <= 2e+156) {
tmp = x * x;
} else {
tmp = -4.0 * ((z * z) * y);
}
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) <= 2d+156) then
tmp = x * x
else
tmp = (-4.0d0) * ((z * z) * y)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((z * z) <= 2e+156) {
tmp = x * x;
} else {
tmp = -4.0 * ((z * z) * y);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (z * z) <= 2e+156: tmp = x * x else: tmp = -4.0 * ((z * z) * y) return tmp
function code(x, y, z, t) tmp = 0.0 if (Float64(z * z) <= 2e+156) tmp = Float64(x * x); else tmp = Float64(-4.0 * Float64(Float64(z * z) * y)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((z * z) <= 2e+156) tmp = x * x; else tmp = -4.0 * ((z * z) * y); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[N[(z * z), $MachinePrecision], 2e+156], N[(x * x), $MachinePrecision], N[(-4.0 * N[(N[(z * z), $MachinePrecision] * y), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \cdot z \leq 2 \cdot 10^{+156}:\\
\;\;\;\;x \cdot x\\
\mathbf{else}:\\
\;\;\;\;-4 \cdot \left(\left(z \cdot z\right) \cdot y\right)\\
\end{array}
\end{array}
if (*.f64 z z) < 2e156Initial program 97.6%
Taylor expanded in x around inf
unpow2N/A
*-lowering-*.f6453.8%
Simplified53.8%
if 2e156 < (*.f64 z z) Initial program 76.4%
Taylor expanded in z around inf
*-lowering-*.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6473.4%
Simplified73.4%
Final simplification60.6%
(FPCore (x y z t) :precision binary64 (if (<= x 2.6e+18) (* (* y t) 4.0) (* x x)))
double code(double x, double y, double z, double t) {
double tmp;
if (x <= 2.6e+18) {
tmp = (y * t) * 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 <= 2.6d+18) then
tmp = (y * t) * 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 <= 2.6e+18) {
tmp = (y * t) * 4.0;
} else {
tmp = x * x;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if x <= 2.6e+18: tmp = (y * t) * 4.0 else: tmp = x * x return tmp
function code(x, y, z, t) tmp = 0.0 if (x <= 2.6e+18) tmp = Float64(Float64(y * t) * 4.0); else tmp = Float64(x * x); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (x <= 2.6e+18) tmp = (y * t) * 4.0; else tmp = x * x; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[x, 2.6e+18], N[(N[(y * t), $MachinePrecision] * 4.0), $MachinePrecision], N[(x * x), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq 2.6 \cdot 10^{+18}:\\
\;\;\;\;\left(y \cdot t\right) \cdot 4\\
\mathbf{else}:\\
\;\;\;\;x \cdot x\\
\end{array}
\end{array}
if x < 2.6e18Initial program 91.2%
flip--N/A
clear-numN/A
un-div-invN/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
clear-numN/A
flip--N/A
/-lowering-/.f64N/A
--lowering--.f64N/A
*-lowering-*.f6491.1%
Applied egg-rr91.1%
Taylor expanded in t around inf
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f6437.9%
Simplified37.9%
if 2.6e18 < x Initial program 87.0%
Taylor expanded in x around inf
unpow2N/A
*-lowering-*.f6469.7%
Simplified69.7%
Final simplification45.5%
(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.2%
Taylor expanded in x around inf
unpow2N/A
*-lowering-*.f6442.6%
Simplified42.6%
(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 2024152
(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))))