
(FPCore (x y z t) :precision binary64 (+ (* x (+ (+ (+ (+ y z) z) y) t)) (* y 5.0)))
double code(double x, double y, double z, double t) {
return (x * ((((y + z) + z) + y) + t)) + (y * 5.0);
}
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 * ((((y + z) + z) + y) + t)) + (y * 5.0d0)
end function
public static double code(double x, double y, double z, double t) {
return (x * ((((y + z) + z) + y) + t)) + (y * 5.0);
}
def code(x, y, z, t): return (x * ((((y + z) + z) + y) + t)) + (y * 5.0)
function code(x, y, z, t) return Float64(Float64(x * Float64(Float64(Float64(Float64(y + z) + z) + y) + t)) + Float64(y * 5.0)) end
function tmp = code(x, y, z, t) tmp = (x * ((((y + z) + z) + y) + t)) + (y * 5.0); end
code[x_, y_, z_, t_] := N[(N[(x * N[(N[(N[(N[(y + z), $MachinePrecision] + z), $MachinePrecision] + y), $MachinePrecision] + t), $MachinePrecision]), $MachinePrecision] + N[(y * 5.0), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x \cdot \left(\left(\left(\left(y + z\right) + z\right) + y\right) + t\right) + y \cdot 5
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 16 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t) :precision binary64 (+ (* x (+ (+ (+ (+ y z) z) y) t)) (* y 5.0)))
double code(double x, double y, double z, double t) {
return (x * ((((y + z) + z) + y) + t)) + (y * 5.0);
}
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 * ((((y + z) + z) + y) + t)) + (y * 5.0d0)
end function
public static double code(double x, double y, double z, double t) {
return (x * ((((y + z) + z) + y) + t)) + (y * 5.0);
}
def code(x, y, z, t): return (x * ((((y + z) + z) + y) + t)) + (y * 5.0)
function code(x, y, z, t) return Float64(Float64(x * Float64(Float64(Float64(Float64(y + z) + z) + y) + t)) + Float64(y * 5.0)) end
function tmp = code(x, y, z, t) tmp = (x * ((((y + z) + z) + y) + t)) + (y * 5.0); end
code[x_, y_, z_, t_] := N[(N[(x * N[(N[(N[(N[(y + z), $MachinePrecision] + z), $MachinePrecision] + y), $MachinePrecision] + t), $MachinePrecision]), $MachinePrecision] + N[(y * 5.0), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x \cdot \left(\left(\left(\left(y + z\right) + z\right) + y\right) + t\right) + y \cdot 5
\end{array}
(FPCore (x y z t) :precision binary64 (+ (* x (+ (+ y (+ z (+ y z))) t)) (* y 5.0)))
double code(double x, double y, double z, double t) {
return (x * ((y + (z + (y + z))) + t)) + (y * 5.0);
}
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 * ((y + (z + (y + z))) + t)) + (y * 5.0d0)
end function
public static double code(double x, double y, double z, double t) {
return (x * ((y + (z + (y + z))) + t)) + (y * 5.0);
}
def code(x, y, z, t): return (x * ((y + (z + (y + z))) + t)) + (y * 5.0)
function code(x, y, z, t) return Float64(Float64(x * Float64(Float64(y + Float64(z + Float64(y + z))) + t)) + Float64(y * 5.0)) end
function tmp = code(x, y, z, t) tmp = (x * ((y + (z + (y + z))) + t)) + (y * 5.0); end
code[x_, y_, z_, t_] := N[(N[(x * N[(N[(y + N[(z + N[(y + z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + t), $MachinePrecision]), $MachinePrecision] + N[(y * 5.0), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x \cdot \left(\left(y + \left(z + \left(y + z\right)\right)\right) + t\right) + y \cdot 5
\end{array}
Initial program 99.9%
Final simplification99.9%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* x (fma 2.0 (+ y z) t))))
(if (<= x -650.0)
t_1
(if (<= x -1.05e-278)
(fma 5.0 y (* x (fma y 2.0 t)))
(if (<= x 1.4e-8) (fma (+ z z) x (* y 5.0)) t_1)))))
double code(double x, double y, double z, double t) {
double t_1 = x * fma(2.0, (y + z), t);
double tmp;
if (x <= -650.0) {
tmp = t_1;
} else if (x <= -1.05e-278) {
tmp = fma(5.0, y, (x * fma(y, 2.0, t)));
} else if (x <= 1.4e-8) {
tmp = fma((z + z), x, (y * 5.0));
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t) t_1 = Float64(x * fma(2.0, Float64(y + z), t)) tmp = 0.0 if (x <= -650.0) tmp = t_1; elseif (x <= -1.05e-278) tmp = fma(5.0, y, Float64(x * fma(y, 2.0, t))); elseif (x <= 1.4e-8) tmp = fma(Float64(z + z), x, Float64(y * 5.0)); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(x * N[(2.0 * N[(y + z), $MachinePrecision] + t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -650.0], t$95$1, If[LessEqual[x, -1.05e-278], N[(5.0 * y + N[(x * N[(y * 2.0 + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 1.4e-8], N[(N[(z + z), $MachinePrecision] * x + N[(y * 5.0), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot \mathsf{fma}\left(2, y + z, t\right)\\
\mathbf{if}\;x \leq -650:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \leq -1.05 \cdot 10^{-278}:\\
\;\;\;\;\mathsf{fma}\left(5, y, x \cdot \mathsf{fma}\left(y, 2, t\right)\right)\\
\mathbf{elif}\;x \leq 1.4 \cdot 10^{-8}:\\
\;\;\;\;\mathsf{fma}\left(z + z, x, y \cdot 5\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if x < -650 or 1.4e-8 < x Initial program 99.9%
Taylor expanded in x around inf
lower-*.f64N/A
+-commutativeN/A
distribute-lft-outN/A
lower-fma.f64N/A
lower-+.f6499.6
Applied rewrites99.6%
if -650 < x < -1.05000000000000007e-278Initial program 99.9%
Taylor expanded in z around 0
lower-fma.f64N/A
lower-*.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f6480.1
Applied rewrites80.1%
if -1.05000000000000007e-278 < x < 1.4e-8Initial program 99.9%
lift-+.f64N/A
lift-*.f64N/A
lift-+.f64N/A
distribute-rgt-inN/A
associate-+l+N/A
lower-fma.f64N/A
lift-+.f64N/A
lift-+.f64N/A
associate-+l+N/A
+-commutativeN/A
lift-+.f64N/A
flip-+N/A
+-inversesN/A
+-inversesN/A
+-inversesN/A
+-inversesN/A
flip-+N/A
lower-+.f64N/A
*-commutativeN/A
lower-fma.f6499.6
Applied rewrites99.6%
Taylor expanded in t around 0
lower-*.f6488.3
Applied rewrites88.3%
Final simplification91.6%
(FPCore (x y z t)
:precision binary64
(if (<= x -3.4e-28)
(* x (+ (+ y z) (+ (+ y z) t)))
(if (<= x -1.05e-278)
(fma x t (* y 5.0))
(if (<= x 1.4e-8) (fma (+ z z) x (* y 5.0)) (* x (fma 2.0 (+ y z) t))))))
double code(double x, double y, double z, double t) {
double tmp;
if (x <= -3.4e-28) {
tmp = x * ((y + z) + ((y + z) + t));
} else if (x <= -1.05e-278) {
tmp = fma(x, t, (y * 5.0));
} else if (x <= 1.4e-8) {
tmp = fma((z + z), x, (y * 5.0));
} else {
tmp = x * fma(2.0, (y + z), t);
}
return tmp;
}
function code(x, y, z, t) tmp = 0.0 if (x <= -3.4e-28) tmp = Float64(x * Float64(Float64(y + z) + Float64(Float64(y + z) + t))); elseif (x <= -1.05e-278) tmp = fma(x, t, Float64(y * 5.0)); elseif (x <= 1.4e-8) tmp = fma(Float64(z + z), x, Float64(y * 5.0)); else tmp = Float64(x * fma(2.0, Float64(y + z), t)); end return tmp end
code[x_, y_, z_, t_] := If[LessEqual[x, -3.4e-28], N[(x * N[(N[(y + z), $MachinePrecision] + N[(N[(y + z), $MachinePrecision] + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, -1.05e-278], N[(x * t + N[(y * 5.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 1.4e-8], N[(N[(z + z), $MachinePrecision] * x + N[(y * 5.0), $MachinePrecision]), $MachinePrecision], N[(x * N[(2.0 * N[(y + z), $MachinePrecision] + t), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -3.4 \cdot 10^{-28}:\\
\;\;\;\;x \cdot \left(\left(y + z\right) + \left(\left(y + z\right) + t\right)\right)\\
\mathbf{elif}\;x \leq -1.05 \cdot 10^{-278}:\\
\;\;\;\;\mathsf{fma}\left(x, t, y \cdot 5\right)\\
\mathbf{elif}\;x \leq 1.4 \cdot 10^{-8}:\\
\;\;\;\;\mathsf{fma}\left(z + z, x, y \cdot 5\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot \mathsf{fma}\left(2, y + z, t\right)\\
\end{array}
\end{array}
if x < -3.4000000000000001e-28Initial program 99.9%
Taylor expanded in x around inf
lower-*.f64N/A
+-commutativeN/A
distribute-lft-outN/A
lower-fma.f64N/A
lower-+.f6495.8
Applied rewrites95.8%
Applied rewrites95.8%
if -3.4000000000000001e-28 < x < -1.05000000000000007e-278Initial program 99.9%
lift-+.f64N/A
lift-*.f64N/A
lift-+.f64N/A
distribute-rgt-inN/A
associate-+l+N/A
lower-fma.f64N/A
lift-+.f64N/A
lift-+.f64N/A
associate-+l+N/A
+-commutativeN/A
lift-+.f64N/A
flip-+N/A
+-inversesN/A
+-inversesN/A
+-inversesN/A
+-inversesN/A
flip-+N/A
lower-+.f64N/A
*-commutativeN/A
lower-fma.f64100.0
Applied rewrites100.0%
Taylor expanded in z around 0
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower-*.f6482.3
Applied rewrites82.3%
if -1.05000000000000007e-278 < x < 1.4e-8Initial program 99.9%
lift-+.f64N/A
lift-*.f64N/A
lift-+.f64N/A
distribute-rgt-inN/A
associate-+l+N/A
lower-fma.f64N/A
lift-+.f64N/A
lift-+.f64N/A
associate-+l+N/A
+-commutativeN/A
lift-+.f64N/A
flip-+N/A
+-inversesN/A
+-inversesN/A
+-inversesN/A
+-inversesN/A
flip-+N/A
lower-+.f64N/A
*-commutativeN/A
lower-fma.f6499.6
Applied rewrites99.6%
Taylor expanded in t around 0
lower-*.f6488.3
Applied rewrites88.3%
if 1.4e-8 < x Initial program 100.0%
Taylor expanded in x around inf
lower-*.f64N/A
+-commutativeN/A
distribute-lft-outN/A
lower-fma.f64N/A
lower-+.f64100.0
Applied rewrites100.0%
Final simplification91.6%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* x (fma 2.0 (+ y z) t))))
(if (<= x -3.4e-28)
t_1
(if (<= x -1.05e-278)
(fma x t (* y 5.0))
(if (<= x 1.4e-8) (fma (+ z z) x (* y 5.0)) t_1)))))
double code(double x, double y, double z, double t) {
double t_1 = x * fma(2.0, (y + z), t);
double tmp;
if (x <= -3.4e-28) {
tmp = t_1;
} else if (x <= -1.05e-278) {
tmp = fma(x, t, (y * 5.0));
} else if (x <= 1.4e-8) {
tmp = fma((z + z), x, (y * 5.0));
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t) t_1 = Float64(x * fma(2.0, Float64(y + z), t)) tmp = 0.0 if (x <= -3.4e-28) tmp = t_1; elseif (x <= -1.05e-278) tmp = fma(x, t, Float64(y * 5.0)); elseif (x <= 1.4e-8) tmp = fma(Float64(z + z), x, Float64(y * 5.0)); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(x * N[(2.0 * N[(y + z), $MachinePrecision] + t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -3.4e-28], t$95$1, If[LessEqual[x, -1.05e-278], N[(x * t + N[(y * 5.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 1.4e-8], N[(N[(z + z), $MachinePrecision] * x + N[(y * 5.0), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot \mathsf{fma}\left(2, y + z, t\right)\\
\mathbf{if}\;x \leq -3.4 \cdot 10^{-28}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \leq -1.05 \cdot 10^{-278}:\\
\;\;\;\;\mathsf{fma}\left(x, t, y \cdot 5\right)\\
\mathbf{elif}\;x \leq 1.4 \cdot 10^{-8}:\\
\;\;\;\;\mathsf{fma}\left(z + z, x, y \cdot 5\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if x < -3.4000000000000001e-28 or 1.4e-8 < x Initial program 99.9%
Taylor expanded in x around inf
lower-*.f64N/A
+-commutativeN/A
distribute-lft-outN/A
lower-fma.f64N/A
lower-+.f6497.2
Applied rewrites97.2%
if -3.4000000000000001e-28 < x < -1.05000000000000007e-278Initial program 99.9%
lift-+.f64N/A
lift-*.f64N/A
lift-+.f64N/A
distribute-rgt-inN/A
associate-+l+N/A
lower-fma.f64N/A
lift-+.f64N/A
lift-+.f64N/A
associate-+l+N/A
+-commutativeN/A
lift-+.f64N/A
flip-+N/A
+-inversesN/A
+-inversesN/A
+-inversesN/A
+-inversesN/A
flip-+N/A
lower-+.f64N/A
*-commutativeN/A
lower-fma.f64100.0
Applied rewrites100.0%
Taylor expanded in z around 0
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower-*.f6482.3
Applied rewrites82.3%
if -1.05000000000000007e-278 < x < 1.4e-8Initial program 99.9%
lift-+.f64N/A
lift-*.f64N/A
lift-+.f64N/A
distribute-rgt-inN/A
associate-+l+N/A
lower-fma.f64N/A
lift-+.f64N/A
lift-+.f64N/A
associate-+l+N/A
+-commutativeN/A
lift-+.f64N/A
flip-+N/A
+-inversesN/A
+-inversesN/A
+-inversesN/A
+-inversesN/A
flip-+N/A
lower-+.f64N/A
*-commutativeN/A
lower-fma.f6499.6
Applied rewrites99.6%
Taylor expanded in t around 0
lower-*.f6488.3
Applied rewrites88.3%
Final simplification91.6%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* y (fma x 2.0 5.0))))
(if (<= y -6.2e+17)
t_1
(if (<= y 1.75e-112)
(* x (+ z (+ z t)))
(if (<= y 1.45e+179) (fma 5.0 y (* x t)) t_1)))))
double code(double x, double y, double z, double t) {
double t_1 = y * fma(x, 2.0, 5.0);
double tmp;
if (y <= -6.2e+17) {
tmp = t_1;
} else if (y <= 1.75e-112) {
tmp = x * (z + (z + t));
} else if (y <= 1.45e+179) {
tmp = fma(5.0, y, (x * t));
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t) t_1 = Float64(y * fma(x, 2.0, 5.0)) tmp = 0.0 if (y <= -6.2e+17) tmp = t_1; elseif (y <= 1.75e-112) tmp = Float64(x * Float64(z + Float64(z + t))); elseif (y <= 1.45e+179) tmp = fma(5.0, y, Float64(x * t)); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(y * N[(x * 2.0 + 5.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -6.2e+17], t$95$1, If[LessEqual[y, 1.75e-112], N[(x * N[(z + N[(z + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.45e+179], N[(5.0 * y + N[(x * t), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := y \cdot \mathsf{fma}\left(x, 2, 5\right)\\
\mathbf{if}\;y \leq -6.2 \cdot 10^{+17}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq 1.75 \cdot 10^{-112}:\\
\;\;\;\;x \cdot \left(z + \left(z + t\right)\right)\\
\mathbf{elif}\;y \leq 1.45 \cdot 10^{+179}:\\
\;\;\;\;\mathsf{fma}\left(5, y, x \cdot t\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y < -6.2e17 or 1.45000000000000009e179 < y Initial program 99.9%
Taylor expanded in y around inf
+-commutativeN/A
metadata-evalN/A
distribute-lft-neg-inN/A
neg-sub0N/A
associate--r-N/A
neg-sub0N/A
lower-*.f64N/A
neg-sub0N/A
associate--r-N/A
neg-sub0N/A
distribute-lft-neg-inN/A
metadata-evalN/A
*-commutativeN/A
lower-fma.f6485.7
Applied rewrites85.7%
if -6.2e17 < y < 1.74999999999999997e-112Initial program 99.9%
lift-+.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-fma.f6499.9
lift-+.f64N/A
lift-+.f64N/A
associate-+l+N/A
+-commutativeN/A
lift-+.f64N/A
flip-+N/A
+-inversesN/A
+-inversesN/A
+-inversesN/A
+-inversesN/A
flip-+N/A
lower-+.f6496.0
Applied rewrites96.0%
Taylor expanded in y around 0
lower-*.f64N/A
+-commutativeN/A
lower-fma.f6483.2
Applied rewrites83.2%
Applied rewrites83.2%
if 1.74999999999999997e-112 < y < 1.45000000000000009e179Initial program 99.9%
lift-+.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-fma.f6499.9
lift-+.f64N/A
lift-+.f64N/A
associate-+l+N/A
+-commutativeN/A
lift-+.f64N/A
flip-+N/A
+-inversesN/A
+-inversesN/A
+-inversesN/A
+-inversesN/A
flip-+N/A
lower-+.f6490.4
Applied rewrites90.4%
Taylor expanded in z around 0
lower-fma.f64N/A
*-commutativeN/A
lower-*.f6469.6
Applied rewrites69.6%
Final simplification81.2%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* y (fma x 2.0 5.0))))
(if (<= y -6.2e+17)
t_1
(if (<= y 1.75e-112)
(* x (+ z (+ z t)))
(if (<= y 1.45e+179) (fma x t (* y 5.0)) t_1)))))
double code(double x, double y, double z, double t) {
double t_1 = y * fma(x, 2.0, 5.0);
double tmp;
if (y <= -6.2e+17) {
tmp = t_1;
} else if (y <= 1.75e-112) {
tmp = x * (z + (z + t));
} else if (y <= 1.45e+179) {
tmp = fma(x, t, (y * 5.0));
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t) t_1 = Float64(y * fma(x, 2.0, 5.0)) tmp = 0.0 if (y <= -6.2e+17) tmp = t_1; elseif (y <= 1.75e-112) tmp = Float64(x * Float64(z + Float64(z + t))); elseif (y <= 1.45e+179) tmp = fma(x, t, Float64(y * 5.0)); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(y * N[(x * 2.0 + 5.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -6.2e+17], t$95$1, If[LessEqual[y, 1.75e-112], N[(x * N[(z + N[(z + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.45e+179], N[(x * t + N[(y * 5.0), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := y \cdot \mathsf{fma}\left(x, 2, 5\right)\\
\mathbf{if}\;y \leq -6.2 \cdot 10^{+17}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq 1.75 \cdot 10^{-112}:\\
\;\;\;\;x \cdot \left(z + \left(z + t\right)\right)\\
\mathbf{elif}\;y \leq 1.45 \cdot 10^{+179}:\\
\;\;\;\;\mathsf{fma}\left(x, t, y \cdot 5\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y < -6.2e17 or 1.45000000000000009e179 < y Initial program 99.9%
Taylor expanded in y around inf
+-commutativeN/A
metadata-evalN/A
distribute-lft-neg-inN/A
neg-sub0N/A
associate--r-N/A
neg-sub0N/A
lower-*.f64N/A
neg-sub0N/A
associate--r-N/A
neg-sub0N/A
distribute-lft-neg-inN/A
metadata-evalN/A
*-commutativeN/A
lower-fma.f6485.7
Applied rewrites85.7%
if -6.2e17 < y < 1.74999999999999997e-112Initial program 99.9%
lift-+.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-fma.f6499.9
lift-+.f64N/A
lift-+.f64N/A
associate-+l+N/A
+-commutativeN/A
lift-+.f64N/A
flip-+N/A
+-inversesN/A
+-inversesN/A
+-inversesN/A
+-inversesN/A
flip-+N/A
lower-+.f6496.0
Applied rewrites96.0%
Taylor expanded in y around 0
lower-*.f64N/A
+-commutativeN/A
lower-fma.f6483.2
Applied rewrites83.2%
Applied rewrites83.2%
if 1.74999999999999997e-112 < y < 1.45000000000000009e179Initial program 99.9%
lift-+.f64N/A
lift-*.f64N/A
lift-+.f64N/A
distribute-rgt-inN/A
associate-+l+N/A
lower-fma.f64N/A
lift-+.f64N/A
lift-+.f64N/A
associate-+l+N/A
+-commutativeN/A
lift-+.f64N/A
flip-+N/A
+-inversesN/A
+-inversesN/A
+-inversesN/A
+-inversesN/A
flip-+N/A
lower-+.f64N/A
*-commutativeN/A
lower-fma.f6490.4
Applied rewrites90.4%
Taylor expanded in z around 0
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower-*.f6469.6
Applied rewrites69.6%
Final simplification81.2%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* y (fma x 2.0 5.0))))
(if (<= y -6.2e+17)
t_1
(if (<= y 1.75e-112)
(* x (fma 2.0 z t))
(if (<= y 1.45e+179) (fma x t (* y 5.0)) t_1)))))
double code(double x, double y, double z, double t) {
double t_1 = y * fma(x, 2.0, 5.0);
double tmp;
if (y <= -6.2e+17) {
tmp = t_1;
} else if (y <= 1.75e-112) {
tmp = x * fma(2.0, z, t);
} else if (y <= 1.45e+179) {
tmp = fma(x, t, (y * 5.0));
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t) t_1 = Float64(y * fma(x, 2.0, 5.0)) tmp = 0.0 if (y <= -6.2e+17) tmp = t_1; elseif (y <= 1.75e-112) tmp = Float64(x * fma(2.0, z, t)); elseif (y <= 1.45e+179) tmp = fma(x, t, Float64(y * 5.0)); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(y * N[(x * 2.0 + 5.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -6.2e+17], t$95$1, If[LessEqual[y, 1.75e-112], N[(x * N[(2.0 * z + t), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.45e+179], N[(x * t + N[(y * 5.0), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := y \cdot \mathsf{fma}\left(x, 2, 5\right)\\
\mathbf{if}\;y \leq -6.2 \cdot 10^{+17}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq 1.75 \cdot 10^{-112}:\\
\;\;\;\;x \cdot \mathsf{fma}\left(2, z, t\right)\\
\mathbf{elif}\;y \leq 1.45 \cdot 10^{+179}:\\
\;\;\;\;\mathsf{fma}\left(x, t, y \cdot 5\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y < -6.2e17 or 1.45000000000000009e179 < y Initial program 99.9%
Taylor expanded in y around inf
+-commutativeN/A
metadata-evalN/A
distribute-lft-neg-inN/A
neg-sub0N/A
associate--r-N/A
neg-sub0N/A
lower-*.f64N/A
neg-sub0N/A
associate--r-N/A
neg-sub0N/A
distribute-lft-neg-inN/A
metadata-evalN/A
*-commutativeN/A
lower-fma.f6485.7
Applied rewrites85.7%
if -6.2e17 < y < 1.74999999999999997e-112Initial program 99.9%
Taylor expanded in y around 0
lower-*.f64N/A
+-commutativeN/A
lower-fma.f6483.2
Applied rewrites83.2%
if 1.74999999999999997e-112 < y < 1.45000000000000009e179Initial program 99.9%
lift-+.f64N/A
lift-*.f64N/A
lift-+.f64N/A
distribute-rgt-inN/A
associate-+l+N/A
lower-fma.f64N/A
lift-+.f64N/A
lift-+.f64N/A
associate-+l+N/A
+-commutativeN/A
lift-+.f64N/A
flip-+N/A
+-inversesN/A
+-inversesN/A
+-inversesN/A
+-inversesN/A
flip-+N/A
lower-+.f64N/A
*-commutativeN/A
lower-fma.f6490.4
Applied rewrites90.4%
Taylor expanded in z around 0
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower-*.f6469.6
Applied rewrites69.6%
Final simplification81.2%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* x (fma 2.0 (+ y z) t))))
(if (<= x -5700.0)
t_1
(if (<= x 1.8e-6) (fma (+ z (+ z t)) x (* y 5.0)) t_1))))
double code(double x, double y, double z, double t) {
double t_1 = x * fma(2.0, (y + z), t);
double tmp;
if (x <= -5700.0) {
tmp = t_1;
} else if (x <= 1.8e-6) {
tmp = fma((z + (z + t)), x, (y * 5.0));
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t) t_1 = Float64(x * fma(2.0, Float64(y + z), t)) tmp = 0.0 if (x <= -5700.0) tmp = t_1; elseif (x <= 1.8e-6) tmp = fma(Float64(z + Float64(z + t)), x, Float64(y * 5.0)); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(x * N[(2.0 * N[(y + z), $MachinePrecision] + t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -5700.0], t$95$1, If[LessEqual[x, 1.8e-6], N[(N[(z + N[(z + t), $MachinePrecision]), $MachinePrecision] * x + N[(y * 5.0), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot \mathsf{fma}\left(2, y + z, t\right)\\
\mathbf{if}\;x \leq -5700:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \leq 1.8 \cdot 10^{-6}:\\
\;\;\;\;\mathsf{fma}\left(z + \left(z + t\right), x, y \cdot 5\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if x < -5700 or 1.79999999999999992e-6 < x Initial program 99.9%
Taylor expanded in x around inf
lower-*.f64N/A
+-commutativeN/A
distribute-lft-outN/A
lower-fma.f64N/A
lower-+.f6499.6
Applied rewrites99.6%
if -5700 < x < 1.79999999999999992e-6Initial program 99.9%
lift-+.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-fma.f6499.9
lift-+.f64N/A
lift-+.f64N/A
associate-+l+N/A
+-commutativeN/A
lift-+.f64N/A
flip-+N/A
+-inversesN/A
+-inversesN/A
+-inversesN/A
+-inversesN/A
flip-+N/A
lower-+.f6498.8
Applied rewrites98.8%
lift-+.f64N/A
lift-+.f64N/A
associate-+l+N/A
+-commutativeN/A
lower-+.f64N/A
lower-+.f6498.8
Applied rewrites98.8%
Final simplification99.1%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* x (fma 2.0 (+ y z) t))))
(if (<= x -5700.0)
t_1
(if (<= x 1.8e-6) (fma y 5.0 (* x (+ t (+ z z)))) t_1))))
double code(double x, double y, double z, double t) {
double t_1 = x * fma(2.0, (y + z), t);
double tmp;
if (x <= -5700.0) {
tmp = t_1;
} else if (x <= 1.8e-6) {
tmp = fma(y, 5.0, (x * (t + (z + z))));
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t) t_1 = Float64(x * fma(2.0, Float64(y + z), t)) tmp = 0.0 if (x <= -5700.0) tmp = t_1; elseif (x <= 1.8e-6) tmp = fma(y, 5.0, Float64(x * Float64(t + Float64(z + z)))); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(x * N[(2.0 * N[(y + z), $MachinePrecision] + t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -5700.0], t$95$1, If[LessEqual[x, 1.8e-6], N[(y * 5.0 + N[(x * N[(t + N[(z + z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot \mathsf{fma}\left(2, y + z, t\right)\\
\mathbf{if}\;x \leq -5700:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \leq 1.8 \cdot 10^{-6}:\\
\;\;\;\;\mathsf{fma}\left(y, 5, x \cdot \left(t + \left(z + z\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if x < -5700 or 1.79999999999999992e-6 < x Initial program 99.9%
Taylor expanded in x around inf
lower-*.f64N/A
+-commutativeN/A
distribute-lft-outN/A
lower-fma.f64N/A
lower-+.f6499.6
Applied rewrites99.6%
if -5700 < x < 1.79999999999999992e-6Initial program 99.9%
lift-+.f64N/A
lift-*.f64N/A
lift-+.f64N/A
distribute-rgt-inN/A
associate-+l+N/A
lower-fma.f64N/A
lift-+.f64N/A
lift-+.f64N/A
associate-+l+N/A
+-commutativeN/A
lift-+.f64N/A
flip-+N/A
+-inversesN/A
+-inversesN/A
+-inversesN/A
+-inversesN/A
flip-+N/A
lower-+.f64N/A
*-commutativeN/A
lower-fma.f6498.8
Applied rewrites98.8%
lift-fma.f64N/A
lift-fma.f64N/A
associate-+r+N/A
+-commutativeN/A
lift-*.f64N/A
lower-fma.f64N/A
lift-+.f64N/A
count-2N/A
lift-*.f64N/A
*-commutativeN/A
distribute-lft-outN/A
lower-*.f64N/A
lower-+.f6498.7
lift-*.f64N/A
count-2N/A
lift-+.f6498.7
Applied rewrites98.7%
Final simplification99.1%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* x (+ z z))))
(if (<= x -8.5e+36)
t_1
(if (<= x -6.6e-224) (* x t) (if (<= x 2.8e-9) (* y 5.0) t_1)))))
double code(double x, double y, double z, double t) {
double t_1 = x * (z + z);
double tmp;
if (x <= -8.5e+36) {
tmp = t_1;
} else if (x <= -6.6e-224) {
tmp = x * t;
} else if (x <= 2.8e-9) {
tmp = y * 5.0;
} else {
tmp = t_1;
}
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 = x * (z + z)
if (x <= (-8.5d+36)) then
tmp = t_1
else if (x <= (-6.6d-224)) then
tmp = x * t
else if (x <= 2.8d-9) then
tmp = y * 5.0d0
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = x * (z + z);
double tmp;
if (x <= -8.5e+36) {
tmp = t_1;
} else if (x <= -6.6e-224) {
tmp = x * t;
} else if (x <= 2.8e-9) {
tmp = y * 5.0;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = x * (z + z) tmp = 0 if x <= -8.5e+36: tmp = t_1 elif x <= -6.6e-224: tmp = x * t elif x <= 2.8e-9: tmp = y * 5.0 else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(x * Float64(z + z)) tmp = 0.0 if (x <= -8.5e+36) tmp = t_1; elseif (x <= -6.6e-224) tmp = Float64(x * t); elseif (x <= 2.8e-9) tmp = Float64(y * 5.0); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = x * (z + z); tmp = 0.0; if (x <= -8.5e+36) tmp = t_1; elseif (x <= -6.6e-224) tmp = x * t; elseif (x <= 2.8e-9) tmp = y * 5.0; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(x * N[(z + z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -8.5e+36], t$95$1, If[LessEqual[x, -6.6e-224], N[(x * t), $MachinePrecision], If[LessEqual[x, 2.8e-9], N[(y * 5.0), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot \left(z + z\right)\\
\mathbf{if}\;x \leq -8.5 \cdot 10^{+36}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \leq -6.6 \cdot 10^{-224}:\\
\;\;\;\;x \cdot t\\
\mathbf{elif}\;x \leq 2.8 \cdot 10^{-9}:\\
\;\;\;\;y \cdot 5\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if x < -8.50000000000000014e36 or 2.79999999999999984e-9 < x Initial program 100.0%
Taylor expanded in z around inf
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f6449.5
Applied rewrites49.5%
Applied rewrites49.5%
if -8.50000000000000014e36 < x < -6.6000000000000003e-224Initial program 99.9%
Taylor expanded in t around inf
*-commutativeN/A
lower-*.f6441.1
Applied rewrites41.1%
if -6.6000000000000003e-224 < x < 2.79999999999999984e-9Initial program 99.9%
Taylor expanded in x around 0
lower-*.f6470.5
Applied rewrites70.5%
Final simplification55.9%
(FPCore (x y z t) :precision binary64 (let* ((t_1 (* x (fma 2.0 (+ y z) t)))) (if (<= x -3.4e-28) t_1 (if (<= x 4.3e-10) (fma 5.0 y (* x t)) t_1))))
double code(double x, double y, double z, double t) {
double t_1 = x * fma(2.0, (y + z), t);
double tmp;
if (x <= -3.4e-28) {
tmp = t_1;
} else if (x <= 4.3e-10) {
tmp = fma(5.0, y, (x * t));
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t) t_1 = Float64(x * fma(2.0, Float64(y + z), t)) tmp = 0.0 if (x <= -3.4e-28) tmp = t_1; elseif (x <= 4.3e-10) tmp = fma(5.0, y, Float64(x * t)); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(x * N[(2.0 * N[(y + z), $MachinePrecision] + t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -3.4e-28], t$95$1, If[LessEqual[x, 4.3e-10], N[(5.0 * y + N[(x * t), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot \mathsf{fma}\left(2, y + z, t\right)\\
\mathbf{if}\;x \leq -3.4 \cdot 10^{-28}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \leq 4.3 \cdot 10^{-10}:\\
\;\;\;\;\mathsf{fma}\left(5, y, x \cdot t\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if x < -3.4000000000000001e-28 or 4.30000000000000014e-10 < x Initial program 99.9%
Taylor expanded in x around inf
lower-*.f64N/A
+-commutativeN/A
distribute-lft-outN/A
lower-fma.f64N/A
lower-+.f6497.2
Applied rewrites97.2%
if -3.4000000000000001e-28 < x < 4.30000000000000014e-10Initial program 99.9%
lift-+.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-fma.f6499.9
lift-+.f64N/A
lift-+.f64N/A
associate-+l+N/A
+-commutativeN/A
lift-+.f64N/A
flip-+N/A
+-inversesN/A
+-inversesN/A
+-inversesN/A
+-inversesN/A
flip-+N/A
lower-+.f6499.7
Applied rewrites99.7%
Taylor expanded in z around 0
lower-fma.f64N/A
*-commutativeN/A
lower-*.f6479.7
Applied rewrites79.7%
(FPCore (x y z t) :precision binary64 (let* ((t_1 (* y (fma x 2.0 5.0)))) (if (<= y -6.2e+17) t_1 (if (<= y 4.7e+41) (* x (fma 2.0 z t)) t_1))))
double code(double x, double y, double z, double t) {
double t_1 = y * fma(x, 2.0, 5.0);
double tmp;
if (y <= -6.2e+17) {
tmp = t_1;
} else if (y <= 4.7e+41) {
tmp = x * fma(2.0, z, t);
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t) t_1 = Float64(y * fma(x, 2.0, 5.0)) tmp = 0.0 if (y <= -6.2e+17) tmp = t_1; elseif (y <= 4.7e+41) tmp = Float64(x * fma(2.0, z, t)); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(y * N[(x * 2.0 + 5.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -6.2e+17], t$95$1, If[LessEqual[y, 4.7e+41], N[(x * N[(2.0 * z + t), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := y \cdot \mathsf{fma}\left(x, 2, 5\right)\\
\mathbf{if}\;y \leq -6.2 \cdot 10^{+17}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq 4.7 \cdot 10^{+41}:\\
\;\;\;\;x \cdot \mathsf{fma}\left(2, z, t\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y < -6.2e17 or 4.70000000000000001e41 < y Initial program 99.9%
Taylor expanded in y around inf
+-commutativeN/A
metadata-evalN/A
distribute-lft-neg-inN/A
neg-sub0N/A
associate--r-N/A
neg-sub0N/A
lower-*.f64N/A
neg-sub0N/A
associate--r-N/A
neg-sub0N/A
distribute-lft-neg-inN/A
metadata-evalN/A
*-commutativeN/A
lower-fma.f6479.1
Applied rewrites79.1%
if -6.2e17 < y < 4.70000000000000001e41Initial program 99.9%
Taylor expanded in y around 0
lower-*.f64N/A
+-commutativeN/A
lower-fma.f6479.4
Applied rewrites79.4%
(FPCore (x y z t) :precision binary64 (let* ((t_1 (* x (fma 2.0 z t)))) (if (<= x -6.6e-224) t_1 (if (<= x 5.4e-11) (* y 5.0) t_1))))
double code(double x, double y, double z, double t) {
double t_1 = x * fma(2.0, z, t);
double tmp;
if (x <= -6.6e-224) {
tmp = t_1;
} else if (x <= 5.4e-11) {
tmp = y * 5.0;
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t) t_1 = Float64(x * fma(2.0, z, t)) tmp = 0.0 if (x <= -6.6e-224) tmp = t_1; elseif (x <= 5.4e-11) tmp = Float64(y * 5.0); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(x * N[(2.0 * z + t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -6.6e-224], t$95$1, If[LessEqual[x, 5.4e-11], N[(y * 5.0), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot \mathsf{fma}\left(2, z, t\right)\\
\mathbf{if}\;x \leq -6.6 \cdot 10^{-224}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \leq 5.4 \cdot 10^{-11}:\\
\;\;\;\;y \cdot 5\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if x < -6.6000000000000003e-224 or 5.40000000000000009e-11 < x Initial program 99.9%
Taylor expanded in y around 0
lower-*.f64N/A
+-commutativeN/A
lower-fma.f6471.0
Applied rewrites71.0%
if -6.6000000000000003e-224 < x < 5.40000000000000009e-11Initial program 99.9%
Taylor expanded in x around 0
lower-*.f6470.5
Applied rewrites70.5%
Final simplification70.8%
(FPCore (x y z t) :precision binary64 (let* ((t_1 (* x (fma 2.0 y t)))) (if (<= x -6.6e-224) t_1 (if (<= x 1.1e-8) (* y 5.0) t_1))))
double code(double x, double y, double z, double t) {
double t_1 = x * fma(2.0, y, t);
double tmp;
if (x <= -6.6e-224) {
tmp = t_1;
} else if (x <= 1.1e-8) {
tmp = y * 5.0;
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t) t_1 = Float64(x * fma(2.0, y, t)) tmp = 0.0 if (x <= -6.6e-224) tmp = t_1; elseif (x <= 1.1e-8) tmp = Float64(y * 5.0); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(x * N[(2.0 * y + t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -6.6e-224], t$95$1, If[LessEqual[x, 1.1e-8], N[(y * 5.0), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot \mathsf{fma}\left(2, y, t\right)\\
\mathbf{if}\;x \leq -6.6 \cdot 10^{-224}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \leq 1.1 \cdot 10^{-8}:\\
\;\;\;\;y \cdot 5\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if x < -6.6000000000000003e-224 or 1.0999999999999999e-8 < x Initial program 99.9%
Taylor expanded in x around inf
lower-*.f64N/A
+-commutativeN/A
distribute-lft-outN/A
lower-fma.f64N/A
lower-+.f6489.8
Applied rewrites89.8%
Taylor expanded in z around 0
Applied rewrites56.8%
if -6.6000000000000003e-224 < x < 1.0999999999999999e-8Initial program 99.9%
Taylor expanded in x around 0
lower-*.f6470.5
Applied rewrites70.5%
Final simplification62.1%
(FPCore (x y z t) :precision binary64 (if (<= x -6.6e-224) (* x t) (if (<= x 1.4e-8) (* y 5.0) (* x t))))
double code(double x, double y, double z, double t) {
double tmp;
if (x <= -6.6e-224) {
tmp = x * t;
} else if (x <= 1.4e-8) {
tmp = y * 5.0;
} else {
tmp = x * t;
}
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 <= (-6.6d-224)) then
tmp = x * t
else if (x <= 1.4d-8) then
tmp = y * 5.0d0
else
tmp = x * t
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (x <= -6.6e-224) {
tmp = x * t;
} else if (x <= 1.4e-8) {
tmp = y * 5.0;
} else {
tmp = x * t;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if x <= -6.6e-224: tmp = x * t elif x <= 1.4e-8: tmp = y * 5.0 else: tmp = x * t return tmp
function code(x, y, z, t) tmp = 0.0 if (x <= -6.6e-224) tmp = Float64(x * t); elseif (x <= 1.4e-8) tmp = Float64(y * 5.0); else tmp = Float64(x * t); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (x <= -6.6e-224) tmp = x * t; elseif (x <= 1.4e-8) tmp = y * 5.0; else tmp = x * t; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[x, -6.6e-224], N[(x * t), $MachinePrecision], If[LessEqual[x, 1.4e-8], N[(y * 5.0), $MachinePrecision], N[(x * t), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -6.6 \cdot 10^{-224}:\\
\;\;\;\;x \cdot t\\
\mathbf{elif}\;x \leq 1.4 \cdot 10^{-8}:\\
\;\;\;\;y \cdot 5\\
\mathbf{else}:\\
\;\;\;\;x \cdot t\\
\end{array}
\end{array}
if x < -6.6000000000000003e-224 or 1.4e-8 < x Initial program 99.9%
Taylor expanded in t around inf
*-commutativeN/A
lower-*.f6436.9
Applied rewrites36.9%
if -6.6000000000000003e-224 < x < 1.4e-8Initial program 99.9%
Taylor expanded in x around 0
lower-*.f6470.5
Applied rewrites70.5%
Final simplification49.9%
(FPCore (x y z t) :precision binary64 (* y 5.0))
double code(double x, double y, double z, double t) {
return y * 5.0;
}
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 * 5.0d0
end function
public static double code(double x, double y, double z, double t) {
return y * 5.0;
}
def code(x, y, z, t): return y * 5.0
function code(x, y, z, t) return Float64(y * 5.0) end
function tmp = code(x, y, z, t) tmp = y * 5.0; end
code[x_, y_, z_, t_] := N[(y * 5.0), $MachinePrecision]
\begin{array}{l}
\\
y \cdot 5
\end{array}
Initial program 99.9%
Taylor expanded in x around 0
lower-*.f6433.6
Applied rewrites33.6%
Final simplification33.6%
herbie shell --seed 2024232
(FPCore (x y z t)
:name "Graphics.Rendering.Plot.Render.Plot.Legend:renderLegendOutside from plot-0.2.3.4, B"
:precision binary64
(+ (* x (+ (+ (+ (+ y z) z) y) t)) (* y 5.0)))