
(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 (fma y 5.0 (* x (fma (+ y z) 2.0 t))))
double code(double x, double y, double z, double t) {
return fma(y, 5.0, (x * fma((y + z), 2.0, t)));
}
function code(x, y, z, t) return fma(y, 5.0, Float64(x * fma(Float64(y + z), 2.0, t))) end
code[x_, y_, z_, t_] := N[(y * 5.0 + N[(x * N[(N[(y + z), $MachinePrecision] * 2.0 + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\mathsf{fma}\left(y, 5, x \cdot \mathsf{fma}\left(y + z, 2, t\right)\right)
\end{array}
Initial program 99.9%
+-commutative99.9%
fma-def100.0%
distribute-rgt-in97.2%
associate-+l+97.2%
+-commutative97.2%
count-297.2%
distribute-rgt-in100.0%
*-commutative100.0%
fma-def100.0%
Applied egg-rr100.0%
Final simplification100.0%
(FPCore (x y z t) :precision binary64 (fma x (+ t (* (+ y z) 2.0)) (* y 5.0)))
double code(double x, double y, double z, double t) {
return fma(x, (t + ((y + z) * 2.0)), (y * 5.0));
}
function code(x, y, z, t) return fma(x, Float64(t + Float64(Float64(y + z) * 2.0)), Float64(y * 5.0)) end
code[x_, y_, z_, t_] := N[(x * N[(t + N[(N[(y + z), $MachinePrecision] * 2.0), $MachinePrecision]), $MachinePrecision] + N[(y * 5.0), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\mathsf{fma}\left(x, t + \left(y + z\right) \cdot 2, y \cdot 5\right)
\end{array}
Initial program 99.9%
fma-def99.9%
associate-+l+99.9%
+-commutative99.9%
count-299.9%
Simplified99.9%
Final simplification99.9%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* x (+ t (* (+ y z) 2.0)))))
(if (<= x -5.2e-11)
t_1
(if (<= x -2.35e-113)
(+ (* 2.0 (* x z)) (* y 5.0))
(if (<= x 2.6e-178)
(+ (* y 5.0) (* x t))
(if (or (<= x 1.45e-122) (not (<= x 4.8e-61)))
t_1
(+ (* x t) (* y (+ 5.0 (* x 2.0))))))))))
double code(double x, double y, double z, double t) {
double t_1 = x * (t + ((y + z) * 2.0));
double tmp;
if (x <= -5.2e-11) {
tmp = t_1;
} else if (x <= -2.35e-113) {
tmp = (2.0 * (x * z)) + (y * 5.0);
} else if (x <= 2.6e-178) {
tmp = (y * 5.0) + (x * t);
} else if ((x <= 1.45e-122) || !(x <= 4.8e-61)) {
tmp = t_1;
} else {
tmp = (x * t) + (y * (5.0 + (x * 2.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 = x * (t + ((y + z) * 2.0d0))
if (x <= (-5.2d-11)) then
tmp = t_1
else if (x <= (-2.35d-113)) then
tmp = (2.0d0 * (x * z)) + (y * 5.0d0)
else if (x <= 2.6d-178) then
tmp = (y * 5.0d0) + (x * t)
else if ((x <= 1.45d-122) .or. (.not. (x <= 4.8d-61))) then
tmp = t_1
else
tmp = (x * t) + (y * (5.0d0 + (x * 2.0d0)))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = x * (t + ((y + z) * 2.0));
double tmp;
if (x <= -5.2e-11) {
tmp = t_1;
} else if (x <= -2.35e-113) {
tmp = (2.0 * (x * z)) + (y * 5.0);
} else if (x <= 2.6e-178) {
tmp = (y * 5.0) + (x * t);
} else if ((x <= 1.45e-122) || !(x <= 4.8e-61)) {
tmp = t_1;
} else {
tmp = (x * t) + (y * (5.0 + (x * 2.0)));
}
return tmp;
}
def code(x, y, z, t): t_1 = x * (t + ((y + z) * 2.0)) tmp = 0 if x <= -5.2e-11: tmp = t_1 elif x <= -2.35e-113: tmp = (2.0 * (x * z)) + (y * 5.0) elif x <= 2.6e-178: tmp = (y * 5.0) + (x * t) elif (x <= 1.45e-122) or not (x <= 4.8e-61): tmp = t_1 else: tmp = (x * t) + (y * (5.0 + (x * 2.0))) return tmp
function code(x, y, z, t) t_1 = Float64(x * Float64(t + Float64(Float64(y + z) * 2.0))) tmp = 0.0 if (x <= -5.2e-11) tmp = t_1; elseif (x <= -2.35e-113) tmp = Float64(Float64(2.0 * Float64(x * z)) + Float64(y * 5.0)); elseif (x <= 2.6e-178) tmp = Float64(Float64(y * 5.0) + Float64(x * t)); elseif ((x <= 1.45e-122) || !(x <= 4.8e-61)) tmp = t_1; else tmp = Float64(Float64(x * t) + Float64(y * Float64(5.0 + Float64(x * 2.0)))); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = x * (t + ((y + z) * 2.0)); tmp = 0.0; if (x <= -5.2e-11) tmp = t_1; elseif (x <= -2.35e-113) tmp = (2.0 * (x * z)) + (y * 5.0); elseif (x <= 2.6e-178) tmp = (y * 5.0) + (x * t); elseif ((x <= 1.45e-122) || ~((x <= 4.8e-61))) tmp = t_1; else tmp = (x * t) + (y * (5.0 + (x * 2.0))); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(x * N[(t + N[(N[(y + z), $MachinePrecision] * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -5.2e-11], t$95$1, If[LessEqual[x, -2.35e-113], N[(N[(2.0 * N[(x * z), $MachinePrecision]), $MachinePrecision] + N[(y * 5.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 2.6e-178], N[(N[(y * 5.0), $MachinePrecision] + N[(x * t), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[x, 1.45e-122], N[Not[LessEqual[x, 4.8e-61]], $MachinePrecision]], t$95$1, N[(N[(x * t), $MachinePrecision] + N[(y * N[(5.0 + N[(x * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot \left(t + \left(y + z\right) \cdot 2\right)\\
\mathbf{if}\;x \leq -5.2 \cdot 10^{-11}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \leq -2.35 \cdot 10^{-113}:\\
\;\;\;\;2 \cdot \left(x \cdot z\right) + y \cdot 5\\
\mathbf{elif}\;x \leq 2.6 \cdot 10^{-178}:\\
\;\;\;\;y \cdot 5 + x \cdot t\\
\mathbf{elif}\;x \leq 1.45 \cdot 10^{-122} \lor \neg \left(x \leq 4.8 \cdot 10^{-61}\right):\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;x \cdot t + y \cdot \left(5 + x \cdot 2\right)\\
\end{array}
\end{array}
if x < -5.2000000000000001e-11 or 2.59999999999999998e-178 < x < 1.4500000000000001e-122 or 4.8000000000000002e-61 < x Initial program 99.9%
fma-def100.0%
associate-+l+100.0%
+-commutative100.0%
count-2100.0%
Simplified100.0%
Taylor expanded in x around inf 96.2%
if -5.2000000000000001e-11 < x < -2.3500000000000001e-113Initial program 99.9%
Taylor expanded in y around 0 99.3%
Simplified99.3%
Taylor expanded in t around 0 86.9%
if -2.3500000000000001e-113 < x < 2.59999999999999998e-178Initial program 99.9%
+-commutative99.9%
fma-def100.0%
distribute-rgt-in100.0%
associate-+l+100.0%
+-commutative100.0%
count-2100.0%
distribute-rgt-in100.0%
*-commutative100.0%
fma-def100.0%
Applied egg-rr100.0%
Taylor expanded in t around inf 90.4%
*-commutative90.4%
Simplified90.4%
fma-udef90.4%
Applied egg-rr90.4%
if 1.4500000000000001e-122 < x < 4.8000000000000002e-61Initial program 99.9%
+-commutative99.9%
fma-def100.0%
distribute-rgt-in100.0%
associate-+l+100.0%
+-commutative100.0%
count-2100.0%
distribute-rgt-in100.0%
*-commutative100.0%
fma-def100.0%
Applied egg-rr100.0%
Taylor expanded in y around 0 99.9%
fma-def99.9%
+-commutative99.9%
*-commutative99.9%
fma-udef99.9%
Simplified99.9%
Taylor expanded in z around 0 92.1%
Final simplification93.6%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* y (+ 5.0 (* x 2.0)))) (t_2 (* x (+ t (* z 2.0)))))
(if (<= y -3.4e+131)
t_1
(if (<= y -4.5e+54)
(* (+ y z) (* x 2.0))
(if (<= y -2.6e-21)
t_1
(if (<= y 2.6e-7)
t_2
(if (<= y 2.8e+49)
(+ (* y 5.0) (* x t))
(if (<= y 3.5e+76) t_2 t_1))))))))
double code(double x, double y, double z, double t) {
double t_1 = y * (5.0 + (x * 2.0));
double t_2 = x * (t + (z * 2.0));
double tmp;
if (y <= -3.4e+131) {
tmp = t_1;
} else if (y <= -4.5e+54) {
tmp = (y + z) * (x * 2.0);
} else if (y <= -2.6e-21) {
tmp = t_1;
} else if (y <= 2.6e-7) {
tmp = t_2;
} else if (y <= 2.8e+49) {
tmp = (y * 5.0) + (x * t);
} else if (y <= 3.5e+76) {
tmp = t_2;
} 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) :: t_2
real(8) :: tmp
t_1 = y * (5.0d0 + (x * 2.0d0))
t_2 = x * (t + (z * 2.0d0))
if (y <= (-3.4d+131)) then
tmp = t_1
else if (y <= (-4.5d+54)) then
tmp = (y + z) * (x * 2.0d0)
else if (y <= (-2.6d-21)) then
tmp = t_1
else if (y <= 2.6d-7) then
tmp = t_2
else if (y <= 2.8d+49) then
tmp = (y * 5.0d0) + (x * t)
else if (y <= 3.5d+76) then
tmp = t_2
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 = y * (5.0 + (x * 2.0));
double t_2 = x * (t + (z * 2.0));
double tmp;
if (y <= -3.4e+131) {
tmp = t_1;
} else if (y <= -4.5e+54) {
tmp = (y + z) * (x * 2.0);
} else if (y <= -2.6e-21) {
tmp = t_1;
} else if (y <= 2.6e-7) {
tmp = t_2;
} else if (y <= 2.8e+49) {
tmp = (y * 5.0) + (x * t);
} else if (y <= 3.5e+76) {
tmp = t_2;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = y * (5.0 + (x * 2.0)) t_2 = x * (t + (z * 2.0)) tmp = 0 if y <= -3.4e+131: tmp = t_1 elif y <= -4.5e+54: tmp = (y + z) * (x * 2.0) elif y <= -2.6e-21: tmp = t_1 elif y <= 2.6e-7: tmp = t_2 elif y <= 2.8e+49: tmp = (y * 5.0) + (x * t) elif y <= 3.5e+76: tmp = t_2 else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(y * Float64(5.0 + Float64(x * 2.0))) t_2 = Float64(x * Float64(t + Float64(z * 2.0))) tmp = 0.0 if (y <= -3.4e+131) tmp = t_1; elseif (y <= -4.5e+54) tmp = Float64(Float64(y + z) * Float64(x * 2.0)); elseif (y <= -2.6e-21) tmp = t_1; elseif (y <= 2.6e-7) tmp = t_2; elseif (y <= 2.8e+49) tmp = Float64(Float64(y * 5.0) + Float64(x * t)); elseif (y <= 3.5e+76) tmp = t_2; else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = y * (5.0 + (x * 2.0)); t_2 = x * (t + (z * 2.0)); tmp = 0.0; if (y <= -3.4e+131) tmp = t_1; elseif (y <= -4.5e+54) tmp = (y + z) * (x * 2.0); elseif (y <= -2.6e-21) tmp = t_1; elseif (y <= 2.6e-7) tmp = t_2; elseif (y <= 2.8e+49) tmp = (y * 5.0) + (x * t); elseif (y <= 3.5e+76) tmp = t_2; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(y * N[(5.0 + N[(x * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(x * N[(t + N[(z * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -3.4e+131], t$95$1, If[LessEqual[y, -4.5e+54], N[(N[(y + z), $MachinePrecision] * N[(x * 2.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, -2.6e-21], t$95$1, If[LessEqual[y, 2.6e-7], t$95$2, If[LessEqual[y, 2.8e+49], N[(N[(y * 5.0), $MachinePrecision] + N[(x * t), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 3.5e+76], t$95$2, t$95$1]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := y \cdot \left(5 + x \cdot 2\right)\\
t_2 := x \cdot \left(t + z \cdot 2\right)\\
\mathbf{if}\;y \leq -3.4 \cdot 10^{+131}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;y \leq -4.5 \cdot 10^{+54}:\\
\;\;\;\;\left(y + z\right) \cdot \left(x \cdot 2\right)\\
\mathbf{elif}\;y \leq -2.6 \cdot 10^{-21}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;y \leq 2.6 \cdot 10^{-7}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;y \leq 2.8 \cdot 10^{+49}:\\
\;\;\;\;y \cdot 5 + x \cdot t\\
\mathbf{elif}\;y \leq 3.5 \cdot 10^{+76}:\\
\;\;\;\;t_2\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if y < -3.39999999999999986e131 or -4.49999999999999984e54 < y < -2.60000000000000017e-21 or 3.5e76 < y Initial program 99.9%
Taylor expanded in y around inf 83.3%
Simplified83.3%
if -3.39999999999999986e131 < y < -4.49999999999999984e54Initial program 99.9%
fma-def99.9%
associate-+l+99.9%
+-commutative99.9%
count-299.9%
Simplified99.9%
Taylor expanded in x around inf 89.3%
Taylor expanded in t around 0 69.8%
associate-*r*69.8%
*-commutative69.8%
Simplified69.8%
if -2.60000000000000017e-21 < y < 2.59999999999999999e-7 or 2.7999999999999998e49 < y < 3.5e76Initial program 99.9%
Taylor expanded in y around 0 84.7%
if 2.59999999999999999e-7 < y < 2.7999999999999998e49Initial program 99.9%
+-commutative99.9%
fma-def100.0%
distribute-rgt-in100.0%
associate-+l+100.0%
+-commutative100.0%
count-2100.0%
distribute-rgt-in100.0%
*-commutative100.0%
fma-def100.0%
Applied egg-rr100.0%
Taylor expanded in t around inf 78.6%
*-commutative78.6%
Simplified78.6%
fma-udef78.5%
Applied egg-rr78.5%
Final simplification82.8%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* x (+ t (* (+ y z) 2.0)))))
(if (<= x -4.8e-9)
t_1
(if (<= x -1.25e-109)
(+ (* 2.0 (* x z)) (* y 5.0))
(if (or (<= x 5.8e-179) (and (not (<= x 2.05e-123)) (<= x 7.8e-61)))
(+ (* y 5.0) (* x t))
t_1)))))
double code(double x, double y, double z, double t) {
double t_1 = x * (t + ((y + z) * 2.0));
double tmp;
if (x <= -4.8e-9) {
tmp = t_1;
} else if (x <= -1.25e-109) {
tmp = (2.0 * (x * z)) + (y * 5.0);
} else if ((x <= 5.8e-179) || (!(x <= 2.05e-123) && (x <= 7.8e-61))) {
tmp = (y * 5.0) + (x * t);
} 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 * (t + ((y + z) * 2.0d0))
if (x <= (-4.8d-9)) then
tmp = t_1
else if (x <= (-1.25d-109)) then
tmp = (2.0d0 * (x * z)) + (y * 5.0d0)
else if ((x <= 5.8d-179) .or. (.not. (x <= 2.05d-123)) .and. (x <= 7.8d-61)) then
tmp = (y * 5.0d0) + (x * t)
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 * (t + ((y + z) * 2.0));
double tmp;
if (x <= -4.8e-9) {
tmp = t_1;
} else if (x <= -1.25e-109) {
tmp = (2.0 * (x * z)) + (y * 5.0);
} else if ((x <= 5.8e-179) || (!(x <= 2.05e-123) && (x <= 7.8e-61))) {
tmp = (y * 5.0) + (x * t);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = x * (t + ((y + z) * 2.0)) tmp = 0 if x <= -4.8e-9: tmp = t_1 elif x <= -1.25e-109: tmp = (2.0 * (x * z)) + (y * 5.0) elif (x <= 5.8e-179) or (not (x <= 2.05e-123) and (x <= 7.8e-61)): tmp = (y * 5.0) + (x * t) else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(x * Float64(t + Float64(Float64(y + z) * 2.0))) tmp = 0.0 if (x <= -4.8e-9) tmp = t_1; elseif (x <= -1.25e-109) tmp = Float64(Float64(2.0 * Float64(x * z)) + Float64(y * 5.0)); elseif ((x <= 5.8e-179) || (!(x <= 2.05e-123) && (x <= 7.8e-61))) tmp = Float64(Float64(y * 5.0) + Float64(x * t)); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = x * (t + ((y + z) * 2.0)); tmp = 0.0; if (x <= -4.8e-9) tmp = t_1; elseif (x <= -1.25e-109) tmp = (2.0 * (x * z)) + (y * 5.0); elseif ((x <= 5.8e-179) || (~((x <= 2.05e-123)) && (x <= 7.8e-61))) tmp = (y * 5.0) + (x * t); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(x * N[(t + N[(N[(y + z), $MachinePrecision] * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -4.8e-9], t$95$1, If[LessEqual[x, -1.25e-109], N[(N[(2.0 * N[(x * z), $MachinePrecision]), $MachinePrecision] + N[(y * 5.0), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[x, 5.8e-179], And[N[Not[LessEqual[x, 2.05e-123]], $MachinePrecision], LessEqual[x, 7.8e-61]]], N[(N[(y * 5.0), $MachinePrecision] + N[(x * t), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot \left(t + \left(y + z\right) \cdot 2\right)\\
\mathbf{if}\;x \leq -4.8 \cdot 10^{-9}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \leq -1.25 \cdot 10^{-109}:\\
\;\;\;\;2 \cdot \left(x \cdot z\right) + y \cdot 5\\
\mathbf{elif}\;x \leq 5.8 \cdot 10^{-179} \lor \neg \left(x \leq 2.05 \cdot 10^{-123}\right) \land x \leq 7.8 \cdot 10^{-61}:\\
\;\;\;\;y \cdot 5 + x \cdot t\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if x < -4.8e-9 or 5.7999999999999998e-179 < x < 2.05e-123 or 7.80000000000000065e-61 < x Initial program 99.9%
fma-def100.0%
associate-+l+100.0%
+-commutative100.0%
count-2100.0%
Simplified100.0%
Taylor expanded in x around inf 96.2%
if -4.8e-9 < x < -1.25000000000000005e-109Initial program 99.9%
Taylor expanded in y around 0 99.3%
Simplified99.3%
Taylor expanded in t around 0 86.9%
if -1.25000000000000005e-109 < x < 5.7999999999999998e-179 or 2.05e-123 < x < 7.80000000000000065e-61Initial program 99.9%
+-commutative99.9%
fma-def100.0%
distribute-rgt-in100.0%
associate-+l+100.0%
+-commutative100.0%
count-2100.0%
distribute-rgt-in100.0%
*-commutative100.0%
fma-def100.0%
Applied egg-rr100.0%
Taylor expanded in t around inf 90.7%
*-commutative90.7%
Simplified90.7%
fma-udef90.6%
Applied egg-rr90.6%
Final simplification93.6%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* 2.0 (* x z))))
(if (<= z -2.3e+20)
t_1
(if (<= z -6e-140)
(* x t)
(if (<= z -2.8e-178)
(* y 5.0)
(if (<= z 5.5e-292)
(* x t)
(if (<= z 7e-33) (* y 5.0) (if (<= z 6e+52) (* x t) t_1))))))))
double code(double x, double y, double z, double t) {
double t_1 = 2.0 * (x * z);
double tmp;
if (z <= -2.3e+20) {
tmp = t_1;
} else if (z <= -6e-140) {
tmp = x * t;
} else if (z <= -2.8e-178) {
tmp = y * 5.0;
} else if (z <= 5.5e-292) {
tmp = x * t;
} else if (z <= 7e-33) {
tmp = y * 5.0;
} else if (z <= 6e+52) {
tmp = x * t;
} 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 = 2.0d0 * (x * z)
if (z <= (-2.3d+20)) then
tmp = t_1
else if (z <= (-6d-140)) then
tmp = x * t
else if (z <= (-2.8d-178)) then
tmp = y * 5.0d0
else if (z <= 5.5d-292) then
tmp = x * t
else if (z <= 7d-33) then
tmp = y * 5.0d0
else if (z <= 6d+52) then
tmp = x * t
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 = 2.0 * (x * z);
double tmp;
if (z <= -2.3e+20) {
tmp = t_1;
} else if (z <= -6e-140) {
tmp = x * t;
} else if (z <= -2.8e-178) {
tmp = y * 5.0;
} else if (z <= 5.5e-292) {
tmp = x * t;
} else if (z <= 7e-33) {
tmp = y * 5.0;
} else if (z <= 6e+52) {
tmp = x * t;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = 2.0 * (x * z) tmp = 0 if z <= -2.3e+20: tmp = t_1 elif z <= -6e-140: tmp = x * t elif z <= -2.8e-178: tmp = y * 5.0 elif z <= 5.5e-292: tmp = x * t elif z <= 7e-33: tmp = y * 5.0 elif z <= 6e+52: tmp = x * t else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(2.0 * Float64(x * z)) tmp = 0.0 if (z <= -2.3e+20) tmp = t_1; elseif (z <= -6e-140) tmp = Float64(x * t); elseif (z <= -2.8e-178) tmp = Float64(y * 5.0); elseif (z <= 5.5e-292) tmp = Float64(x * t); elseif (z <= 7e-33) tmp = Float64(y * 5.0); elseif (z <= 6e+52) tmp = Float64(x * t); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = 2.0 * (x * z); tmp = 0.0; if (z <= -2.3e+20) tmp = t_1; elseif (z <= -6e-140) tmp = x * t; elseif (z <= -2.8e-178) tmp = y * 5.0; elseif (z <= 5.5e-292) tmp = x * t; elseif (z <= 7e-33) tmp = y * 5.0; elseif (z <= 6e+52) tmp = x * t; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(2.0 * N[(x * z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -2.3e+20], t$95$1, If[LessEqual[z, -6e-140], N[(x * t), $MachinePrecision], If[LessEqual[z, -2.8e-178], N[(y * 5.0), $MachinePrecision], If[LessEqual[z, 5.5e-292], N[(x * t), $MachinePrecision], If[LessEqual[z, 7e-33], N[(y * 5.0), $MachinePrecision], If[LessEqual[z, 6e+52], N[(x * t), $MachinePrecision], t$95$1]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := 2 \cdot \left(x \cdot z\right)\\
\mathbf{if}\;z \leq -2.3 \cdot 10^{+20}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq -6 \cdot 10^{-140}:\\
\;\;\;\;x \cdot t\\
\mathbf{elif}\;z \leq -2.8 \cdot 10^{-178}:\\
\;\;\;\;y \cdot 5\\
\mathbf{elif}\;z \leq 5.5 \cdot 10^{-292}:\\
\;\;\;\;x \cdot t\\
\mathbf{elif}\;z \leq 7 \cdot 10^{-33}:\\
\;\;\;\;y \cdot 5\\
\mathbf{elif}\;z \leq 6 \cdot 10^{+52}:\\
\;\;\;\;x \cdot t\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if z < -2.3e20 or 6e52 < z Initial program 99.9%
Taylor expanded in z around inf 61.4%
if -2.3e20 < z < -6.00000000000000037e-140 or -2.80000000000000019e-178 < z < 5.50000000000000006e-292 or 6.9999999999999997e-33 < z < 6e52Initial program 99.9%
Taylor expanded in t around inf 52.1%
if -6.00000000000000037e-140 < z < -2.80000000000000019e-178 or 5.50000000000000006e-292 < z < 6.9999999999999997e-33Initial program 100.0%
Taylor expanded in x around 0 45.7%
Final simplification54.4%
(FPCore (x y z t)
:precision binary64
(if (or (<= x -3.7e-27)
(not
(or (<= x 2.6e-178) (and (not (<= x 5.4e-123)) (<= x 1.45e-62)))))
(* x (+ t (* (+ y z) 2.0)))
(+ (* y 5.0) (* x t))))
double code(double x, double y, double z, double t) {
double tmp;
if ((x <= -3.7e-27) || !((x <= 2.6e-178) || (!(x <= 5.4e-123) && (x <= 1.45e-62)))) {
tmp = x * (t + ((y + z) * 2.0));
} else {
tmp = (y * 5.0) + (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 <= (-3.7d-27)) .or. (.not. (x <= 2.6d-178) .or. (.not. (x <= 5.4d-123)) .and. (x <= 1.45d-62))) then
tmp = x * (t + ((y + z) * 2.0d0))
else
tmp = (y * 5.0d0) + (x * t)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((x <= -3.7e-27) || !((x <= 2.6e-178) || (!(x <= 5.4e-123) && (x <= 1.45e-62)))) {
tmp = x * (t + ((y + z) * 2.0));
} else {
tmp = (y * 5.0) + (x * t);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (x <= -3.7e-27) or not ((x <= 2.6e-178) or (not (x <= 5.4e-123) and (x <= 1.45e-62))): tmp = x * (t + ((y + z) * 2.0)) else: tmp = (y * 5.0) + (x * t) return tmp
function code(x, y, z, t) tmp = 0.0 if ((x <= -3.7e-27) || !((x <= 2.6e-178) || (!(x <= 5.4e-123) && (x <= 1.45e-62)))) tmp = Float64(x * Float64(t + Float64(Float64(y + z) * 2.0))); else tmp = Float64(Float64(y * 5.0) + Float64(x * t)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((x <= -3.7e-27) || ~(((x <= 2.6e-178) || (~((x <= 5.4e-123)) && (x <= 1.45e-62))))) tmp = x * (t + ((y + z) * 2.0)); else tmp = (y * 5.0) + (x * t); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[x, -3.7e-27], N[Not[Or[LessEqual[x, 2.6e-178], And[N[Not[LessEqual[x, 5.4e-123]], $MachinePrecision], LessEqual[x, 1.45e-62]]]], $MachinePrecision]], N[(x * N[(t + N[(N[(y + z), $MachinePrecision] * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(y * 5.0), $MachinePrecision] + N[(x * t), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -3.7 \cdot 10^{-27} \lor \neg \left(x \leq 2.6 \cdot 10^{-178} \lor \neg \left(x \leq 5.4 \cdot 10^{-123}\right) \land x \leq 1.45 \cdot 10^{-62}\right):\\
\;\;\;\;x \cdot \left(t + \left(y + z\right) \cdot 2\right)\\
\mathbf{else}:\\
\;\;\;\;y \cdot 5 + x \cdot t\\
\end{array}
\end{array}
if x < -3.70000000000000029e-27 or 2.59999999999999998e-178 < x < 5.4000000000000002e-123 or 1.44999999999999993e-62 < x Initial program 99.9%
fma-def100.0%
associate-+l+100.0%
+-commutative100.0%
count-2100.0%
Simplified100.0%
Taylor expanded in x around inf 95.1%
if -3.70000000000000029e-27 < x < 2.59999999999999998e-178 or 5.4000000000000002e-123 < x < 1.44999999999999993e-62Initial program 99.9%
+-commutative99.9%
fma-def100.0%
distribute-rgt-in100.0%
associate-+l+100.0%
+-commutative100.0%
count-2100.0%
distribute-rgt-in100.0%
*-commutative100.0%
fma-def100.0%
Applied egg-rr100.0%
Taylor expanded in t around inf 86.6%
*-commutative86.6%
Simplified86.6%
fma-udef86.6%
Applied egg-rr86.6%
Final simplification91.8%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* y (+ 5.0 (* x 2.0)))))
(if (<= y -3.4e+131)
t_1
(if (<= y -5.2e+40)
(* (+ y z) (* x 2.0))
(if (or (<= y -2e-21) (not (<= y 3.6e+76)))
t_1
(* x (+ t (* z 2.0))))))))
double code(double x, double y, double z, double t) {
double t_1 = y * (5.0 + (x * 2.0));
double tmp;
if (y <= -3.4e+131) {
tmp = t_1;
} else if (y <= -5.2e+40) {
tmp = (y + z) * (x * 2.0);
} else if ((y <= -2e-21) || !(y <= 3.6e+76)) {
tmp = t_1;
} else {
tmp = x * (t + (z * 2.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 = y * (5.0d0 + (x * 2.0d0))
if (y <= (-3.4d+131)) then
tmp = t_1
else if (y <= (-5.2d+40)) then
tmp = (y + z) * (x * 2.0d0)
else if ((y <= (-2d-21)) .or. (.not. (y <= 3.6d+76))) then
tmp = t_1
else
tmp = x * (t + (z * 2.0d0))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = y * (5.0 + (x * 2.0));
double tmp;
if (y <= -3.4e+131) {
tmp = t_1;
} else if (y <= -5.2e+40) {
tmp = (y + z) * (x * 2.0);
} else if ((y <= -2e-21) || !(y <= 3.6e+76)) {
tmp = t_1;
} else {
tmp = x * (t + (z * 2.0));
}
return tmp;
}
def code(x, y, z, t): t_1 = y * (5.0 + (x * 2.0)) tmp = 0 if y <= -3.4e+131: tmp = t_1 elif y <= -5.2e+40: tmp = (y + z) * (x * 2.0) elif (y <= -2e-21) or not (y <= 3.6e+76): tmp = t_1 else: tmp = x * (t + (z * 2.0)) return tmp
function code(x, y, z, t) t_1 = Float64(y * Float64(5.0 + Float64(x * 2.0))) tmp = 0.0 if (y <= -3.4e+131) tmp = t_1; elseif (y <= -5.2e+40) tmp = Float64(Float64(y + z) * Float64(x * 2.0)); elseif ((y <= -2e-21) || !(y <= 3.6e+76)) tmp = t_1; else tmp = Float64(x * Float64(t + Float64(z * 2.0))); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = y * (5.0 + (x * 2.0)); tmp = 0.0; if (y <= -3.4e+131) tmp = t_1; elseif (y <= -5.2e+40) tmp = (y + z) * (x * 2.0); elseif ((y <= -2e-21) || ~((y <= 3.6e+76))) tmp = t_1; else tmp = x * (t + (z * 2.0)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(y * N[(5.0 + N[(x * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -3.4e+131], t$95$1, If[LessEqual[y, -5.2e+40], N[(N[(y + z), $MachinePrecision] * N[(x * 2.0), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[y, -2e-21], N[Not[LessEqual[y, 3.6e+76]], $MachinePrecision]], t$95$1, N[(x * N[(t + N[(z * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := y \cdot \left(5 + x \cdot 2\right)\\
\mathbf{if}\;y \leq -3.4 \cdot 10^{+131}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;y \leq -5.2 \cdot 10^{+40}:\\
\;\;\;\;\left(y + z\right) \cdot \left(x \cdot 2\right)\\
\mathbf{elif}\;y \leq -2 \cdot 10^{-21} \lor \neg \left(y \leq 3.6 \cdot 10^{+76}\right):\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(t + z \cdot 2\right)\\
\end{array}
\end{array}
if y < -3.39999999999999986e131 or -5.2000000000000001e40 < y < -1.99999999999999982e-21 or 3.6000000000000003e76 < y Initial program 99.9%
Taylor expanded in y around inf 83.3%
Simplified83.3%
if -3.39999999999999986e131 < y < -5.2000000000000001e40Initial program 99.9%
fma-def99.9%
associate-+l+99.9%
+-commutative99.9%
count-299.9%
Simplified99.9%
Taylor expanded in x around inf 89.3%
Taylor expanded in t around 0 69.8%
associate-*r*69.8%
*-commutative69.8%
Simplified69.8%
if -1.99999999999999982e-21 < y < 3.6000000000000003e76Initial program 99.9%
Taylor expanded in y around 0 80.1%
Final simplification80.7%
(FPCore (x y z t) :precision binary64 (if (or (<= x -2.5) (not (<= x 1.7e-7))) (* x (+ t (* (+ y z) 2.0))) (+ (* x (+ t (+ z z))) (* y 5.0))))
double code(double x, double y, double z, double t) {
double tmp;
if ((x <= -2.5) || !(x <= 1.7e-7)) {
tmp = x * (t + ((y + z) * 2.0));
} else {
tmp = (x * (t + (z + z))) + (y * 5.0);
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if ((x <= (-2.5d0)) .or. (.not. (x <= 1.7d-7))) then
tmp = x * (t + ((y + z) * 2.0d0))
else
tmp = (x * (t + (z + z))) + (y * 5.0d0)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((x <= -2.5) || !(x <= 1.7e-7)) {
tmp = x * (t + ((y + z) * 2.0));
} else {
tmp = (x * (t + (z + z))) + (y * 5.0);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (x <= -2.5) or not (x <= 1.7e-7): tmp = x * (t + ((y + z) * 2.0)) else: tmp = (x * (t + (z + z))) + (y * 5.0) return tmp
function code(x, y, z, t) tmp = 0.0 if ((x <= -2.5) || !(x <= 1.7e-7)) tmp = Float64(x * Float64(t + Float64(Float64(y + z) * 2.0))); else tmp = Float64(Float64(x * Float64(t + Float64(z + z))) + Float64(y * 5.0)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((x <= -2.5) || ~((x <= 1.7e-7))) tmp = x * (t + ((y + z) * 2.0)); else tmp = (x * (t + (z + z))) + (y * 5.0); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[x, -2.5], N[Not[LessEqual[x, 1.7e-7]], $MachinePrecision]], N[(x * N[(t + N[(N[(y + z), $MachinePrecision] * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x * N[(t + N[(z + z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(y * 5.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -2.5 \lor \neg \left(x \leq 1.7 \cdot 10^{-7}\right):\\
\;\;\;\;x \cdot \left(t + \left(y + z\right) \cdot 2\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(t + \left(z + z\right)\right) + y \cdot 5\\
\end{array}
\end{array}
if x < -2.5 or 1.69999999999999987e-7 < x Initial program 99.9%
fma-def100.0%
associate-+l+100.0%
+-commutative100.0%
count-2100.0%
Simplified100.0%
Taylor expanded in x around inf 99.1%
if -2.5 < x < 1.69999999999999987e-7Initial program 99.9%
Taylor expanded in y around 0 99.3%
Simplified99.3%
Final simplification99.2%
(FPCore (x y z t) :precision binary64 (+ (* x (+ t (+ y (+ z (+ y z))))) (* y 5.0)))
double code(double x, double y, double z, double t) {
return (x * (t + (y + (z + (y + z))))) + (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 * (t + (y + (z + (y + z))))) + (y * 5.0d0)
end function
public static double code(double x, double y, double z, double t) {
return (x * (t + (y + (z + (y + z))))) + (y * 5.0);
}
def code(x, y, z, t): return (x * (t + (y + (z + (y + z))))) + (y * 5.0)
function code(x, y, z, t) return Float64(Float64(x * Float64(t + Float64(y + Float64(z + Float64(y + z))))) + Float64(y * 5.0)) end
function tmp = code(x, y, z, t) tmp = (x * (t + (y + (z + (y + z))))) + (y * 5.0); end
code[x_, y_, z_, t_] := N[(N[(x * N[(t + N[(y + N[(z + N[(y + z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(y * 5.0), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x \cdot \left(t + \left(y + \left(z + \left(y + z\right)\right)\right)\right) + y \cdot 5
\end{array}
Initial program 99.9%
Final simplification99.9%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* x (+ t (* z 2.0)))))
(if (<= x -2.05e-71)
t_1
(if (<= x 2.6e-178)
(* y 5.0)
(if (<= x 3.2e+108) t_1 (* x (+ t (* y 2.0))))))))
double code(double x, double y, double z, double t) {
double t_1 = x * (t + (z * 2.0));
double tmp;
if (x <= -2.05e-71) {
tmp = t_1;
} else if (x <= 2.6e-178) {
tmp = y * 5.0;
} else if (x <= 3.2e+108) {
tmp = t_1;
} else {
tmp = x * (t + (y * 2.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 = x * (t + (z * 2.0d0))
if (x <= (-2.05d-71)) then
tmp = t_1
else if (x <= 2.6d-178) then
tmp = y * 5.0d0
else if (x <= 3.2d+108) then
tmp = t_1
else
tmp = x * (t + (y * 2.0d0))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = x * (t + (z * 2.0));
double tmp;
if (x <= -2.05e-71) {
tmp = t_1;
} else if (x <= 2.6e-178) {
tmp = y * 5.0;
} else if (x <= 3.2e+108) {
tmp = t_1;
} else {
tmp = x * (t + (y * 2.0));
}
return tmp;
}
def code(x, y, z, t): t_1 = x * (t + (z * 2.0)) tmp = 0 if x <= -2.05e-71: tmp = t_1 elif x <= 2.6e-178: tmp = y * 5.0 elif x <= 3.2e+108: tmp = t_1 else: tmp = x * (t + (y * 2.0)) return tmp
function code(x, y, z, t) t_1 = Float64(x * Float64(t + Float64(z * 2.0))) tmp = 0.0 if (x <= -2.05e-71) tmp = t_1; elseif (x <= 2.6e-178) tmp = Float64(y * 5.0); elseif (x <= 3.2e+108) tmp = t_1; else tmp = Float64(x * Float64(t + Float64(y * 2.0))); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = x * (t + (z * 2.0)); tmp = 0.0; if (x <= -2.05e-71) tmp = t_1; elseif (x <= 2.6e-178) tmp = y * 5.0; elseif (x <= 3.2e+108) tmp = t_1; else tmp = x * (t + (y * 2.0)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(x * N[(t + N[(z * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -2.05e-71], t$95$1, If[LessEqual[x, 2.6e-178], N[(y * 5.0), $MachinePrecision], If[LessEqual[x, 3.2e+108], t$95$1, N[(x * N[(t + N[(y * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot \left(t + z \cdot 2\right)\\
\mathbf{if}\;x \leq -2.05 \cdot 10^{-71}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \leq 2.6 \cdot 10^{-178}:\\
\;\;\;\;y \cdot 5\\
\mathbf{elif}\;x \leq 3.2 \cdot 10^{+108}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(t + y \cdot 2\right)\\
\end{array}
\end{array}
if x < -2.04999999999999997e-71 or 2.59999999999999998e-178 < x < 3.1999999999999999e108Initial program 99.9%
Taylor expanded in y around 0 66.8%
if -2.04999999999999997e-71 < x < 2.59999999999999998e-178Initial program 99.9%
Taylor expanded in x around 0 69.9%
if 3.1999999999999999e108 < x Initial program 100.0%
fma-def100.0%
associate-+l+100.0%
+-commutative100.0%
count-2100.0%
Simplified100.0%
Taylor expanded in x around inf 100.0%
Taylor expanded in z around 0 86.1%
*-commutative86.1%
Simplified86.1%
Final simplification70.3%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* 2.0 (* y x))))
(if (<= x -2.5)
t_1
(if (<= x 1.7e-14) (* y 5.0) (if (<= x 3.3e+133) (* x t) t_1)))))
double code(double x, double y, double z, double t) {
double t_1 = 2.0 * (y * x);
double tmp;
if (x <= -2.5) {
tmp = t_1;
} else if (x <= 1.7e-14) {
tmp = y * 5.0;
} else if (x <= 3.3e+133) {
tmp = x * t;
} 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 = 2.0d0 * (y * x)
if (x <= (-2.5d0)) then
tmp = t_1
else if (x <= 1.7d-14) then
tmp = y * 5.0d0
else if (x <= 3.3d+133) then
tmp = x * t
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 = 2.0 * (y * x);
double tmp;
if (x <= -2.5) {
tmp = t_1;
} else if (x <= 1.7e-14) {
tmp = y * 5.0;
} else if (x <= 3.3e+133) {
tmp = x * t;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = 2.0 * (y * x) tmp = 0 if x <= -2.5: tmp = t_1 elif x <= 1.7e-14: tmp = y * 5.0 elif x <= 3.3e+133: tmp = x * t else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(2.0 * Float64(y * x)) tmp = 0.0 if (x <= -2.5) tmp = t_1; elseif (x <= 1.7e-14) tmp = Float64(y * 5.0); elseif (x <= 3.3e+133) tmp = Float64(x * t); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = 2.0 * (y * x); tmp = 0.0; if (x <= -2.5) tmp = t_1; elseif (x <= 1.7e-14) tmp = y * 5.0; elseif (x <= 3.3e+133) tmp = x * t; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(2.0 * N[(y * x), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -2.5], t$95$1, If[LessEqual[x, 1.7e-14], N[(y * 5.0), $MachinePrecision], If[LessEqual[x, 3.3e+133], N[(x * t), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := 2 \cdot \left(y \cdot x\right)\\
\mathbf{if}\;x \leq -2.5:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \leq 1.7 \cdot 10^{-14}:\\
\;\;\;\;y \cdot 5\\
\mathbf{elif}\;x \leq 3.3 \cdot 10^{+133}:\\
\;\;\;\;x \cdot t\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if x < -2.5 or 3.3e133 < x Initial program 100.0%
fma-def100.0%
associate-+l+100.0%
+-commutative100.0%
count-2100.0%
Simplified100.0%
Taylor expanded in x around inf 99.4%
Taylor expanded in z around 0 71.3%
*-commutative71.3%
Simplified71.3%
Taylor expanded in t around 0 44.7%
if -2.5 < x < 1.70000000000000001e-14Initial program 99.9%
Taylor expanded in x around 0 55.4%
if 1.70000000000000001e-14 < x < 3.3e133Initial program 99.8%
Taylor expanded in t around inf 45.3%
Final simplification50.1%
(FPCore (x y z t) :precision binary64 (if (or (<= x -3.2e-68) (not (<= x 3.9e-179))) (* x (+ t (* z 2.0))) (* y 5.0)))
double code(double x, double y, double z, double t) {
double tmp;
if ((x <= -3.2e-68) || !(x <= 3.9e-179)) {
tmp = x * (t + (z * 2.0));
} else {
tmp = y * 5.0;
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if ((x <= (-3.2d-68)) .or. (.not. (x <= 3.9d-179))) then
tmp = x * (t + (z * 2.0d0))
else
tmp = y * 5.0d0
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((x <= -3.2e-68) || !(x <= 3.9e-179)) {
tmp = x * (t + (z * 2.0));
} else {
tmp = y * 5.0;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (x <= -3.2e-68) or not (x <= 3.9e-179): tmp = x * (t + (z * 2.0)) else: tmp = y * 5.0 return tmp
function code(x, y, z, t) tmp = 0.0 if ((x <= -3.2e-68) || !(x <= 3.9e-179)) tmp = Float64(x * Float64(t + Float64(z * 2.0))); else tmp = Float64(y * 5.0); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((x <= -3.2e-68) || ~((x <= 3.9e-179))) tmp = x * (t + (z * 2.0)); else tmp = y * 5.0; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[x, -3.2e-68], N[Not[LessEqual[x, 3.9e-179]], $MachinePrecision]], N[(x * N[(t + N[(z * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(y * 5.0), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -3.2 \cdot 10^{-68} \lor \neg \left(x \leq 3.9 \cdot 10^{-179}\right):\\
\;\;\;\;x \cdot \left(t + z \cdot 2\right)\\
\mathbf{else}:\\
\;\;\;\;y \cdot 5\\
\end{array}
\end{array}
if x < -3.1999999999999999e-68 or 3.9000000000000003e-179 < x Initial program 99.9%
Taylor expanded in y around 0 65.9%
if -3.1999999999999999e-68 < x < 3.9000000000000003e-179Initial program 99.9%
Taylor expanded in x around 0 69.9%
Final simplification67.1%
(FPCore (x y z t) :precision binary64 (if (or (<= y -2.6e-21) (not (<= y 1.66e+80))) (* y (+ 5.0 (* x 2.0))) (* x (+ t (* z 2.0)))))
double code(double x, double y, double z, double t) {
double tmp;
if ((y <= -2.6e-21) || !(y <= 1.66e+80)) {
tmp = y * (5.0 + (x * 2.0));
} else {
tmp = x * (t + (z * 2.0));
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if ((y <= (-2.6d-21)) .or. (.not. (y <= 1.66d+80))) then
tmp = y * (5.0d0 + (x * 2.0d0))
else
tmp = x * (t + (z * 2.0d0))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((y <= -2.6e-21) || !(y <= 1.66e+80)) {
tmp = y * (5.0 + (x * 2.0));
} else {
tmp = x * (t + (z * 2.0));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (y <= -2.6e-21) or not (y <= 1.66e+80): tmp = y * (5.0 + (x * 2.0)) else: tmp = x * (t + (z * 2.0)) return tmp
function code(x, y, z, t) tmp = 0.0 if ((y <= -2.6e-21) || !(y <= 1.66e+80)) tmp = Float64(y * Float64(5.0 + Float64(x * 2.0))); else tmp = Float64(x * Float64(t + Float64(z * 2.0))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((y <= -2.6e-21) || ~((y <= 1.66e+80))) tmp = y * (5.0 + (x * 2.0)); else tmp = x * (t + (z * 2.0)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[y, -2.6e-21], N[Not[LessEqual[y, 1.66e+80]], $MachinePrecision]], N[(y * N[(5.0 + N[(x * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x * N[(t + N[(z * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -2.6 \cdot 10^{-21} \lor \neg \left(y \leq 1.66 \cdot 10^{+80}\right):\\
\;\;\;\;y \cdot \left(5 + x \cdot 2\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(t + z \cdot 2\right)\\
\end{array}
\end{array}
if y < -2.60000000000000017e-21 or 1.6599999999999999e80 < y Initial program 99.9%
Taylor expanded in y around inf 77.9%
Simplified77.9%
if -2.60000000000000017e-21 < y < 1.6599999999999999e80Initial program 99.9%
Taylor expanded in y around 0 80.1%
Final simplification79.1%
(FPCore (x y z t) :precision binary64 (if (<= x -1.55e-9) (* x t) (if (<= x 7.2e-20) (* y 5.0) (* x t))))
double code(double x, double y, double z, double t) {
double tmp;
if (x <= -1.55e-9) {
tmp = x * t;
} else if (x <= 7.2e-20) {
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 <= (-1.55d-9)) then
tmp = x * t
else if (x <= 7.2d-20) 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 <= -1.55e-9) {
tmp = x * t;
} else if (x <= 7.2e-20) {
tmp = y * 5.0;
} else {
tmp = x * t;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if x <= -1.55e-9: tmp = x * t elif x <= 7.2e-20: tmp = y * 5.0 else: tmp = x * t return tmp
function code(x, y, z, t) tmp = 0.0 if (x <= -1.55e-9) tmp = Float64(x * t); elseif (x <= 7.2e-20) 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 <= -1.55e-9) tmp = x * t; elseif (x <= 7.2e-20) tmp = y * 5.0; else tmp = x * t; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[x, -1.55e-9], N[(x * t), $MachinePrecision], If[LessEqual[x, 7.2e-20], N[(y * 5.0), $MachinePrecision], N[(x * t), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.55 \cdot 10^{-9}:\\
\;\;\;\;x \cdot t\\
\mathbf{elif}\;x \leq 7.2 \cdot 10^{-20}:\\
\;\;\;\;y \cdot 5\\
\mathbf{else}:\\
\;\;\;\;x \cdot t\\
\end{array}
\end{array}
if x < -1.55000000000000002e-9 or 7.19999999999999948e-20 < x Initial program 99.9%
Taylor expanded in t around inf 35.4%
if -1.55000000000000002e-9 < x < 7.19999999999999948e-20Initial program 99.9%
Taylor expanded in x around 0 57.1%
Final simplification45.8%
(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 29.1%
Final simplification29.1%
herbie shell --seed 2023271
(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)))