
(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) t) 4e+297) (fma x x (* y (* (fma z z (- t)) -4.0))) (* z (* z (* y -4.0)))))
double code(double x, double y, double z, double t) {
double tmp;
if (((z * z) - t) <= 4e+297) {
tmp = fma(x, x, (y * (fma(z, z, -t) * -4.0)));
} else {
tmp = z * (z * (y * -4.0));
}
return tmp;
}
function code(x, y, z, t) tmp = 0.0 if (Float64(Float64(z * z) - t) <= 4e+297) tmp = fma(x, x, Float64(y * Float64(fma(z, z, Float64(-t)) * -4.0))); else tmp = Float64(z * Float64(z * Float64(y * -4.0))); end return tmp end
code[x_, y_, z_, t_] := If[LessEqual[N[(N[(z * z), $MachinePrecision] - t), $MachinePrecision], 4e+297], N[(x * x + N[(y * N[(N[(z * z + (-t)), $MachinePrecision] * -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 - t \leq 4 \cdot 10^{+297}:\\
\;\;\;\;\mathsf{fma}\left(x, x, y \cdot \left(\mathsf{fma}\left(z, z, -t\right) \cdot -4\right)\right)\\
\mathbf{else}:\\
\;\;\;\;z \cdot \left(z \cdot \left(y \cdot -4\right)\right)\\
\end{array}
\end{array}
if (-.f64 (*.f64 z z) t) < 4.0000000000000001e297Initial program 96.6%
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift--.f64N/A
lift-*.f64N/A
sub-negN/A
lift-*.f64N/A
lower-fma.f64N/A
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
distribute-rgt-neg-inN/A
lower-*.f64N/A
*-commutativeN/A
distribute-rgt-neg-inN/A
lower-*.f64N/A
lift--.f64N/A
sub-negN/A
lift-*.f64N/A
lower-fma.f64N/A
lower-neg.f64N/A
metadata-eval97.2
Applied egg-rr97.2%
if 4.0000000000000001e297 < (-.f64 (*.f64 z z) t) Initial program 68.7%
Taylor expanded in z around inf
lower-*.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f6473.9
Simplified73.9%
associate-*r*N/A
associate-*r*N/A
associate-*r*N/A
lift-*.f64N/A
lower-*.f64N/A
lower-*.f6494.8
lift-*.f64N/A
*-commutativeN/A
lower-*.f6494.8
Applied egg-rr94.8%
Final simplification96.5%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (- (* z z) t)))
(if (<= t_1 -5e-77)
(* 4.0 (* t y))
(if (<= t_1 2e+46) (* x x) (* z (* z (* y -4.0)))))))
double code(double x, double y, double z, double t) {
double t_1 = (z * z) - t;
double tmp;
if (t_1 <= -5e-77) {
tmp = 4.0 * (t * y);
} else if (t_1 <= 2e+46) {
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) :: t_1
real(8) :: tmp
t_1 = (z * z) - t
if (t_1 <= (-5d-77)) then
tmp = 4.0d0 * (t * y)
else if (t_1 <= 2d+46) 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 t_1 = (z * z) - t;
double tmp;
if (t_1 <= -5e-77) {
tmp = 4.0 * (t * y);
} else if (t_1 <= 2e+46) {
tmp = x * x;
} else {
tmp = z * (z * (y * -4.0));
}
return tmp;
}
def code(x, y, z, t): t_1 = (z * z) - t tmp = 0 if t_1 <= -5e-77: tmp = 4.0 * (t * y) elif t_1 <= 2e+46: tmp = x * x else: tmp = z * (z * (y * -4.0)) return tmp
function code(x, y, z, t) t_1 = Float64(Float64(z * z) - t) tmp = 0.0 if (t_1 <= -5e-77) tmp = Float64(4.0 * Float64(t * y)); elseif (t_1 <= 2e+46) 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) t_1 = (z * z) - t; tmp = 0.0; if (t_1 <= -5e-77) tmp = 4.0 * (t * y); elseif (t_1 <= 2e+46) tmp = x * x; else tmp = z * (z * (y * -4.0)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(z * z), $MachinePrecision] - t), $MachinePrecision]}, If[LessEqual[t$95$1, -5e-77], N[(4.0 * N[(t * y), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 2e+46], N[(x * x), $MachinePrecision], N[(z * N[(z * N[(y * -4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := z \cdot z - t\\
\mathbf{if}\;t\_1 \leq -5 \cdot 10^{-77}:\\
\;\;\;\;4 \cdot \left(t \cdot y\right)\\
\mathbf{elif}\;t\_1 \leq 2 \cdot 10^{+46}:\\
\;\;\;\;x \cdot x\\
\mathbf{else}:\\
\;\;\;\;z \cdot \left(z \cdot \left(y \cdot -4\right)\right)\\
\end{array}
\end{array}
if (-.f64 (*.f64 z z) t) < -4.99999999999999963e-77Initial program 92.8%
Taylor expanded in t around inf
associate-*r*N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6467.3
Simplified67.3%
associate-*r*N/A
lower-*.f64N/A
lower-*.f6469.0
Applied egg-rr69.0%
if -4.99999999999999963e-77 < (-.f64 (*.f64 z z) t) < 2e46Initial program 99.9%
Taylor expanded in x around inf
unpow2N/A
lower-*.f6456.0
Simplified56.0%
if 2e46 < (-.f64 (*.f64 z z) t) Initial program 81.7%
Taylor expanded in z around inf
lower-*.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f6464.6
Simplified64.6%
associate-*r*N/A
associate-*r*N/A
associate-*r*N/A
lift-*.f64N/A
lower-*.f64N/A
lower-*.f6475.9
lift-*.f64N/A
*-commutativeN/A
lower-*.f6475.9
Applied egg-rr75.9%
Final simplification69.8%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (- (* z z) t)))
(if (<= t_1 -5e-77)
(* 4.0 (* t y))
(if (<= t_1 2e+46) (* x x) (* -4.0 (* (* z z) y))))))
double code(double x, double y, double z, double t) {
double t_1 = (z * z) - t;
double tmp;
if (t_1 <= -5e-77) {
tmp = 4.0 * (t * y);
} else if (t_1 <= 2e+46) {
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) :: t_1
real(8) :: tmp
t_1 = (z * z) - t
if (t_1 <= (-5d-77)) then
tmp = 4.0d0 * (t * y)
else if (t_1 <= 2d+46) 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 t_1 = (z * z) - t;
double tmp;
if (t_1 <= -5e-77) {
tmp = 4.0 * (t * y);
} else if (t_1 <= 2e+46) {
tmp = x * x;
} else {
tmp = -4.0 * ((z * z) * y);
}
return tmp;
}
def code(x, y, z, t): t_1 = (z * z) - t tmp = 0 if t_1 <= -5e-77: tmp = 4.0 * (t * y) elif t_1 <= 2e+46: tmp = x * x else: tmp = -4.0 * ((z * z) * y) return tmp
function code(x, y, z, t) t_1 = Float64(Float64(z * z) - t) tmp = 0.0 if (t_1 <= -5e-77) tmp = Float64(4.0 * Float64(t * y)); elseif (t_1 <= 2e+46) 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) t_1 = (z * z) - t; tmp = 0.0; if (t_1 <= -5e-77) tmp = 4.0 * (t * y); elseif (t_1 <= 2e+46) tmp = x * x; else tmp = -4.0 * ((z * z) * y); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(z * z), $MachinePrecision] - t), $MachinePrecision]}, If[LessEqual[t$95$1, -5e-77], N[(4.0 * N[(t * y), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 2e+46], N[(x * x), $MachinePrecision], N[(-4.0 * N[(N[(z * z), $MachinePrecision] * y), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := z \cdot z - t\\
\mathbf{if}\;t\_1 \leq -5 \cdot 10^{-77}:\\
\;\;\;\;4 \cdot \left(t \cdot y\right)\\
\mathbf{elif}\;t\_1 \leq 2 \cdot 10^{+46}:\\
\;\;\;\;x \cdot x\\
\mathbf{else}:\\
\;\;\;\;-4 \cdot \left(\left(z \cdot z\right) \cdot y\right)\\
\end{array}
\end{array}
if (-.f64 (*.f64 z z) t) < -4.99999999999999963e-77Initial program 92.8%
Taylor expanded in t around inf
associate-*r*N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6467.3
Simplified67.3%
associate-*r*N/A
lower-*.f64N/A
lower-*.f6469.0
Applied egg-rr69.0%
if -4.99999999999999963e-77 < (-.f64 (*.f64 z z) t) < 2e46Initial program 99.9%
Taylor expanded in x around inf
unpow2N/A
lower-*.f6456.0
Simplified56.0%
if 2e46 < (-.f64 (*.f64 z z) t) Initial program 81.7%
Taylor expanded in z around inf
lower-*.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f6464.6
Simplified64.6%
Final simplification63.6%
(FPCore (x y z t) :precision binary64 (if (<= z 4.2e+16) (fma y (* t 4.0) (* x x)) (if (<= z 5e+129) (* (- (* z z) t) (* y -4.0)) (* z (* z (* y -4.0))))))
double code(double x, double y, double z, double t) {
double tmp;
if (z <= 4.2e+16) {
tmp = fma(y, (t * 4.0), (x * x));
} else if (z <= 5e+129) {
tmp = ((z * z) - t) * (y * -4.0);
} else {
tmp = z * (z * (y * -4.0));
}
return tmp;
}
function code(x, y, z, t) tmp = 0.0 if (z <= 4.2e+16) tmp = fma(y, Float64(t * 4.0), Float64(x * x)); elseif (z <= 5e+129) tmp = Float64(Float64(Float64(z * z) - t) * Float64(y * -4.0)); else tmp = Float64(z * Float64(z * Float64(y * -4.0))); end return tmp end
code[x_, y_, z_, t_] := If[LessEqual[z, 4.2e+16], N[(y * N[(t * 4.0), $MachinePrecision] + N[(x * x), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 5e+129], N[(N[(N[(z * z), $MachinePrecision] - t), $MachinePrecision] * N[(y * -4.0), $MachinePrecision]), $MachinePrecision], N[(z * N[(z * N[(y * -4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq 4.2 \cdot 10^{+16}:\\
\;\;\;\;\mathsf{fma}\left(y, t \cdot 4, x \cdot x\right)\\
\mathbf{elif}\;z \leq 5 \cdot 10^{+129}:\\
\;\;\;\;\left(z \cdot z - t\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 z < 4.2e16Initial program 89.8%
Taylor expanded in z around 0
cancel-sign-sub-invN/A
metadata-evalN/A
+-commutativeN/A
associate-*r*N/A
*-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
unpow2N/A
lower-*.f6471.4
Simplified71.4%
if 4.2e16 < z < 5.0000000000000003e129Initial program 99.8%
Taylor expanded in x around 0
associate-*r*N/A
*-commutativeN/A
lower-*.f64N/A
lower--.f64N/A
unpow2N/A
lower-*.f64N/A
lower-*.f6481.1
Simplified81.1%
if 5.0000000000000003e129 < z Initial program 74.2%
Taylor expanded in z around inf
lower-*.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f6472.2
Simplified72.2%
associate-*r*N/A
associate-*r*N/A
associate-*r*N/A
lift-*.f64N/A
lower-*.f64N/A
lower-*.f6493.3
lift-*.f64N/A
*-commutativeN/A
lower-*.f6493.3
Applied egg-rr93.3%
Final simplification76.3%
(FPCore (x y z t) :precision binary64 (if (<= (* z z) 2e+137) (fma y (* t 4.0) (* x x)) (* z (* z (* y -4.0)))))
double code(double x, double y, double z, double t) {
double tmp;
if ((z * z) <= 2e+137) {
tmp = fma(y, (t * 4.0), (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+137) tmp = fma(y, Float64(t * 4.0), 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+137], N[(y * N[(t * 4.0), $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^{+137}:\\
\;\;\;\;\mathsf{fma}\left(y, t \cdot 4, 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.0000000000000001e137Initial program 95.9%
Taylor expanded in z around 0
cancel-sign-sub-invN/A
metadata-evalN/A
+-commutativeN/A
associate-*r*N/A
*-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
unpow2N/A
lower-*.f6485.7
Simplified85.7%
if 2.0000000000000001e137 < (*.f64 z z) Initial program 77.7%
Taylor expanded in z around inf
lower-*.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f6475.1
Simplified75.1%
associate-*r*N/A
associate-*r*N/A
associate-*r*N/A
lift-*.f64N/A
lower-*.f64N/A
lower-*.f6489.8
lift-*.f64N/A
*-commutativeN/A
lower-*.f6489.8
Applied egg-rr89.8%
Final simplification87.4%
(FPCore (x y z t) :precision binary64 (if (<= (* z z) 2e+137) (fma 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) <= 2e+137) {
tmp = fma(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) <= 2e+137) tmp = fma(x, x, Float64(y * Float64(t * 4.0))); 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+137], N[(x * x + 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 2 \cdot 10^{+137}:\\
\;\;\;\;\mathsf{fma}\left(x, x, y \cdot \left(t \cdot 4\right)\right)\\
\mathbf{else}:\\
\;\;\;\;z \cdot \left(z \cdot \left(y \cdot -4\right)\right)\\
\end{array}
\end{array}
if (*.f64 z z) < 2.0000000000000001e137Initial program 95.9%
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift--.f64N/A
lift-*.f64N/A
sub-negN/A
lift-*.f64N/A
lower-fma.f64N/A
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
distribute-rgt-neg-inN/A
lower-*.f64N/A
*-commutativeN/A
distribute-rgt-neg-inN/A
lower-*.f64N/A
lift--.f64N/A
sub-negN/A
lift-*.f64N/A
lower-fma.f64N/A
lower-neg.f64N/A
metadata-eval96.0
Applied egg-rr96.0%
Taylor expanded in z around 0
associate-*r*N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6483.1
Simplified83.1%
if 2.0000000000000001e137 < (*.f64 z z) Initial program 77.7%
Taylor expanded in z around inf
lower-*.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f6475.1
Simplified75.1%
associate-*r*N/A
associate-*r*N/A
associate-*r*N/A
lift-*.f64N/A
lower-*.f64N/A
lower-*.f6489.8
lift-*.f64N/A
*-commutativeN/A
lower-*.f6489.8
Applied egg-rr89.8%
Final simplification85.9%
(FPCore (x y z t) :precision binary64 (if (<= (* x x) 2.5e+61) (* 4.0 (* t y)) (* x x)))
double code(double x, double y, double z, double t) {
double tmp;
if ((x * x) <= 2.5e+61) {
tmp = 4.0 * (t * y);
} 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.5d+61) then
tmp = 4.0d0 * (t * y)
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.5e+61) {
tmp = 4.0 * (t * y);
} else {
tmp = x * x;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (x * x) <= 2.5e+61: tmp = 4.0 * (t * y) else: tmp = x * x return tmp
function code(x, y, z, t) tmp = 0.0 if (Float64(x * x) <= 2.5e+61) tmp = Float64(4.0 * Float64(t * y)); else tmp = Float64(x * x); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((x * x) <= 2.5e+61) tmp = 4.0 * (t * y); else tmp = x * x; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[N[(x * x), $MachinePrecision], 2.5e+61], N[(4.0 * N[(t * y), $MachinePrecision]), $MachinePrecision], N[(x * x), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \cdot x \leq 2.5 \cdot 10^{+61}:\\
\;\;\;\;4 \cdot \left(t \cdot y\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot x\\
\end{array}
\end{array}
if (*.f64 x x) < 2.50000000000000009e61Initial program 91.1%
Taylor expanded in t around inf
associate-*r*N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6443.7
Simplified43.7%
associate-*r*N/A
lower-*.f64N/A
lower-*.f6444.3
Applied egg-rr44.3%
if 2.50000000000000009e61 < (*.f64 x x) Initial program 83.7%
Taylor expanded in x around inf
unpow2N/A
lower-*.f6466.0
Simplified66.0%
Final simplification52.5%
(FPCore (x y z t) :precision binary64 (if (<= (* x x) 2.5e+61) (* y (* t 4.0)) (* x x)))
double code(double x, double y, double z, double t) {
double tmp;
if ((x * x) <= 2.5e+61) {
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 * x) <= 2.5d+61) 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 * x) <= 2.5e+61) {
tmp = y * (t * 4.0);
} else {
tmp = x * x;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (x * x) <= 2.5e+61: tmp = y * (t * 4.0) else: tmp = x * x return tmp
function code(x, y, z, t) tmp = 0.0 if (Float64(x * x) <= 2.5e+61) tmp = Float64(y * Float64(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 * x) <= 2.5e+61) tmp = y * (t * 4.0); else tmp = x * x; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[N[(x * x), $MachinePrecision], 2.5e+61], N[(y * N[(t * 4.0), $MachinePrecision]), $MachinePrecision], N[(x * x), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \cdot x \leq 2.5 \cdot 10^{+61}:\\
\;\;\;\;y \cdot \left(t \cdot 4\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot x\\
\end{array}
\end{array}
if (*.f64 x x) < 2.50000000000000009e61Initial program 91.1%
Taylor expanded in t around inf
associate-*r*N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6443.7
Simplified43.7%
if 2.50000000000000009e61 < (*.f64 x x) Initial program 83.7%
Taylor expanded in x around inf
unpow2N/A
lower-*.f6466.0
Simplified66.0%
(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 88.3%
Taylor expanded in x around inf
unpow2N/A
lower-*.f6430.8
Simplified30.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 2024212
(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))))