
(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) 2e+162) (+ (* x x) (* (* y 4.0) (- t (* z z)))) (fma (* z (* z y)) -4.0 (* x x))))
double code(double x, double y, double z, double t) {
double tmp;
if ((z * z) <= 2e+162) {
tmp = (x * x) + ((y * 4.0) * (t - (z * z)));
} else {
tmp = fma((z * (z * y)), -4.0, (x * x));
}
return tmp;
}
function code(x, y, z, t) tmp = 0.0 if (Float64(z * z) <= 2e+162) tmp = Float64(Float64(x * x) + Float64(Float64(y * 4.0) * Float64(t - Float64(z * z)))); else tmp = fma(Float64(z * Float64(z * y)), -4.0, Float64(x * x)); end return tmp end
code[x_, y_, z_, t_] := If[LessEqual[N[(z * z), $MachinePrecision], 2e+162], N[(N[(x * x), $MachinePrecision] + N[(N[(y * 4.0), $MachinePrecision] * N[(t - N[(z * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(z * N[(z * y), $MachinePrecision]), $MachinePrecision] * -4.0 + N[(x * x), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \cdot z \leq 2 \cdot 10^{+162}:\\
\;\;\;\;x \cdot x + \left(y \cdot 4\right) \cdot \left(t - z \cdot z\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(z \cdot \left(z \cdot y\right), -4, x \cdot x\right)\\
\end{array}
\end{array}
if (*.f64 z z) < 1.9999999999999999e162Initial program 97.6%
if 1.9999999999999999e162 < (*.f64 z z) Initial program 82.9%
Taylor expanded in z around inf
associate-*r*N/A
*-commutativeN/A
associate-*l*N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
unpow2N/A
lower-*.f6482.9
Applied rewrites82.9%
lift-*.f64N/A
lift-*.f64N/A
associate-*r*N/A
*-commutativeN/A
cancel-sign-sub-invN/A
metadata-evalN/A
associate-*l*N/A
*-commutativeN/A
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
lift-*.f64N/A
+-commutativeN/A
*-commutativeN/A
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
lower-fma.f64N/A
Applied rewrites96.4%
Final simplification97.2%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (- (* z z) t)))
(if (<= t_1 -4e-119)
(* y (* 4.0 t))
(if (<= t_1 1e+190) (* 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 <= -4e-119) {
tmp = y * (4.0 * t);
} else if (t_1 <= 1e+190) {
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 <= (-4d-119)) then
tmp = y * (4.0d0 * t)
else if (t_1 <= 1d+190) 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 <= -4e-119) {
tmp = y * (4.0 * t);
} else if (t_1 <= 1e+190) {
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 <= -4e-119: tmp = y * (4.0 * t) elif t_1 <= 1e+190: 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 <= -4e-119) tmp = Float64(y * Float64(4.0 * t)); elseif (t_1 <= 1e+190) tmp = Float64(x * x); else tmp = Float64(Float64(z * Float64(z * 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 <= -4e-119) tmp = y * (4.0 * t); elseif (t_1 <= 1e+190) 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, -4e-119], N[(y * N[(4.0 * t), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 1e+190], N[(x * x), $MachinePrecision], N[(N[(z * N[(z * y), $MachinePrecision]), $MachinePrecision] * -4.0), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := z \cdot z - t\\
\mathbf{if}\;t\_1 \leq -4 \cdot 10^{-119}:\\
\;\;\;\;y \cdot \left(4 \cdot t\right)\\
\mathbf{elif}\;t\_1 \leq 10^{+190}:\\
\;\;\;\;x \cdot x\\
\mathbf{else}:\\
\;\;\;\;\left(z \cdot \left(z \cdot y\right)\right) \cdot -4\\
\end{array}
\end{array}
if (-.f64 (*.f64 z z) t) < -4.00000000000000005e-119Initial program 95.9%
Taylor expanded in t around inf
associate-*r*N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6466.3
Applied rewrites66.3%
if -4.00000000000000005e-119 < (-.f64 (*.f64 z z) t) < 1.0000000000000001e190Initial program 98.1%
Taylor expanded in x around inf
unpow2N/A
lower-*.f6457.7
Applied rewrites57.7%
if 1.0000000000000001e190 < (-.f64 (*.f64 z z) t) Initial program 85.2%
Taylor expanded in z around inf
associate-*r*N/A
*-commutativeN/A
associate-*l*N/A
lower-*.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f6468.8
Applied rewrites68.8%
associate-*r*N/A
associate-*r*N/A
associate-*l*N/A
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
associate-*r*N/A
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f6472.6
Applied rewrites72.6%
Final simplification65.1%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (- (* z z) t)))
(if (<= t_1 -4e-119)
(* y (* 4.0 t))
(if (<= t_1 1e+190) (* x x) (* y (* (* z z) -4.0))))))
double code(double x, double y, double z, double t) {
double t_1 = (z * z) - t;
double tmp;
if (t_1 <= -4e-119) {
tmp = y * (4.0 * t);
} else if (t_1 <= 1e+190) {
tmp = x * x;
} else {
tmp = y * ((z * 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) :: t_1
real(8) :: tmp
t_1 = (z * z) - t
if (t_1 <= (-4d-119)) then
tmp = y * (4.0d0 * t)
else if (t_1 <= 1d+190) then
tmp = x * x
else
tmp = y * ((z * z) * (-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 <= -4e-119) {
tmp = y * (4.0 * t);
} else if (t_1 <= 1e+190) {
tmp = x * x;
} else {
tmp = y * ((z * z) * -4.0);
}
return tmp;
}
def code(x, y, z, t): t_1 = (z * z) - t tmp = 0 if t_1 <= -4e-119: tmp = y * (4.0 * t) elif t_1 <= 1e+190: tmp = x * x else: tmp = y * ((z * z) * -4.0) return tmp
function code(x, y, z, t) t_1 = Float64(Float64(z * z) - t) tmp = 0.0 if (t_1 <= -4e-119) tmp = Float64(y * Float64(4.0 * t)); elseif (t_1 <= 1e+190) tmp = Float64(x * x); else tmp = Float64(y * Float64(Float64(z * z) * -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 <= -4e-119) tmp = y * (4.0 * t); elseif (t_1 <= 1e+190) tmp = x * x; else tmp = y * ((z * z) * -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, -4e-119], N[(y * N[(4.0 * t), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 1e+190], N[(x * x), $MachinePrecision], N[(y * N[(N[(z * z), $MachinePrecision] * -4.0), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := z \cdot z - t\\
\mathbf{if}\;t\_1 \leq -4 \cdot 10^{-119}:\\
\;\;\;\;y \cdot \left(4 \cdot t\right)\\
\mathbf{elif}\;t\_1 \leq 10^{+190}:\\
\;\;\;\;x \cdot x\\
\mathbf{else}:\\
\;\;\;\;y \cdot \left(\left(z \cdot z\right) \cdot -4\right)\\
\end{array}
\end{array}
if (-.f64 (*.f64 z z) t) < -4.00000000000000005e-119Initial program 95.9%
Taylor expanded in t around inf
associate-*r*N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6466.3
Applied rewrites66.3%
if -4.00000000000000005e-119 < (-.f64 (*.f64 z z) t) < 1.0000000000000001e190Initial program 98.1%
Taylor expanded in x around inf
unpow2N/A
lower-*.f6457.7
Applied rewrites57.7%
if 1.0000000000000001e190 < (-.f64 (*.f64 z z) t) Initial program 85.2%
Taylor expanded in z around inf
associate-*r*N/A
*-commutativeN/A
associate-*l*N/A
lower-*.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f6468.8
Applied rewrites68.8%
Final simplification63.6%
(FPCore (x y z t)
:precision binary64
(if (<= z 1500000000.0)
(fma y (* 4.0 t) (* x x))
(if (<= z 6.4e+160)
(fma y (* (* z z) -4.0) (* x x))
(* (* z (* z y)) -4.0))))
double code(double x, double y, double z, double t) {
double tmp;
if (z <= 1500000000.0) {
tmp = fma(y, (4.0 * t), (x * x));
} else if (z <= 6.4e+160) {
tmp = fma(y, ((z * z) * -4.0), (x * x));
} else {
tmp = (z * (z * y)) * -4.0;
}
return tmp;
}
function code(x, y, z, t) tmp = 0.0 if (z <= 1500000000.0) tmp = fma(y, Float64(4.0 * t), Float64(x * x)); elseif (z <= 6.4e+160) tmp = fma(y, Float64(Float64(z * z) * -4.0), Float64(x * x)); else tmp = Float64(Float64(z * Float64(z * y)) * -4.0); end return tmp end
code[x_, y_, z_, t_] := If[LessEqual[z, 1500000000.0], N[(y * N[(4.0 * t), $MachinePrecision] + N[(x * x), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 6.4e+160], N[(y * N[(N[(z * z), $MachinePrecision] * -4.0), $MachinePrecision] + N[(x * x), $MachinePrecision]), $MachinePrecision], N[(N[(z * N[(z * y), $MachinePrecision]), $MachinePrecision] * -4.0), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq 1500000000:\\
\;\;\;\;\mathsf{fma}\left(y, 4 \cdot t, x \cdot x\right)\\
\mathbf{elif}\;z \leq 6.4 \cdot 10^{+160}:\\
\;\;\;\;\mathsf{fma}\left(y, \left(z \cdot z\right) \cdot -4, x \cdot x\right)\\
\mathbf{else}:\\
\;\;\;\;\left(z \cdot \left(z \cdot y\right)\right) \cdot -4\\
\end{array}
\end{array}
if z < 1.5e9Initial program 93.7%
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-*.f6477.8
Applied rewrites77.8%
if 1.5e9 < z < 6.3999999999999995e160Initial program 96.3%
Taylor expanded in t around 0
cancel-sign-sub-invN/A
metadata-evalN/A
+-commutativeN/A
associate-*r*N/A
*-commutativeN/A
associate-*l*N/A
lower-fma.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
unpow2N/A
lower-*.f6485.3
Applied rewrites85.3%
if 6.3999999999999995e160 < z Initial program 82.8%
Taylor expanded in z around inf
associate-*r*N/A
*-commutativeN/A
associate-*l*N/A
lower-*.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f6482.8
Applied rewrites82.8%
associate-*r*N/A
associate-*r*N/A
associate-*l*N/A
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
associate-*r*N/A
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f6493.0
Applied rewrites93.0%
Final simplification80.2%
(FPCore (x y z t) :precision binary64 (if (<= (* z z) 5e+17) (fma y (* 4.0 t) (* x x)) (fma (* z (* z y)) -4.0 (* x x))))
double code(double x, double y, double z, double t) {
double tmp;
if ((z * z) <= 5e+17) {
tmp = fma(y, (4.0 * t), (x * x));
} else {
tmp = fma((z * (z * y)), -4.0, (x * x));
}
return tmp;
}
function code(x, y, z, t) tmp = 0.0 if (Float64(z * z) <= 5e+17) tmp = fma(y, Float64(4.0 * t), Float64(x * x)); else tmp = fma(Float64(z * Float64(z * y)), -4.0, Float64(x * x)); end return tmp end
code[x_, y_, z_, t_] := If[LessEqual[N[(z * z), $MachinePrecision], 5e+17], N[(y * N[(4.0 * t), $MachinePrecision] + N[(x * x), $MachinePrecision]), $MachinePrecision], N[(N[(z * N[(z * y), $MachinePrecision]), $MachinePrecision] * -4.0 + N[(x * x), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \cdot z \leq 5 \cdot 10^{+17}:\\
\;\;\;\;\mathsf{fma}\left(y, 4 \cdot t, x \cdot x\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(z \cdot \left(z \cdot y\right), -4, x \cdot x\right)\\
\end{array}
\end{array}
if (*.f64 z z) < 5e17Initial program 97.1%
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-*.f6494.4
Applied rewrites94.4%
if 5e17 < (*.f64 z z) Initial program 87.7%
Taylor expanded in z around inf
associate-*r*N/A
*-commutativeN/A
associate-*l*N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
unpow2N/A
lower-*.f6481.4
Applied rewrites81.4%
lift-*.f64N/A
lift-*.f64N/A
associate-*r*N/A
*-commutativeN/A
cancel-sign-sub-invN/A
metadata-evalN/A
associate-*l*N/A
*-commutativeN/A
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
lift-*.f64N/A
+-commutativeN/A
*-commutativeN/A
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
lower-fma.f64N/A
Applied rewrites91.1%
Final simplification92.9%
(FPCore (x y z t) :precision binary64 (if (<= z 2.4e+96) (fma y (* 4.0 t) (* x x)) (* (* z (* z y)) -4.0)))
double code(double x, double y, double z, double t) {
double tmp;
if (z <= 2.4e+96) {
tmp = fma(y, (4.0 * t), (x * x));
} else {
tmp = (z * (z * y)) * -4.0;
}
return tmp;
}
function code(x, y, z, t) tmp = 0.0 if (z <= 2.4e+96) tmp = fma(y, Float64(4.0 * t), Float64(x * x)); else tmp = Float64(Float64(z * Float64(z * y)) * -4.0); end return tmp end
code[x_, y_, z_, t_] := If[LessEqual[z, 2.4e+96], N[(y * N[(4.0 * t), $MachinePrecision] + N[(x * x), $MachinePrecision]), $MachinePrecision], N[(N[(z * N[(z * y), $MachinePrecision]), $MachinePrecision] * -4.0), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq 2.4 \cdot 10^{+96}:\\
\;\;\;\;\mathsf{fma}\left(y, 4 \cdot t, x \cdot x\right)\\
\mathbf{else}:\\
\;\;\;\;\left(z \cdot \left(z \cdot y\right)\right) \cdot -4\\
\end{array}
\end{array}
if z < 2.39999999999999993e96Initial program 94.0%
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-*.f6476.7
Applied rewrites76.7%
if 2.39999999999999993e96 < z Initial program 86.6%
Taylor expanded in z around inf
associate-*r*N/A
*-commutativeN/A
associate-*l*N/A
lower-*.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f6484.3
Applied rewrites84.3%
associate-*r*N/A
associate-*r*N/A
associate-*l*N/A
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
associate-*r*N/A
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f6488.7
Applied rewrites88.7%
Final simplification78.7%
(FPCore (x y z t) :precision binary64 (if (<= x 2.2e+77) (* y (* 4.0 t)) (* x x)))
double code(double x, double y, double z, double t) {
double tmp;
if (x <= 2.2e+77) {
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 <= 2.2d+77) 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 <= 2.2e+77) {
tmp = y * (4.0 * t);
} else {
tmp = x * x;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if x <= 2.2e+77: tmp = y * (4.0 * t) else: tmp = x * x return tmp
function code(x, y, z, t) tmp = 0.0 if (x <= 2.2e+77) 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 <= 2.2e+77) tmp = y * (4.0 * t); else tmp = x * x; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[x, 2.2e+77], N[(y * N[(4.0 * t), $MachinePrecision]), $MachinePrecision], N[(x * x), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq 2.2 \cdot 10^{+77}:\\
\;\;\;\;y \cdot \left(4 \cdot t\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot x\\
\end{array}
\end{array}
if x < 2.2e77Initial program 93.8%
Taylor expanded in t around inf
associate-*r*N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6441.6
Applied rewrites41.6%
if 2.2e77 < x Initial program 88.5%
Taylor expanded in x around inf
unpow2N/A
lower-*.f6483.0
Applied rewrites83.0%
Final simplification50.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 92.7%
Taylor expanded in x around inf
unpow2N/A
lower-*.f6439.0
Applied rewrites39.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 2024216
(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))))