
(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 7 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}
z_m = (fabs.f64 z)
(FPCore (x y z_m t)
:precision binary64
(let* ((t_1 (* z_m (* y -4.0))))
(if (<= z_m 3.7e+198)
(fma t_1 z_m (fma -4.0 (* y (- t)) (* x x)))
(* z_m t_1))))z_m = fabs(z);
double code(double x, double y, double z_m, double t) {
double t_1 = z_m * (y * -4.0);
double tmp;
if (z_m <= 3.7e+198) {
tmp = fma(t_1, z_m, fma(-4.0, (y * -t), (x * x)));
} else {
tmp = z_m * t_1;
}
return tmp;
}
z_m = abs(z) function code(x, y, z_m, t) t_1 = Float64(z_m * Float64(y * -4.0)) tmp = 0.0 if (z_m <= 3.7e+198) tmp = fma(t_1, z_m, fma(-4.0, Float64(y * Float64(-t)), Float64(x * x))); else tmp = Float64(z_m * t_1); end return tmp end
z_m = N[Abs[z], $MachinePrecision]
code[x_, y_, z$95$m_, t_] := Block[{t$95$1 = N[(z$95$m * N[(y * -4.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z$95$m, 3.7e+198], N[(t$95$1 * z$95$m + N[(-4.0 * N[(y * (-t)), $MachinePrecision] + N[(x * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(z$95$m * t$95$1), $MachinePrecision]]]
\begin{array}{l}
z_m = \left|z\right|
\\
\begin{array}{l}
t_1 := z\_m \cdot \left(y \cdot -4\right)\\
\mathbf{if}\;z\_m \leq 3.7 \cdot 10^{+198}:\\
\;\;\;\;\mathsf{fma}\left(t\_1, z\_m, \mathsf{fma}\left(-4, y \cdot \left(-t\right), x \cdot x\right)\right)\\
\mathbf{else}:\\
\;\;\;\;z\_m \cdot t\_1\\
\end{array}
\end{array}
if z < 3.6999999999999998e198Initial program 93.5%
lift--.f64N/A
sub-negN/A
+-commutativeN/A
lift-*.f64N/A
distribute-lft-neg-inN/A
lift--.f64N/A
sub-negN/A
distribute-lft-inN/A
associate-+l+N/A
lift-*.f64N/A
associate-*r*N/A
lower-fma.f64N/A
lower-*.f64N/A
lift-*.f64N/A
distribute-rgt-neg-inN/A
lower-*.f64N/A
metadata-evalN/A
Applied rewrites94.5%
if 3.6999999999999998e198 < z Initial program 93.3%
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-*.f64100.0
Applied rewrites100.0%
Applied rewrites93.9%
Final simplification94.5%
z_m = (fabs.f64 z)
(FPCore (x y z_m t)
:precision binary64
(let* ((t_1 (- (* z_m z_m) t)))
(if (<= t_1 -5e-65)
(* y (* t 4.0))
(if (<= t_1 5e+303)
(fma y (* -4.0 (* z_m z_m)) (* x x))
(* z_m (* z_m (* y -4.0)))))))z_m = fabs(z);
double code(double x, double y, double z_m, double t) {
double t_1 = (z_m * z_m) - t;
double tmp;
if (t_1 <= -5e-65) {
tmp = y * (t * 4.0);
} else if (t_1 <= 5e+303) {
tmp = fma(y, (-4.0 * (z_m * z_m)), (x * x));
} else {
tmp = z_m * (z_m * (y * -4.0));
}
return tmp;
}
z_m = abs(z) function code(x, y, z_m, t) t_1 = Float64(Float64(z_m * z_m) - t) tmp = 0.0 if (t_1 <= -5e-65) tmp = Float64(y * Float64(t * 4.0)); elseif (t_1 <= 5e+303) tmp = fma(y, Float64(-4.0 * Float64(z_m * z_m)), Float64(x * x)); else tmp = Float64(z_m * Float64(z_m * Float64(y * -4.0))); end return tmp end
z_m = N[Abs[z], $MachinePrecision]
code[x_, y_, z$95$m_, t_] := Block[{t$95$1 = N[(N[(z$95$m * z$95$m), $MachinePrecision] - t), $MachinePrecision]}, If[LessEqual[t$95$1, -5e-65], N[(y * N[(t * 4.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 5e+303], N[(y * N[(-4.0 * N[(z$95$m * z$95$m), $MachinePrecision]), $MachinePrecision] + N[(x * x), $MachinePrecision]), $MachinePrecision], N[(z$95$m * N[(z$95$m * N[(y * -4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
z_m = \left|z\right|
\\
\begin{array}{l}
t_1 := z\_m \cdot z\_m - t\\
\mathbf{if}\;t\_1 \leq -5 \cdot 10^{-65}:\\
\;\;\;\;y \cdot \left(t \cdot 4\right)\\
\mathbf{elif}\;t\_1 \leq 5 \cdot 10^{+303}:\\
\;\;\;\;\mathsf{fma}\left(y, -4 \cdot \left(z\_m \cdot z\_m\right), x \cdot x\right)\\
\mathbf{else}:\\
\;\;\;\;z\_m \cdot \left(z\_m \cdot \left(y \cdot -4\right)\right)\\
\end{array}
\end{array}
if (-.f64 (*.f64 z z) t) < -4.99999999999999983e-65Initial program 100.0%
Taylor expanded in t around inf
associate-*r*N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6469.3
Applied rewrites69.3%
if -4.99999999999999983e-65 < (-.f64 (*.f64 z z) t) < 4.9999999999999997e303Initial program 97.4%
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-*.f6478.1
Applied rewrites78.1%
if 4.9999999999999997e303 < (-.f64 (*.f64 z z) t) Initial program 78.1%
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-*.f6488.4
Applied rewrites88.4%
Applied rewrites90.0%
Final simplification79.4%
z_m = (fabs.f64 z)
(FPCore (x y z_m t)
:precision binary64
(if (<= (* z_m z_m) 1e-321)
(* x x)
(if (<= (* z_m z_m) 8e-196)
(* y (* t 4.0))
(if (<= (* z_m z_m) 5e+114) (* x x) (* y (* -4.0 (* z_m z_m)))))))z_m = fabs(z);
double code(double x, double y, double z_m, double t) {
double tmp;
if ((z_m * z_m) <= 1e-321) {
tmp = x * x;
} else if ((z_m * z_m) <= 8e-196) {
tmp = y * (t * 4.0);
} else if ((z_m * z_m) <= 5e+114) {
tmp = x * x;
} else {
tmp = y * (-4.0 * (z_m * z_m));
}
return tmp;
}
z_m = abs(z)
real(8) function code(x, y, z_m, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z_m
real(8), intent (in) :: t
real(8) :: tmp
if ((z_m * z_m) <= 1d-321) then
tmp = x * x
else if ((z_m * z_m) <= 8d-196) then
tmp = y * (t * 4.0d0)
else if ((z_m * z_m) <= 5d+114) then
tmp = x * x
else
tmp = y * ((-4.0d0) * (z_m * z_m))
end if
code = tmp
end function
z_m = Math.abs(z);
public static double code(double x, double y, double z_m, double t) {
double tmp;
if ((z_m * z_m) <= 1e-321) {
tmp = x * x;
} else if ((z_m * z_m) <= 8e-196) {
tmp = y * (t * 4.0);
} else if ((z_m * z_m) <= 5e+114) {
tmp = x * x;
} else {
tmp = y * (-4.0 * (z_m * z_m));
}
return tmp;
}
z_m = math.fabs(z) def code(x, y, z_m, t): tmp = 0 if (z_m * z_m) <= 1e-321: tmp = x * x elif (z_m * z_m) <= 8e-196: tmp = y * (t * 4.0) elif (z_m * z_m) <= 5e+114: tmp = x * x else: tmp = y * (-4.0 * (z_m * z_m)) return tmp
z_m = abs(z) function code(x, y, z_m, t) tmp = 0.0 if (Float64(z_m * z_m) <= 1e-321) tmp = Float64(x * x); elseif (Float64(z_m * z_m) <= 8e-196) tmp = Float64(y * Float64(t * 4.0)); elseif (Float64(z_m * z_m) <= 5e+114) tmp = Float64(x * x); else tmp = Float64(y * Float64(-4.0 * Float64(z_m * z_m))); end return tmp end
z_m = abs(z); function tmp_2 = code(x, y, z_m, t) tmp = 0.0; if ((z_m * z_m) <= 1e-321) tmp = x * x; elseif ((z_m * z_m) <= 8e-196) tmp = y * (t * 4.0); elseif ((z_m * z_m) <= 5e+114) tmp = x * x; else tmp = y * (-4.0 * (z_m * z_m)); end tmp_2 = tmp; end
z_m = N[Abs[z], $MachinePrecision] code[x_, y_, z$95$m_, t_] := If[LessEqual[N[(z$95$m * z$95$m), $MachinePrecision], 1e-321], N[(x * x), $MachinePrecision], If[LessEqual[N[(z$95$m * z$95$m), $MachinePrecision], 8e-196], N[(y * N[(t * 4.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(z$95$m * z$95$m), $MachinePrecision], 5e+114], N[(x * x), $MachinePrecision], N[(y * N[(-4.0 * N[(z$95$m * z$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
z_m = \left|z\right|
\\
\begin{array}{l}
\mathbf{if}\;z\_m \cdot z\_m \leq 10^{-321}:\\
\;\;\;\;x \cdot x\\
\mathbf{elif}\;z\_m \cdot z\_m \leq 8 \cdot 10^{-196}:\\
\;\;\;\;y \cdot \left(t \cdot 4\right)\\
\mathbf{elif}\;z\_m \cdot z\_m \leq 5 \cdot 10^{+114}:\\
\;\;\;\;x \cdot x\\
\mathbf{else}:\\
\;\;\;\;y \cdot \left(-4 \cdot \left(z\_m \cdot z\_m\right)\right)\\
\end{array}
\end{array}
if (*.f64 z z) < 9.98013e-322 or 8.0000000000000004e-196 < (*.f64 z z) < 5.0000000000000001e114Initial program 99.2%
Taylor expanded in x around inf
unpow2N/A
lower-*.f6456.8
Applied rewrites56.8%
if 9.98013e-322 < (*.f64 z z) < 8.0000000000000004e-196Initial program 92.0%
Taylor expanded in t around inf
associate-*r*N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6473.2
Applied rewrites73.2%
if 5.0000000000000001e114 < (*.f64 z z) Initial program 86.4%
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-*.f6480.1
Applied rewrites80.1%
z_m = (fabs.f64 z)
(FPCore (x y z_m t)
:precision binary64
(if (<= z_m 6.4e-161)
(* x x)
(if (<= z_m 1.15e-98)
(* y (* t 4.0))
(if (<= z_m 5.2e+55) (* x x) (* z_m (* z_m (* y -4.0)))))))z_m = fabs(z);
double code(double x, double y, double z_m, double t) {
double tmp;
if (z_m <= 6.4e-161) {
tmp = x * x;
} else if (z_m <= 1.15e-98) {
tmp = y * (t * 4.0);
} else if (z_m <= 5.2e+55) {
tmp = x * x;
} else {
tmp = z_m * (z_m * (y * -4.0));
}
return tmp;
}
z_m = abs(z)
real(8) function code(x, y, z_m, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z_m
real(8), intent (in) :: t
real(8) :: tmp
if (z_m <= 6.4d-161) then
tmp = x * x
else if (z_m <= 1.15d-98) then
tmp = y * (t * 4.0d0)
else if (z_m <= 5.2d+55) then
tmp = x * x
else
tmp = z_m * (z_m * (y * (-4.0d0)))
end if
code = tmp
end function
z_m = Math.abs(z);
public static double code(double x, double y, double z_m, double t) {
double tmp;
if (z_m <= 6.4e-161) {
tmp = x * x;
} else if (z_m <= 1.15e-98) {
tmp = y * (t * 4.0);
} else if (z_m <= 5.2e+55) {
tmp = x * x;
} else {
tmp = z_m * (z_m * (y * -4.0));
}
return tmp;
}
z_m = math.fabs(z) def code(x, y, z_m, t): tmp = 0 if z_m <= 6.4e-161: tmp = x * x elif z_m <= 1.15e-98: tmp = y * (t * 4.0) elif z_m <= 5.2e+55: tmp = x * x else: tmp = z_m * (z_m * (y * -4.0)) return tmp
z_m = abs(z) function code(x, y, z_m, t) tmp = 0.0 if (z_m <= 6.4e-161) tmp = Float64(x * x); elseif (z_m <= 1.15e-98) tmp = Float64(y * Float64(t * 4.0)); elseif (z_m <= 5.2e+55) tmp = Float64(x * x); else tmp = Float64(z_m * Float64(z_m * Float64(y * -4.0))); end return tmp end
z_m = abs(z); function tmp_2 = code(x, y, z_m, t) tmp = 0.0; if (z_m <= 6.4e-161) tmp = x * x; elseif (z_m <= 1.15e-98) tmp = y * (t * 4.0); elseif (z_m <= 5.2e+55) tmp = x * x; else tmp = z_m * (z_m * (y * -4.0)); end tmp_2 = tmp; end
z_m = N[Abs[z], $MachinePrecision] code[x_, y_, z$95$m_, t_] := If[LessEqual[z$95$m, 6.4e-161], N[(x * x), $MachinePrecision], If[LessEqual[z$95$m, 1.15e-98], N[(y * N[(t * 4.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[z$95$m, 5.2e+55], N[(x * x), $MachinePrecision], N[(z$95$m * N[(z$95$m * N[(y * -4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
z_m = \left|z\right|
\\
\begin{array}{l}
\mathbf{if}\;z\_m \leq 6.4 \cdot 10^{-161}:\\
\;\;\;\;x \cdot x\\
\mathbf{elif}\;z\_m \leq 1.15 \cdot 10^{-98}:\\
\;\;\;\;y \cdot \left(t \cdot 4\right)\\
\mathbf{elif}\;z\_m \leq 5.2 \cdot 10^{+55}:\\
\;\;\;\;x \cdot x\\
\mathbf{else}:\\
\;\;\;\;z\_m \cdot \left(z\_m \cdot \left(y \cdot -4\right)\right)\\
\end{array}
\end{array}
if z < 6.39999999999999971e-161 or 1.15e-98 < z < 5.2e55Initial program 95.0%
Taylor expanded in x around inf
unpow2N/A
lower-*.f6444.4
Applied rewrites44.4%
if 6.39999999999999971e-161 < z < 1.15e-98Initial program 92.3%
Taylor expanded in t around inf
associate-*r*N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6471.2
Applied rewrites71.2%
if 5.2e55 < z Initial program 86.4%
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-*.f6477.7
Applied rewrites77.7%
Applied rewrites75.4%
Final simplification51.0%
z_m = (fabs.f64 z) (FPCore (x y z_m t) :precision binary64 (if (<= z_m 2e+175) (+ (* x x) (* (* y 4.0) (- t (* z_m z_m)))) (* z_m (* z_m (* y -4.0)))))
z_m = fabs(z);
double code(double x, double y, double z_m, double t) {
double tmp;
if (z_m <= 2e+175) {
tmp = (x * x) + ((y * 4.0) * (t - (z_m * z_m)));
} else {
tmp = z_m * (z_m * (y * -4.0));
}
return tmp;
}
z_m = abs(z)
real(8) function code(x, y, z_m, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z_m
real(8), intent (in) :: t
real(8) :: tmp
if (z_m <= 2d+175) then
tmp = (x * x) + ((y * 4.0d0) * (t - (z_m * z_m)))
else
tmp = z_m * (z_m * (y * (-4.0d0)))
end if
code = tmp
end function
z_m = Math.abs(z);
public static double code(double x, double y, double z_m, double t) {
double tmp;
if (z_m <= 2e+175) {
tmp = (x * x) + ((y * 4.0) * (t - (z_m * z_m)));
} else {
tmp = z_m * (z_m * (y * -4.0));
}
return tmp;
}
z_m = math.fabs(z) def code(x, y, z_m, t): tmp = 0 if z_m <= 2e+175: tmp = (x * x) + ((y * 4.0) * (t - (z_m * z_m))) else: tmp = z_m * (z_m * (y * -4.0)) return tmp
z_m = abs(z) function code(x, y, z_m, t) tmp = 0.0 if (z_m <= 2e+175) tmp = Float64(Float64(x * x) + Float64(Float64(y * 4.0) * Float64(t - Float64(z_m * z_m)))); else tmp = Float64(z_m * Float64(z_m * Float64(y * -4.0))); end return tmp end
z_m = abs(z); function tmp_2 = code(x, y, z_m, t) tmp = 0.0; if (z_m <= 2e+175) tmp = (x * x) + ((y * 4.0) * (t - (z_m * z_m))); else tmp = z_m * (z_m * (y * -4.0)); end tmp_2 = tmp; end
z_m = N[Abs[z], $MachinePrecision] code[x_, y_, z$95$m_, t_] := If[LessEqual[z$95$m, 2e+175], N[(N[(x * x), $MachinePrecision] + N[(N[(y * 4.0), $MachinePrecision] * N[(t - N[(z$95$m * z$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(z$95$m * N[(z$95$m * N[(y * -4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
z_m = \left|z\right|
\\
\begin{array}{l}
\mathbf{if}\;z\_m \leq 2 \cdot 10^{+175}:\\
\;\;\;\;x \cdot x + \left(y \cdot 4\right) \cdot \left(t - z\_m \cdot z\_m\right)\\
\mathbf{else}:\\
\;\;\;\;z\_m \cdot \left(z\_m \cdot \left(y \cdot -4\right)\right)\\
\end{array}
\end{array}
if z < 1.9999999999999999e175Initial program 94.6%
if 1.9999999999999999e175 < z Initial program 81.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-*.f6485.9
Applied rewrites85.9%
Applied rewrites81.6%
Final simplification93.5%
z_m = (fabs.f64 z) (FPCore (x y z_m t) :precision binary64 (if (<= x 1.35e+40) (* y (* t 4.0)) (* x x)))
z_m = fabs(z);
double code(double x, double y, double z_m, double t) {
double tmp;
if (x <= 1.35e+40) {
tmp = y * (t * 4.0);
} else {
tmp = x * x;
}
return tmp;
}
z_m = abs(z)
real(8) function code(x, y, z_m, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z_m
real(8), intent (in) :: t
real(8) :: tmp
if (x <= 1.35d+40) then
tmp = y * (t * 4.0d0)
else
tmp = x * x
end if
code = tmp
end function
z_m = Math.abs(z);
public static double code(double x, double y, double z_m, double t) {
double tmp;
if (x <= 1.35e+40) {
tmp = y * (t * 4.0);
} else {
tmp = x * x;
}
return tmp;
}
z_m = math.fabs(z) def code(x, y, z_m, t): tmp = 0 if x <= 1.35e+40: tmp = y * (t * 4.0) else: tmp = x * x return tmp
z_m = abs(z) function code(x, y, z_m, t) tmp = 0.0 if (x <= 1.35e+40) tmp = Float64(y * Float64(t * 4.0)); else tmp = Float64(x * x); end return tmp end
z_m = abs(z); function tmp_2 = code(x, y, z_m, t) tmp = 0.0; if (x <= 1.35e+40) tmp = y * (t * 4.0); else tmp = x * x; end tmp_2 = tmp; end
z_m = N[Abs[z], $MachinePrecision] code[x_, y_, z$95$m_, t_] := If[LessEqual[x, 1.35e+40], N[(y * N[(t * 4.0), $MachinePrecision]), $MachinePrecision], N[(x * x), $MachinePrecision]]
\begin{array}{l}
z_m = \left|z\right|
\\
\begin{array}{l}
\mathbf{if}\;x \leq 1.35 \cdot 10^{+40}:\\
\;\;\;\;y \cdot \left(t \cdot 4\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot x\\
\end{array}
\end{array}
if x < 1.35000000000000005e40Initial program 93.6%
Taylor expanded in t around inf
associate-*r*N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6437.1
Applied rewrites37.1%
if 1.35000000000000005e40 < x Initial program 93.1%
Taylor expanded in x around inf
unpow2N/A
lower-*.f6475.0
Applied rewrites75.0%
z_m = (fabs.f64 z) (FPCore (x y z_m t) :precision binary64 (* x x))
z_m = fabs(z);
double code(double x, double y, double z_m, double t) {
return x * x;
}
z_m = abs(z)
real(8) function code(x, y, z_m, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z_m
real(8), intent (in) :: t
code = x * x
end function
z_m = Math.abs(z);
public static double code(double x, double y, double z_m, double t) {
return x * x;
}
z_m = math.fabs(z) def code(x, y, z_m, t): return x * x
z_m = abs(z) function code(x, y, z_m, t) return Float64(x * x) end
z_m = abs(z); function tmp = code(x, y, z_m, t) tmp = x * x; end
z_m = N[Abs[z], $MachinePrecision] code[x_, y_, z$95$m_, t_] := N[(x * x), $MachinePrecision]
\begin{array}{l}
z_m = \left|z\right|
\\
x \cdot x
\end{array}
Initial program 93.5%
Taylor expanded in x around inf
unpow2N/A
lower-*.f6441.7
Applied rewrites41.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 2024238
(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))))