
(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 15 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 x (+ (+ y (+ z z)) (+ y t)) (* y 5.0)))
double code(double x, double y, double z, double t) {
return fma(x, ((y + (z + z)) + (y + t)), (y * 5.0));
}
function code(x, y, z, t) return fma(x, Float64(Float64(y + Float64(z + z)) + Float64(y + t)), Float64(y * 5.0)) end
code[x_, y_, z_, t_] := N[(x * N[(N[(y + N[(z + z), $MachinePrecision]), $MachinePrecision] + N[(y + t), $MachinePrecision]), $MachinePrecision] + N[(y * 5.0), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\mathsf{fma}\left(x, \left(y + \left(z + z\right)\right) + \left(y + t\right), y \cdot 5\right)
\end{array}
Initial program 100.0%
fma-define100.0%
associate-+l+100.0%
associate-+l+100.0%
Simplified100.0%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* 2.0 (* x (+ y z)))) (t_2 (* 2.0 (* x z))))
(if (<= x -270000000000.0)
t_1
(if (<= x -6.3e-89)
(* x t)
(if (<= x -2.1e-246)
(* y 5.0)
(if (<= x -2e-246)
t_2
(if (<= x 3.5e-242)
(* y 5.0)
(if (<= x 3.55e-242)
t_2
(if (<= x 5.5e-17)
(* y 5.0)
(if (or (<= x 1.9e+70) (not (<= x 2e+85)))
t_1
(* x t)))))))))))
double code(double x, double y, double z, double t) {
double t_1 = 2.0 * (x * (y + z));
double t_2 = 2.0 * (x * z);
double tmp;
if (x <= -270000000000.0) {
tmp = t_1;
} else if (x <= -6.3e-89) {
tmp = x * t;
} else if (x <= -2.1e-246) {
tmp = y * 5.0;
} else if (x <= -2e-246) {
tmp = t_2;
} else if (x <= 3.5e-242) {
tmp = y * 5.0;
} else if (x <= 3.55e-242) {
tmp = t_2;
} else if (x <= 5.5e-17) {
tmp = y * 5.0;
} else if ((x <= 1.9e+70) || !(x <= 2e+85)) {
tmp = t_1;
} 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) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = 2.0d0 * (x * (y + z))
t_2 = 2.0d0 * (x * z)
if (x <= (-270000000000.0d0)) then
tmp = t_1
else if (x <= (-6.3d-89)) then
tmp = x * t
else if (x <= (-2.1d-246)) then
tmp = y * 5.0d0
else if (x <= (-2d-246)) then
tmp = t_2
else if (x <= 3.5d-242) then
tmp = y * 5.0d0
else if (x <= 3.55d-242) then
tmp = t_2
else if (x <= 5.5d-17) then
tmp = y * 5.0d0
else if ((x <= 1.9d+70) .or. (.not. (x <= 2d+85))) then
tmp = t_1
else
tmp = x * t
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = 2.0 * (x * (y + z));
double t_2 = 2.0 * (x * z);
double tmp;
if (x <= -270000000000.0) {
tmp = t_1;
} else if (x <= -6.3e-89) {
tmp = x * t;
} else if (x <= -2.1e-246) {
tmp = y * 5.0;
} else if (x <= -2e-246) {
tmp = t_2;
} else if (x <= 3.5e-242) {
tmp = y * 5.0;
} else if (x <= 3.55e-242) {
tmp = t_2;
} else if (x <= 5.5e-17) {
tmp = y * 5.0;
} else if ((x <= 1.9e+70) || !(x <= 2e+85)) {
tmp = t_1;
} else {
tmp = x * t;
}
return tmp;
}
def code(x, y, z, t): t_1 = 2.0 * (x * (y + z)) t_2 = 2.0 * (x * z) tmp = 0 if x <= -270000000000.0: tmp = t_1 elif x <= -6.3e-89: tmp = x * t elif x <= -2.1e-246: tmp = y * 5.0 elif x <= -2e-246: tmp = t_2 elif x <= 3.5e-242: tmp = y * 5.0 elif x <= 3.55e-242: tmp = t_2 elif x <= 5.5e-17: tmp = y * 5.0 elif (x <= 1.9e+70) or not (x <= 2e+85): tmp = t_1 else: tmp = x * t return tmp
function code(x, y, z, t) t_1 = Float64(2.0 * Float64(x * Float64(y + z))) t_2 = Float64(2.0 * Float64(x * z)) tmp = 0.0 if (x <= -270000000000.0) tmp = t_1; elseif (x <= -6.3e-89) tmp = Float64(x * t); elseif (x <= -2.1e-246) tmp = Float64(y * 5.0); elseif (x <= -2e-246) tmp = t_2; elseif (x <= 3.5e-242) tmp = Float64(y * 5.0); elseif (x <= 3.55e-242) tmp = t_2; elseif (x <= 5.5e-17) tmp = Float64(y * 5.0); elseif ((x <= 1.9e+70) || !(x <= 2e+85)) tmp = t_1; else tmp = Float64(x * t); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = 2.0 * (x * (y + z)); t_2 = 2.0 * (x * z); tmp = 0.0; if (x <= -270000000000.0) tmp = t_1; elseif (x <= -6.3e-89) tmp = x * t; elseif (x <= -2.1e-246) tmp = y * 5.0; elseif (x <= -2e-246) tmp = t_2; elseif (x <= 3.5e-242) tmp = y * 5.0; elseif (x <= 3.55e-242) tmp = t_2; elseif (x <= 5.5e-17) tmp = y * 5.0; elseif ((x <= 1.9e+70) || ~((x <= 2e+85))) tmp = t_1; else tmp = x * t; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(2.0 * N[(x * N[(y + z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(2.0 * N[(x * z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -270000000000.0], t$95$1, If[LessEqual[x, -6.3e-89], N[(x * t), $MachinePrecision], If[LessEqual[x, -2.1e-246], N[(y * 5.0), $MachinePrecision], If[LessEqual[x, -2e-246], t$95$2, If[LessEqual[x, 3.5e-242], N[(y * 5.0), $MachinePrecision], If[LessEqual[x, 3.55e-242], t$95$2, If[LessEqual[x, 5.5e-17], N[(y * 5.0), $MachinePrecision], If[Or[LessEqual[x, 1.9e+70], N[Not[LessEqual[x, 2e+85]], $MachinePrecision]], t$95$1, N[(x * t), $MachinePrecision]]]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := 2 \cdot \left(x \cdot \left(y + z\right)\right)\\
t_2 := 2 \cdot \left(x \cdot z\right)\\
\mathbf{if}\;x \leq -270000000000:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \leq -6.3 \cdot 10^{-89}:\\
\;\;\;\;x \cdot t\\
\mathbf{elif}\;x \leq -2.1 \cdot 10^{-246}:\\
\;\;\;\;y \cdot 5\\
\mathbf{elif}\;x \leq -2 \cdot 10^{-246}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;x \leq 3.5 \cdot 10^{-242}:\\
\;\;\;\;y \cdot 5\\
\mathbf{elif}\;x \leq 3.55 \cdot 10^{-242}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;x \leq 5.5 \cdot 10^{-17}:\\
\;\;\;\;y \cdot 5\\
\mathbf{elif}\;x \leq 1.9 \cdot 10^{+70} \lor \neg \left(x \leq 2 \cdot 10^{+85}\right):\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;x \cdot t\\
\end{array}
\end{array}
if x < -2.7e11 or 5.50000000000000001e-17 < x < 1.8999999999999999e70 or 2e85 < x Initial program 100.0%
Taylor expanded in y around 0 100.0%
Taylor expanded in t around 0 76.4%
*-commutative76.4%
distribute-lft-out76.4%
Simplified76.4%
Taylor expanded in x around inf 76.4%
+-commutative76.4%
Simplified76.4%
if -2.7e11 < x < -6.2999999999999996e-89 or 1.8999999999999999e70 < x < 2e85Initial program 99.9%
Taylor expanded in t around inf 49.4%
Simplified49.4%
if -6.2999999999999996e-89 < x < -2.09999999999999995e-246 or -1.99999999999999991e-246 < x < 3.4999999999999999e-242 or 3.54999999999999981e-242 < x < 5.50000000000000001e-17Initial program 100.0%
Taylor expanded in x around 0 77.9%
if -2.09999999999999995e-246 < x < -1.99999999999999991e-246 or 3.4999999999999999e-242 < x < 3.54999999999999981e-242Initial program 100.0%
Taylor expanded in z around inf 100.0%
Final simplification74.3%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* x (+ t (* z 2.0)))) (t_2 (* 2.0 (* x (+ y z)))))
(if (<= x -4.8e+141)
t_2
(if (<= x -8.6e+123)
t_1
(if (<= x -8e+24)
t_2
(if (<= x -3.8e-40)
t_1
(if (<= x 1.05e-17)
(* y 5.0)
(if (<= x 6.5e+47)
t_1
(if (<= x 4.4e+73)
t_2
(if (<= x 3.15e+122)
t_1
(if (<= x 6.7e+137) t_2 (* x (+ t (* y 2.0))))))))))))))
double code(double x, double y, double z, double t) {
double t_1 = x * (t + (z * 2.0));
double t_2 = 2.0 * (x * (y + z));
double tmp;
if (x <= -4.8e+141) {
tmp = t_2;
} else if (x <= -8.6e+123) {
tmp = t_1;
} else if (x <= -8e+24) {
tmp = t_2;
} else if (x <= -3.8e-40) {
tmp = t_1;
} else if (x <= 1.05e-17) {
tmp = y * 5.0;
} else if (x <= 6.5e+47) {
tmp = t_1;
} else if (x <= 4.4e+73) {
tmp = t_2;
} else if (x <= 3.15e+122) {
tmp = t_1;
} else if (x <= 6.7e+137) {
tmp = t_2;
} 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) :: t_2
real(8) :: tmp
t_1 = x * (t + (z * 2.0d0))
t_2 = 2.0d0 * (x * (y + z))
if (x <= (-4.8d+141)) then
tmp = t_2
else if (x <= (-8.6d+123)) then
tmp = t_1
else if (x <= (-8d+24)) then
tmp = t_2
else if (x <= (-3.8d-40)) then
tmp = t_1
else if (x <= 1.05d-17) then
tmp = y * 5.0d0
else if (x <= 6.5d+47) then
tmp = t_1
else if (x <= 4.4d+73) then
tmp = t_2
else if (x <= 3.15d+122) then
tmp = t_1
else if (x <= 6.7d+137) then
tmp = t_2
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 t_2 = 2.0 * (x * (y + z));
double tmp;
if (x <= -4.8e+141) {
tmp = t_2;
} else if (x <= -8.6e+123) {
tmp = t_1;
} else if (x <= -8e+24) {
tmp = t_2;
} else if (x <= -3.8e-40) {
tmp = t_1;
} else if (x <= 1.05e-17) {
tmp = y * 5.0;
} else if (x <= 6.5e+47) {
tmp = t_1;
} else if (x <= 4.4e+73) {
tmp = t_2;
} else if (x <= 3.15e+122) {
tmp = t_1;
} else if (x <= 6.7e+137) {
tmp = t_2;
} else {
tmp = x * (t + (y * 2.0));
}
return tmp;
}
def code(x, y, z, t): t_1 = x * (t + (z * 2.0)) t_2 = 2.0 * (x * (y + z)) tmp = 0 if x <= -4.8e+141: tmp = t_2 elif x <= -8.6e+123: tmp = t_1 elif x <= -8e+24: tmp = t_2 elif x <= -3.8e-40: tmp = t_1 elif x <= 1.05e-17: tmp = y * 5.0 elif x <= 6.5e+47: tmp = t_1 elif x <= 4.4e+73: tmp = t_2 elif x <= 3.15e+122: tmp = t_1 elif x <= 6.7e+137: tmp = t_2 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))) t_2 = Float64(2.0 * Float64(x * Float64(y + z))) tmp = 0.0 if (x <= -4.8e+141) tmp = t_2; elseif (x <= -8.6e+123) tmp = t_1; elseif (x <= -8e+24) tmp = t_2; elseif (x <= -3.8e-40) tmp = t_1; elseif (x <= 1.05e-17) tmp = Float64(y * 5.0); elseif (x <= 6.5e+47) tmp = t_1; elseif (x <= 4.4e+73) tmp = t_2; elseif (x <= 3.15e+122) tmp = t_1; elseif (x <= 6.7e+137) tmp = t_2; 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)); t_2 = 2.0 * (x * (y + z)); tmp = 0.0; if (x <= -4.8e+141) tmp = t_2; elseif (x <= -8.6e+123) tmp = t_1; elseif (x <= -8e+24) tmp = t_2; elseif (x <= -3.8e-40) tmp = t_1; elseif (x <= 1.05e-17) tmp = y * 5.0; elseif (x <= 6.5e+47) tmp = t_1; elseif (x <= 4.4e+73) tmp = t_2; elseif (x <= 3.15e+122) tmp = t_1; elseif (x <= 6.7e+137) tmp = t_2; 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]}, Block[{t$95$2 = N[(2.0 * N[(x * N[(y + z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -4.8e+141], t$95$2, If[LessEqual[x, -8.6e+123], t$95$1, If[LessEqual[x, -8e+24], t$95$2, If[LessEqual[x, -3.8e-40], t$95$1, If[LessEqual[x, 1.05e-17], N[(y * 5.0), $MachinePrecision], If[LessEqual[x, 6.5e+47], t$95$1, If[LessEqual[x, 4.4e+73], t$95$2, If[LessEqual[x, 3.15e+122], t$95$1, If[LessEqual[x, 6.7e+137], t$95$2, 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)\\
t_2 := 2 \cdot \left(x \cdot \left(y + z\right)\right)\\
\mathbf{if}\;x \leq -4.8 \cdot 10^{+141}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;x \leq -8.6 \cdot 10^{+123}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \leq -8 \cdot 10^{+24}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;x \leq -3.8 \cdot 10^{-40}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \leq 1.05 \cdot 10^{-17}:\\
\;\;\;\;y \cdot 5\\
\mathbf{elif}\;x \leq 6.5 \cdot 10^{+47}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \leq 4.4 \cdot 10^{+73}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;x \leq 3.15 \cdot 10^{+122}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \leq 6.7 \cdot 10^{+137}:\\
\;\;\;\;t\_2\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(t + y \cdot 2\right)\\
\end{array}
\end{array}
if x < -4.79999999999999995e141 or -8.59999999999999972e123 < x < -7.9999999999999999e24 or 6.49999999999999988e47 < x < 4.4e73 or 3.1500000000000001e122 < x < 6.6999999999999999e137Initial program 100.0%
Taylor expanded in y around 0 100.0%
Taylor expanded in t around 0 88.2%
*-commutative88.2%
distribute-lft-out88.2%
Simplified88.2%
Taylor expanded in x around inf 88.2%
+-commutative88.2%
Simplified88.2%
if -4.79999999999999995e141 < x < -8.59999999999999972e123 or -7.9999999999999999e24 < x < -3.7999999999999999e-40 or 1.04999999999999996e-17 < x < 6.49999999999999988e47 or 4.4e73 < x < 3.1500000000000001e122Initial program 99.9%
Taylor expanded in y around 0 88.3%
if -3.7999999999999999e-40 < x < 1.04999999999999996e-17Initial program 99.9%
Taylor expanded in x around 0 71.3%
if 6.6999999999999999e137 < x Initial program 100.0%
Taylor expanded in y around 0 100.0%
Taylor expanded in x around inf 100.0%
+-commutative100.0%
distribute-lft-out100.0%
Simplified100.0%
Taylor expanded in z around 0 78.5%
Final simplification79.8%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* 2.0 (* x z))) (t_2 (* x (* y 2.0))))
(if (<= x -2.3e+65)
t_1
(if (<= x -3.6e+37)
t_2
(if (<= x -3.2e-40)
(* x t)
(if (<= x 5.8e-17)
(* y 5.0)
(if (<= x 10500000.0)
t_1
(if (<= x 1.82e+46)
(* x t)
(if (<= x 5e+82)
t_2
(if (<= x 8.2e+83)
(* x t)
(if (<= x 8.4e+127) t_1 t_2)))))))))))
double code(double x, double y, double z, double t) {
double t_1 = 2.0 * (x * z);
double t_2 = x * (y * 2.0);
double tmp;
if (x <= -2.3e+65) {
tmp = t_1;
} else if (x <= -3.6e+37) {
tmp = t_2;
} else if (x <= -3.2e-40) {
tmp = x * t;
} else if (x <= 5.8e-17) {
tmp = y * 5.0;
} else if (x <= 10500000.0) {
tmp = t_1;
} else if (x <= 1.82e+46) {
tmp = x * t;
} else if (x <= 5e+82) {
tmp = t_2;
} else if (x <= 8.2e+83) {
tmp = x * t;
} else if (x <= 8.4e+127) {
tmp = t_1;
} else {
tmp = t_2;
}
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 = 2.0d0 * (x * z)
t_2 = x * (y * 2.0d0)
if (x <= (-2.3d+65)) then
tmp = t_1
else if (x <= (-3.6d+37)) then
tmp = t_2
else if (x <= (-3.2d-40)) then
tmp = x * t
else if (x <= 5.8d-17) then
tmp = y * 5.0d0
else if (x <= 10500000.0d0) then
tmp = t_1
else if (x <= 1.82d+46) then
tmp = x * t
else if (x <= 5d+82) then
tmp = t_2
else if (x <= 8.2d+83) then
tmp = x * t
else if (x <= 8.4d+127) then
tmp = t_1
else
tmp = t_2
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 t_2 = x * (y * 2.0);
double tmp;
if (x <= -2.3e+65) {
tmp = t_1;
} else if (x <= -3.6e+37) {
tmp = t_2;
} else if (x <= -3.2e-40) {
tmp = x * t;
} else if (x <= 5.8e-17) {
tmp = y * 5.0;
} else if (x <= 10500000.0) {
tmp = t_1;
} else if (x <= 1.82e+46) {
tmp = x * t;
} else if (x <= 5e+82) {
tmp = t_2;
} else if (x <= 8.2e+83) {
tmp = x * t;
} else if (x <= 8.4e+127) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t): t_1 = 2.0 * (x * z) t_2 = x * (y * 2.0) tmp = 0 if x <= -2.3e+65: tmp = t_1 elif x <= -3.6e+37: tmp = t_2 elif x <= -3.2e-40: tmp = x * t elif x <= 5.8e-17: tmp = y * 5.0 elif x <= 10500000.0: tmp = t_1 elif x <= 1.82e+46: tmp = x * t elif x <= 5e+82: tmp = t_2 elif x <= 8.2e+83: tmp = x * t elif x <= 8.4e+127: tmp = t_1 else: tmp = t_2 return tmp
function code(x, y, z, t) t_1 = Float64(2.0 * Float64(x * z)) t_2 = Float64(x * Float64(y * 2.0)) tmp = 0.0 if (x <= -2.3e+65) tmp = t_1; elseif (x <= -3.6e+37) tmp = t_2; elseif (x <= -3.2e-40) tmp = Float64(x * t); elseif (x <= 5.8e-17) tmp = Float64(y * 5.0); elseif (x <= 10500000.0) tmp = t_1; elseif (x <= 1.82e+46) tmp = Float64(x * t); elseif (x <= 5e+82) tmp = t_2; elseif (x <= 8.2e+83) tmp = Float64(x * t); elseif (x <= 8.4e+127) tmp = t_1; else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = 2.0 * (x * z); t_2 = x * (y * 2.0); tmp = 0.0; if (x <= -2.3e+65) tmp = t_1; elseif (x <= -3.6e+37) tmp = t_2; elseif (x <= -3.2e-40) tmp = x * t; elseif (x <= 5.8e-17) tmp = y * 5.0; elseif (x <= 10500000.0) tmp = t_1; elseif (x <= 1.82e+46) tmp = x * t; elseif (x <= 5e+82) tmp = t_2; elseif (x <= 8.2e+83) tmp = x * t; elseif (x <= 8.4e+127) tmp = t_1; else tmp = t_2; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(2.0 * N[(x * z), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(x * N[(y * 2.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -2.3e+65], t$95$1, If[LessEqual[x, -3.6e+37], t$95$2, If[LessEqual[x, -3.2e-40], N[(x * t), $MachinePrecision], If[LessEqual[x, 5.8e-17], N[(y * 5.0), $MachinePrecision], If[LessEqual[x, 10500000.0], t$95$1, If[LessEqual[x, 1.82e+46], N[(x * t), $MachinePrecision], If[LessEqual[x, 5e+82], t$95$2, If[LessEqual[x, 8.2e+83], N[(x * t), $MachinePrecision], If[LessEqual[x, 8.4e+127], t$95$1, t$95$2]]]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := 2 \cdot \left(x \cdot z\right)\\
t_2 := x \cdot \left(y \cdot 2\right)\\
\mathbf{if}\;x \leq -2.3 \cdot 10^{+65}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \leq -3.6 \cdot 10^{+37}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;x \leq -3.2 \cdot 10^{-40}:\\
\;\;\;\;x \cdot t\\
\mathbf{elif}\;x \leq 5.8 \cdot 10^{-17}:\\
\;\;\;\;y \cdot 5\\
\mathbf{elif}\;x \leq 10500000:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \leq 1.82 \cdot 10^{+46}:\\
\;\;\;\;x \cdot t\\
\mathbf{elif}\;x \leq 5 \cdot 10^{+82}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;x \leq 8.2 \cdot 10^{+83}:\\
\;\;\;\;x \cdot t\\
\mathbf{elif}\;x \leq 8.4 \cdot 10^{+127}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if x < -2.3e65 or 5.8000000000000006e-17 < x < 1.05e7 or 8.2000000000000002e83 < x < 8.39999999999999967e127Initial program 100.0%
Taylor expanded in z around inf 52.1%
if -2.3e65 < x < -3.59999999999999998e37 or 1.81999999999999989e46 < x < 5.00000000000000015e82 or 8.39999999999999967e127 < x Initial program 100.0%
Taylor expanded in y around 0 100.0%
Taylor expanded in t around 0 76.3%
*-commutative76.3%
distribute-lft-out76.3%
Simplified76.3%
Taylor expanded in x around inf 76.3%
+-commutative76.3%
Simplified76.3%
Taylor expanded in z around 0 51.2%
*-commutative51.2%
associate-*l*51.2%
Simplified51.2%
if -3.59999999999999998e37 < x < -3.20000000000000002e-40 or 1.05e7 < x < 1.81999999999999989e46 or 5.00000000000000015e82 < x < 8.2000000000000002e83Initial program 99.9%
Taylor expanded in t around inf 53.7%
Simplified53.7%
if -3.20000000000000002e-40 < x < 5.8000000000000006e-17Initial program 99.9%
Taylor expanded in x around 0 72.0%
Final simplification60.7%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* x (+ t (* z 2.0)))) (t_2 (* 2.0 (* x (+ y z)))))
(if (<= x -4.6e+141)
t_2
(if (<= x -6.2e+123)
t_1
(if (<= x -7.8e+33)
t_2
(if (<= x 1.85e-16)
(+ (* y 5.0) (* x t))
(if (<= x 1.6e+122)
t_1
(if (<= x 2.2e+142)
t_2
(if (<= x 4.8e+278)
(* x (+ t (* y 2.0)))
(if (<= x 2.6e+305) t_2 (* x t)))))))))))
double code(double x, double y, double z, double t) {
double t_1 = x * (t + (z * 2.0));
double t_2 = 2.0 * (x * (y + z));
double tmp;
if (x <= -4.6e+141) {
tmp = t_2;
} else if (x <= -6.2e+123) {
tmp = t_1;
} else if (x <= -7.8e+33) {
tmp = t_2;
} else if (x <= 1.85e-16) {
tmp = (y * 5.0) + (x * t);
} else if (x <= 1.6e+122) {
tmp = t_1;
} else if (x <= 2.2e+142) {
tmp = t_2;
} else if (x <= 4.8e+278) {
tmp = x * (t + (y * 2.0));
} else if (x <= 2.6e+305) {
tmp = t_2;
} 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) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = x * (t + (z * 2.0d0))
t_2 = 2.0d0 * (x * (y + z))
if (x <= (-4.6d+141)) then
tmp = t_2
else if (x <= (-6.2d+123)) then
tmp = t_1
else if (x <= (-7.8d+33)) then
tmp = t_2
else if (x <= 1.85d-16) then
tmp = (y * 5.0d0) + (x * t)
else if (x <= 1.6d+122) then
tmp = t_1
else if (x <= 2.2d+142) then
tmp = t_2
else if (x <= 4.8d+278) then
tmp = x * (t + (y * 2.0d0))
else if (x <= 2.6d+305) then
tmp = t_2
else
tmp = x * t
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 t_2 = 2.0 * (x * (y + z));
double tmp;
if (x <= -4.6e+141) {
tmp = t_2;
} else if (x <= -6.2e+123) {
tmp = t_1;
} else if (x <= -7.8e+33) {
tmp = t_2;
} else if (x <= 1.85e-16) {
tmp = (y * 5.0) + (x * t);
} else if (x <= 1.6e+122) {
tmp = t_1;
} else if (x <= 2.2e+142) {
tmp = t_2;
} else if (x <= 4.8e+278) {
tmp = x * (t + (y * 2.0));
} else if (x <= 2.6e+305) {
tmp = t_2;
} else {
tmp = x * t;
}
return tmp;
}
def code(x, y, z, t): t_1 = x * (t + (z * 2.0)) t_2 = 2.0 * (x * (y + z)) tmp = 0 if x <= -4.6e+141: tmp = t_2 elif x <= -6.2e+123: tmp = t_1 elif x <= -7.8e+33: tmp = t_2 elif x <= 1.85e-16: tmp = (y * 5.0) + (x * t) elif x <= 1.6e+122: tmp = t_1 elif x <= 2.2e+142: tmp = t_2 elif x <= 4.8e+278: tmp = x * (t + (y * 2.0)) elif x <= 2.6e+305: tmp = t_2 else: tmp = x * t return tmp
function code(x, y, z, t) t_1 = Float64(x * Float64(t + Float64(z * 2.0))) t_2 = Float64(2.0 * Float64(x * Float64(y + z))) tmp = 0.0 if (x <= -4.6e+141) tmp = t_2; elseif (x <= -6.2e+123) tmp = t_1; elseif (x <= -7.8e+33) tmp = t_2; elseif (x <= 1.85e-16) tmp = Float64(Float64(y * 5.0) + Float64(x * t)); elseif (x <= 1.6e+122) tmp = t_1; elseif (x <= 2.2e+142) tmp = t_2; elseif (x <= 4.8e+278) tmp = Float64(x * Float64(t + Float64(y * 2.0))); elseif (x <= 2.6e+305) tmp = t_2; else tmp = Float64(x * t); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = x * (t + (z * 2.0)); t_2 = 2.0 * (x * (y + z)); tmp = 0.0; if (x <= -4.6e+141) tmp = t_2; elseif (x <= -6.2e+123) tmp = t_1; elseif (x <= -7.8e+33) tmp = t_2; elseif (x <= 1.85e-16) tmp = (y * 5.0) + (x * t); elseif (x <= 1.6e+122) tmp = t_1; elseif (x <= 2.2e+142) tmp = t_2; elseif (x <= 4.8e+278) tmp = x * (t + (y * 2.0)); elseif (x <= 2.6e+305) tmp = t_2; else tmp = x * t; 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]}, Block[{t$95$2 = N[(2.0 * N[(x * N[(y + z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -4.6e+141], t$95$2, If[LessEqual[x, -6.2e+123], t$95$1, If[LessEqual[x, -7.8e+33], t$95$2, If[LessEqual[x, 1.85e-16], N[(N[(y * 5.0), $MachinePrecision] + N[(x * t), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 1.6e+122], t$95$1, If[LessEqual[x, 2.2e+142], t$95$2, If[LessEqual[x, 4.8e+278], N[(x * N[(t + N[(y * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 2.6e+305], t$95$2, N[(x * t), $MachinePrecision]]]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot \left(t + z \cdot 2\right)\\
t_2 := 2 \cdot \left(x \cdot \left(y + z\right)\right)\\
\mathbf{if}\;x \leq -4.6 \cdot 10^{+141}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;x \leq -6.2 \cdot 10^{+123}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \leq -7.8 \cdot 10^{+33}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;x \leq 1.85 \cdot 10^{-16}:\\
\;\;\;\;y \cdot 5 + x \cdot t\\
\mathbf{elif}\;x \leq 1.6 \cdot 10^{+122}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \leq 2.2 \cdot 10^{+142}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;x \leq 4.8 \cdot 10^{+278}:\\
\;\;\;\;x \cdot \left(t + y \cdot 2\right)\\
\mathbf{elif}\;x \leq 2.6 \cdot 10^{+305}:\\
\;\;\;\;t\_2\\
\mathbf{else}:\\
\;\;\;\;x \cdot t\\
\end{array}
\end{array}
if x < -4.6000000000000003e141 or -6.20000000000000013e123 < x < -7.8000000000000004e33 or 1.60000000000000006e122 < x < 2.19999999999999987e142 or 4.7999999999999997e278 < x < 2.59999999999999984e305Initial program 100.0%
Taylor expanded in y around 0 100.0%
Taylor expanded in t around 0 87.4%
*-commutative87.4%
distribute-lft-out87.4%
Simplified87.4%
Taylor expanded in x around inf 87.4%
+-commutative87.4%
Simplified87.4%
if -4.6000000000000003e141 < x < -6.20000000000000013e123 or 1.85e-16 < x < 1.60000000000000006e122Initial program 100.0%
Taylor expanded in y around 0 85.6%
if -7.8000000000000004e33 < x < 1.85e-16Initial program 99.9%
associate-+l+99.9%
+-commutative99.9%
flip-+0.0%
pow20.0%
pow20.0%
Applied egg-rr0.0%
Simplified85.9%
Taylor expanded in x around 0 85.9%
if 2.19999999999999987e142 < x < 4.7999999999999997e278Initial program 100.0%
Taylor expanded in y around 0 100.0%
Taylor expanded in x around inf 100.0%
+-commutative100.0%
distribute-lft-out100.0%
Simplified100.0%
Taylor expanded in z around 0 88.5%
if 2.59999999999999984e305 < x Initial program 100.0%
Taylor expanded in t around inf 100.0%
Simplified100.0%
Final simplification86.5%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* x (+ t (* y 2.0))))
(t_2 (* 2.0 (* x (+ y z))))
(t_3 (* 2.0 (* x z))))
(if (<= x -6800000000000.0)
t_2
(if (<= x -6.3e-89)
t_1
(if (<= x -2.1e-246)
(* y 5.0)
(if (<= x -2e-246)
t_3
(if (<= x 3.5e-242)
(* y 5.0)
(if (<= x 3.55e-242)
t_3
(if (<= x 8.5e-16)
(* y 5.0)
(if (<= x 3200000000.0) t_2 t_1))))))))))
double code(double x, double y, double z, double t) {
double t_1 = x * (t + (y * 2.0));
double t_2 = 2.0 * (x * (y + z));
double t_3 = 2.0 * (x * z);
double tmp;
if (x <= -6800000000000.0) {
tmp = t_2;
} else if (x <= -6.3e-89) {
tmp = t_1;
} else if (x <= -2.1e-246) {
tmp = y * 5.0;
} else if (x <= -2e-246) {
tmp = t_3;
} else if (x <= 3.5e-242) {
tmp = y * 5.0;
} else if (x <= 3.55e-242) {
tmp = t_3;
} else if (x <= 8.5e-16) {
tmp = y * 5.0;
} else if (x <= 3200000000.0) {
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) :: t_3
real(8) :: tmp
t_1 = x * (t + (y * 2.0d0))
t_2 = 2.0d0 * (x * (y + z))
t_3 = 2.0d0 * (x * z)
if (x <= (-6800000000000.0d0)) then
tmp = t_2
else if (x <= (-6.3d-89)) then
tmp = t_1
else if (x <= (-2.1d-246)) then
tmp = y * 5.0d0
else if (x <= (-2d-246)) then
tmp = t_3
else if (x <= 3.5d-242) then
tmp = y * 5.0d0
else if (x <= 3.55d-242) then
tmp = t_3
else if (x <= 8.5d-16) then
tmp = y * 5.0d0
else if (x <= 3200000000.0d0) 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 = x * (t + (y * 2.0));
double t_2 = 2.0 * (x * (y + z));
double t_3 = 2.0 * (x * z);
double tmp;
if (x <= -6800000000000.0) {
tmp = t_2;
} else if (x <= -6.3e-89) {
tmp = t_1;
} else if (x <= -2.1e-246) {
tmp = y * 5.0;
} else if (x <= -2e-246) {
tmp = t_3;
} else if (x <= 3.5e-242) {
tmp = y * 5.0;
} else if (x <= 3.55e-242) {
tmp = t_3;
} else if (x <= 8.5e-16) {
tmp = y * 5.0;
} else if (x <= 3200000000.0) {
tmp = t_2;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = x * (t + (y * 2.0)) t_2 = 2.0 * (x * (y + z)) t_3 = 2.0 * (x * z) tmp = 0 if x <= -6800000000000.0: tmp = t_2 elif x <= -6.3e-89: tmp = t_1 elif x <= -2.1e-246: tmp = y * 5.0 elif x <= -2e-246: tmp = t_3 elif x <= 3.5e-242: tmp = y * 5.0 elif x <= 3.55e-242: tmp = t_3 elif x <= 8.5e-16: tmp = y * 5.0 elif x <= 3200000000.0: tmp = t_2 else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(x * Float64(t + Float64(y * 2.0))) t_2 = Float64(2.0 * Float64(x * Float64(y + z))) t_3 = Float64(2.0 * Float64(x * z)) tmp = 0.0 if (x <= -6800000000000.0) tmp = t_2; elseif (x <= -6.3e-89) tmp = t_1; elseif (x <= -2.1e-246) tmp = Float64(y * 5.0); elseif (x <= -2e-246) tmp = t_3; elseif (x <= 3.5e-242) tmp = Float64(y * 5.0); elseif (x <= 3.55e-242) tmp = t_3; elseif (x <= 8.5e-16) tmp = Float64(y * 5.0); elseif (x <= 3200000000.0) tmp = t_2; else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = x * (t + (y * 2.0)); t_2 = 2.0 * (x * (y + z)); t_3 = 2.0 * (x * z); tmp = 0.0; if (x <= -6800000000000.0) tmp = t_2; elseif (x <= -6.3e-89) tmp = t_1; elseif (x <= -2.1e-246) tmp = y * 5.0; elseif (x <= -2e-246) tmp = t_3; elseif (x <= 3.5e-242) tmp = y * 5.0; elseif (x <= 3.55e-242) tmp = t_3; elseif (x <= 8.5e-16) tmp = y * 5.0; elseif (x <= 3200000000.0) tmp = t_2; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(x * N[(t + N[(y * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(2.0 * N[(x * N[(y + z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(2.0 * N[(x * z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -6800000000000.0], t$95$2, If[LessEqual[x, -6.3e-89], t$95$1, If[LessEqual[x, -2.1e-246], N[(y * 5.0), $MachinePrecision], If[LessEqual[x, -2e-246], t$95$3, If[LessEqual[x, 3.5e-242], N[(y * 5.0), $MachinePrecision], If[LessEqual[x, 3.55e-242], t$95$3, If[LessEqual[x, 8.5e-16], N[(y * 5.0), $MachinePrecision], If[LessEqual[x, 3200000000.0], t$95$2, t$95$1]]]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot \left(t + y \cdot 2\right)\\
t_2 := 2 \cdot \left(x \cdot \left(y + z\right)\right)\\
t_3 := 2 \cdot \left(x \cdot z\right)\\
\mathbf{if}\;x \leq -6800000000000:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;x \leq -6.3 \cdot 10^{-89}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \leq -2.1 \cdot 10^{-246}:\\
\;\;\;\;y \cdot 5\\
\mathbf{elif}\;x \leq -2 \cdot 10^{-246}:\\
\;\;\;\;t\_3\\
\mathbf{elif}\;x \leq 3.5 \cdot 10^{-242}:\\
\;\;\;\;y \cdot 5\\
\mathbf{elif}\;x \leq 3.55 \cdot 10^{-242}:\\
\;\;\;\;t\_3\\
\mathbf{elif}\;x \leq 8.5 \cdot 10^{-16}:\\
\;\;\;\;y \cdot 5\\
\mathbf{elif}\;x \leq 3200000000:\\
\;\;\;\;t\_2\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if x < -6.8e12 or 8.5000000000000001e-16 < x < 3.2e9Initial program 100.0%
Taylor expanded in y around 0 100.0%
Taylor expanded in t around 0 81.9%
*-commutative81.9%
distribute-lft-out81.9%
Simplified81.9%
Taylor expanded in x around inf 81.9%
+-commutative81.9%
Simplified81.9%
if -6.8e12 < x < -6.2999999999999996e-89 or 3.2e9 < x Initial program 100.0%
Taylor expanded in y around 0 100.0%
Taylor expanded in x around inf 91.4%
+-commutative91.4%
distribute-lft-out91.4%
Simplified91.4%
Taylor expanded in z around 0 64.5%
if -6.2999999999999996e-89 < x < -2.09999999999999995e-246 or -1.99999999999999991e-246 < x < 3.4999999999999999e-242 or 3.54999999999999981e-242 < x < 8.5000000000000001e-16Initial program 100.0%
Taylor expanded in x around 0 77.9%
if -2.09999999999999995e-246 < x < -1.99999999999999991e-246 or 3.4999999999999999e-242 < x < 3.54999999999999981e-242Initial program 100.0%
Taylor expanded in z around inf 100.0%
Final simplification75.1%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* y (+ 5.0 (* x 2.0)))))
(if (<= y -1.8e+60)
t_1
(if (<= y -3.4e+15)
(* x (+ t (* y 2.0)))
(if (<= y -1.24e-26)
t_1
(if (<= y 4.85e+58)
(* x (+ t (* z 2.0)))
(if (or (<= y 1.95e+69) (not (<= y 2e+69))) t_1 (* x t))))))))
double code(double x, double y, double z, double t) {
double t_1 = y * (5.0 + (x * 2.0));
double tmp;
if (y <= -1.8e+60) {
tmp = t_1;
} else if (y <= -3.4e+15) {
tmp = x * (t + (y * 2.0));
} else if (y <= -1.24e-26) {
tmp = t_1;
} else if (y <= 4.85e+58) {
tmp = x * (t + (z * 2.0));
} else if ((y <= 1.95e+69) || !(y <= 2e+69)) {
tmp = t_1;
} 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) :: t_1
real(8) :: tmp
t_1 = y * (5.0d0 + (x * 2.0d0))
if (y <= (-1.8d+60)) then
tmp = t_1
else if (y <= (-3.4d+15)) then
tmp = x * (t + (y * 2.0d0))
else if (y <= (-1.24d-26)) then
tmp = t_1
else if (y <= 4.85d+58) then
tmp = x * (t + (z * 2.0d0))
else if ((y <= 1.95d+69) .or. (.not. (y <= 2d+69))) then
tmp = t_1
else
tmp = x * t
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 <= -1.8e+60) {
tmp = t_1;
} else if (y <= -3.4e+15) {
tmp = x * (t + (y * 2.0));
} else if (y <= -1.24e-26) {
tmp = t_1;
} else if (y <= 4.85e+58) {
tmp = x * (t + (z * 2.0));
} else if ((y <= 1.95e+69) || !(y <= 2e+69)) {
tmp = t_1;
} else {
tmp = x * t;
}
return tmp;
}
def code(x, y, z, t): t_1 = y * (5.0 + (x * 2.0)) tmp = 0 if y <= -1.8e+60: tmp = t_1 elif y <= -3.4e+15: tmp = x * (t + (y * 2.0)) elif y <= -1.24e-26: tmp = t_1 elif y <= 4.85e+58: tmp = x * (t + (z * 2.0)) elif (y <= 1.95e+69) or not (y <= 2e+69): tmp = t_1 else: tmp = x * t return tmp
function code(x, y, z, t) t_1 = Float64(y * Float64(5.0 + Float64(x * 2.0))) tmp = 0.0 if (y <= -1.8e+60) tmp = t_1; elseif (y <= -3.4e+15) tmp = Float64(x * Float64(t + Float64(y * 2.0))); elseif (y <= -1.24e-26) tmp = t_1; elseif (y <= 4.85e+58) tmp = Float64(x * Float64(t + Float64(z * 2.0))); elseif ((y <= 1.95e+69) || !(y <= 2e+69)) tmp = t_1; else tmp = Float64(x * t); 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 <= -1.8e+60) tmp = t_1; elseif (y <= -3.4e+15) tmp = x * (t + (y * 2.0)); elseif (y <= -1.24e-26) tmp = t_1; elseif (y <= 4.85e+58) tmp = x * (t + (z * 2.0)); elseif ((y <= 1.95e+69) || ~((y <= 2e+69))) tmp = t_1; else tmp = x * t; 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, -1.8e+60], t$95$1, If[LessEqual[y, -3.4e+15], N[(x * N[(t + N[(y * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, -1.24e-26], t$95$1, If[LessEqual[y, 4.85e+58], N[(x * N[(t + N[(z * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[y, 1.95e+69], N[Not[LessEqual[y, 2e+69]], $MachinePrecision]], t$95$1, N[(x * t), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := y \cdot \left(5 + x \cdot 2\right)\\
\mathbf{if}\;y \leq -1.8 \cdot 10^{+60}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq -3.4 \cdot 10^{+15}:\\
\;\;\;\;x \cdot \left(t + y \cdot 2\right)\\
\mathbf{elif}\;y \leq -1.24 \cdot 10^{-26}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq 4.85 \cdot 10^{+58}:\\
\;\;\;\;x \cdot \left(t + z \cdot 2\right)\\
\mathbf{elif}\;y \leq 1.95 \cdot 10^{+69} \lor \neg \left(y \leq 2 \cdot 10^{+69}\right):\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;x \cdot t\\
\end{array}
\end{array}
if y < -1.79999999999999984e60 or -3.4e15 < y < -1.2399999999999999e-26 or 4.8499999999999998e58 < y < 1.94999999999999995e69 or 2.0000000000000001e69 < y Initial program 99.9%
Taylor expanded in y around inf 80.5%
Simplified80.5%
if -1.79999999999999984e60 < y < -3.4e15Initial program 100.0%
Taylor expanded in y around 0 100.0%
Taylor expanded in x around inf 91.7%
+-commutative91.7%
distribute-lft-out91.7%
Simplified91.7%
Taylor expanded in z around 0 72.4%
if -1.2399999999999999e-26 < y < 4.8499999999999998e58Initial program 100.0%
Taylor expanded in y around 0 79.7%
if 1.94999999999999995e69 < y < 2.0000000000000001e69Initial program 100.0%
Taylor expanded in t around inf 100.0%
Simplified100.0%
Final simplification79.9%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (+ (* y 5.0) (* x t))) (t_2 (* x (+ t (* 2.0 (+ y z))))))
(if (<= x -2.15e-71)
t_2
(if (<= x -1.2e-231)
t_1
(if (<= x -5.2e-288)
(+ (* y 5.0) (* x (* z 2.0)))
(if (<= x 1.08e-16) t_1 t_2))))))
double code(double x, double y, double z, double t) {
double t_1 = (y * 5.0) + (x * t);
double t_2 = x * (t + (2.0 * (y + z)));
double tmp;
if (x <= -2.15e-71) {
tmp = t_2;
} else if (x <= -1.2e-231) {
tmp = t_1;
} else if (x <= -5.2e-288) {
tmp = (y * 5.0) + (x * (z * 2.0));
} else if (x <= 1.08e-16) {
tmp = t_1;
} else {
tmp = t_2;
}
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 * t)
t_2 = x * (t + (2.0d0 * (y + z)))
if (x <= (-2.15d-71)) then
tmp = t_2
else if (x <= (-1.2d-231)) then
tmp = t_1
else if (x <= (-5.2d-288)) then
tmp = (y * 5.0d0) + (x * (z * 2.0d0))
else if (x <= 1.08d-16) then
tmp = t_1
else
tmp = t_2
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 * t);
double t_2 = x * (t + (2.0 * (y + z)));
double tmp;
if (x <= -2.15e-71) {
tmp = t_2;
} else if (x <= -1.2e-231) {
tmp = t_1;
} else if (x <= -5.2e-288) {
tmp = (y * 5.0) + (x * (z * 2.0));
} else if (x <= 1.08e-16) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t): t_1 = (y * 5.0) + (x * t) t_2 = x * (t + (2.0 * (y + z))) tmp = 0 if x <= -2.15e-71: tmp = t_2 elif x <= -1.2e-231: tmp = t_1 elif x <= -5.2e-288: tmp = (y * 5.0) + (x * (z * 2.0)) elif x <= 1.08e-16: tmp = t_1 else: tmp = t_2 return tmp
function code(x, y, z, t) t_1 = Float64(Float64(y * 5.0) + Float64(x * t)) t_2 = Float64(x * Float64(t + Float64(2.0 * Float64(y + z)))) tmp = 0.0 if (x <= -2.15e-71) tmp = t_2; elseif (x <= -1.2e-231) tmp = t_1; elseif (x <= -5.2e-288) tmp = Float64(Float64(y * 5.0) + Float64(x * Float64(z * 2.0))); elseif (x <= 1.08e-16) tmp = t_1; else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = (y * 5.0) + (x * t); t_2 = x * (t + (2.0 * (y + z))); tmp = 0.0; if (x <= -2.15e-71) tmp = t_2; elseif (x <= -1.2e-231) tmp = t_1; elseif (x <= -5.2e-288) tmp = (y * 5.0) + (x * (z * 2.0)); elseif (x <= 1.08e-16) tmp = t_1; else tmp = t_2; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(y * 5.0), $MachinePrecision] + N[(x * t), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(x * N[(t + N[(2.0 * N[(y + z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -2.15e-71], t$95$2, If[LessEqual[x, -1.2e-231], t$95$1, If[LessEqual[x, -5.2e-288], N[(N[(y * 5.0), $MachinePrecision] + N[(x * N[(z * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 1.08e-16], t$95$1, t$95$2]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := y \cdot 5 + x \cdot t\\
t_2 := x \cdot \left(t + 2 \cdot \left(y + z\right)\right)\\
\mathbf{if}\;x \leq -2.15 \cdot 10^{-71}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;x \leq -1.2 \cdot 10^{-231}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \leq -5.2 \cdot 10^{-288}:\\
\;\;\;\;y \cdot 5 + x \cdot \left(z \cdot 2\right)\\
\mathbf{elif}\;x \leq 1.08 \cdot 10^{-16}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if x < -2.1499999999999998e-71 or 1.08e-16 < x Initial program 100.0%
fma-define100.0%
associate-+l+100.0%
+-commutative100.0%
count-2100.0%
Simplified100.0%
Taylor expanded in x around inf 97.0%
if -2.1499999999999998e-71 < x < -1.19999999999999996e-231 or -5.19999999999999979e-288 < x < 1.08e-16Initial program 99.9%
associate-+l+99.9%
+-commutative99.9%
flip-+0.0%
pow20.0%
pow20.0%
Applied egg-rr0.0%
Simplified92.9%
Taylor expanded in x around 0 92.9%
if -1.19999999999999996e-231 < x < -5.19999999999999979e-288Initial program 100.0%
Taylor expanded in y around inf 82.3%
Taylor expanded in z around inf 100.0%
*-commutative100.0%
associate-*l*100.0%
Simplified100.0%
Final simplification95.6%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* 2.0 (* x z))))
(if (<= x -21000000000000.0)
t_1
(if (<= x -6.3e-89)
(* x t)
(if (<= x 2.1e-16) (* y 5.0) (if (<= x 100000000.0) t_1 (* x t)))))))
double code(double x, double y, double z, double t) {
double t_1 = 2.0 * (x * z);
double tmp;
if (x <= -21000000000000.0) {
tmp = t_1;
} else if (x <= -6.3e-89) {
tmp = x * t;
} else if (x <= 2.1e-16) {
tmp = y * 5.0;
} else if (x <= 100000000.0) {
tmp = t_1;
} 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) :: t_1
real(8) :: tmp
t_1 = 2.0d0 * (x * z)
if (x <= (-21000000000000.0d0)) then
tmp = t_1
else if (x <= (-6.3d-89)) then
tmp = x * t
else if (x <= 2.1d-16) then
tmp = y * 5.0d0
else if (x <= 100000000.0d0) then
tmp = t_1
else
tmp = x * t
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 (x <= -21000000000000.0) {
tmp = t_1;
} else if (x <= -6.3e-89) {
tmp = x * t;
} else if (x <= 2.1e-16) {
tmp = y * 5.0;
} else if (x <= 100000000.0) {
tmp = t_1;
} else {
tmp = x * t;
}
return tmp;
}
def code(x, y, z, t): t_1 = 2.0 * (x * z) tmp = 0 if x <= -21000000000000.0: tmp = t_1 elif x <= -6.3e-89: tmp = x * t elif x <= 2.1e-16: tmp = y * 5.0 elif x <= 100000000.0: tmp = t_1 else: tmp = x * t return tmp
function code(x, y, z, t) t_1 = Float64(2.0 * Float64(x * z)) tmp = 0.0 if (x <= -21000000000000.0) tmp = t_1; elseif (x <= -6.3e-89) tmp = Float64(x * t); elseif (x <= 2.1e-16) tmp = Float64(y * 5.0); elseif (x <= 100000000.0) tmp = t_1; else tmp = Float64(x * t); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = 2.0 * (x * z); tmp = 0.0; if (x <= -21000000000000.0) tmp = t_1; elseif (x <= -6.3e-89) tmp = x * t; elseif (x <= 2.1e-16) tmp = y * 5.0; elseif (x <= 100000000.0) tmp = t_1; else tmp = x * t; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(2.0 * N[(x * z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -21000000000000.0], t$95$1, If[LessEqual[x, -6.3e-89], N[(x * t), $MachinePrecision], If[LessEqual[x, 2.1e-16], N[(y * 5.0), $MachinePrecision], If[LessEqual[x, 100000000.0], t$95$1, N[(x * t), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := 2 \cdot \left(x \cdot z\right)\\
\mathbf{if}\;x \leq -21000000000000:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \leq -6.3 \cdot 10^{-89}:\\
\;\;\;\;x \cdot t\\
\mathbf{elif}\;x \leq 2.1 \cdot 10^{-16}:\\
\;\;\;\;y \cdot 5\\
\mathbf{elif}\;x \leq 100000000:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;x \cdot t\\
\end{array}
\end{array}
if x < -2.1e13 or 2.1000000000000001e-16 < x < 1e8Initial program 100.0%
Taylor expanded in z around inf 47.0%
if -2.1e13 < x < -6.2999999999999996e-89 or 1e8 < x Initial program 100.0%
Taylor expanded in t around inf 42.4%
Simplified42.4%
if -6.2999999999999996e-89 < x < 2.1000000000000001e-16Initial program 100.0%
Taylor expanded in x around 0 76.5%
Final simplification57.0%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* 2.0 (+ y z))))
(if (<= x -7.8e+33)
(* x (+ t t_1))
(if (<= x 3.2e-100)
(+ (* y 5.0) (* x (+ t (* z 2.0))))
(* x (+ t (+ t_1 (* 5.0 (/ y x)))))))))
double code(double x, double y, double z, double t) {
double t_1 = 2.0 * (y + z);
double tmp;
if (x <= -7.8e+33) {
tmp = x * (t + t_1);
} else if (x <= 3.2e-100) {
tmp = (y * 5.0) + (x * (t + (z * 2.0)));
} else {
tmp = x * (t + (t_1 + (5.0 * (y / x))));
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: tmp
t_1 = 2.0d0 * (y + z)
if (x <= (-7.8d+33)) then
tmp = x * (t + t_1)
else if (x <= 3.2d-100) then
tmp = (y * 5.0d0) + (x * (t + (z * 2.0d0)))
else
tmp = x * (t + (t_1 + (5.0d0 * (y / x))))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = 2.0 * (y + z);
double tmp;
if (x <= -7.8e+33) {
tmp = x * (t + t_1);
} else if (x <= 3.2e-100) {
tmp = (y * 5.0) + (x * (t + (z * 2.0)));
} else {
tmp = x * (t + (t_1 + (5.0 * (y / x))));
}
return tmp;
}
def code(x, y, z, t): t_1 = 2.0 * (y + z) tmp = 0 if x <= -7.8e+33: tmp = x * (t + t_1) elif x <= 3.2e-100: tmp = (y * 5.0) + (x * (t + (z * 2.0))) else: tmp = x * (t + (t_1 + (5.0 * (y / x)))) return tmp
function code(x, y, z, t) t_1 = Float64(2.0 * Float64(y + z)) tmp = 0.0 if (x <= -7.8e+33) tmp = Float64(x * Float64(t + t_1)); elseif (x <= 3.2e-100) tmp = Float64(Float64(y * 5.0) + Float64(x * Float64(t + Float64(z * 2.0)))); else tmp = Float64(x * Float64(t + Float64(t_1 + Float64(5.0 * Float64(y / x))))); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = 2.0 * (y + z); tmp = 0.0; if (x <= -7.8e+33) tmp = x * (t + t_1); elseif (x <= 3.2e-100) tmp = (y * 5.0) + (x * (t + (z * 2.0))); else tmp = x * (t + (t_1 + (5.0 * (y / x)))); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(2.0 * N[(y + z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -7.8e+33], N[(x * N[(t + t$95$1), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 3.2e-100], N[(N[(y * 5.0), $MachinePrecision] + N[(x * N[(t + N[(z * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x * N[(t + N[(t$95$1 + N[(5.0 * N[(y / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := 2 \cdot \left(y + z\right)\\
\mathbf{if}\;x \leq -7.8 \cdot 10^{+33}:\\
\;\;\;\;x \cdot \left(t + t\_1\right)\\
\mathbf{elif}\;x \leq 3.2 \cdot 10^{-100}:\\
\;\;\;\;y \cdot 5 + x \cdot \left(t + z \cdot 2\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(t + \left(t\_1 + 5 \cdot \frac{y}{x}\right)\right)\\
\end{array}
\end{array}
if x < -7.8000000000000004e33Initial program 100.0%
fma-define100.0%
associate-+l+100.0%
+-commutative100.0%
count-2100.0%
Simplified100.0%
Taylor expanded in x around inf 100.0%
if -7.8000000000000004e33 < x < 3.20000000000000017e-100Initial program 99.9%
Taylor expanded in y around 0 98.7%
if 3.20000000000000017e-100 < x Initial program 100.0%
fma-define100.0%
associate-+l+100.0%
+-commutative100.0%
count-2100.0%
Simplified100.0%
Taylor expanded in x around inf 99.9%
Final simplification99.4%
(FPCore (x y z t) :precision binary64 (if (or (<= x -7.8e+33) (not (<= x 4.1e-51))) (* x (+ t (* 2.0 (+ y z)))) (+ (* y 5.0) (* x (+ t (* z 2.0))))))
double code(double x, double y, double z, double t) {
double tmp;
if ((x <= -7.8e+33) || !(x <= 4.1e-51)) {
tmp = x * (t + (2.0 * (y + z)));
} else {
tmp = (y * 5.0) + (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 ((x <= (-7.8d+33)) .or. (.not. (x <= 4.1d-51))) then
tmp = x * (t + (2.0d0 * (y + z)))
else
tmp = (y * 5.0d0) + (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 ((x <= -7.8e+33) || !(x <= 4.1e-51)) {
tmp = x * (t + (2.0 * (y + z)));
} else {
tmp = (y * 5.0) + (x * (t + (z * 2.0)));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (x <= -7.8e+33) or not (x <= 4.1e-51): tmp = x * (t + (2.0 * (y + z))) else: tmp = (y * 5.0) + (x * (t + (z * 2.0))) return tmp
function code(x, y, z, t) tmp = 0.0 if ((x <= -7.8e+33) || !(x <= 4.1e-51)) tmp = Float64(x * Float64(t + Float64(2.0 * Float64(y + z)))); else tmp = Float64(Float64(y * 5.0) + Float64(x * Float64(t + Float64(z * 2.0)))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((x <= -7.8e+33) || ~((x <= 4.1e-51))) tmp = x * (t + (2.0 * (y + z))); else tmp = (y * 5.0) + (x * (t + (z * 2.0))); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[x, -7.8e+33], N[Not[LessEqual[x, 4.1e-51]], $MachinePrecision]], N[(x * N[(t + N[(2.0 * N[(y + z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(y * 5.0), $MachinePrecision] + N[(x * N[(t + N[(z * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -7.8 \cdot 10^{+33} \lor \neg \left(x \leq 4.1 \cdot 10^{-51}\right):\\
\;\;\;\;x \cdot \left(t + 2 \cdot \left(y + z\right)\right)\\
\mathbf{else}:\\
\;\;\;\;y \cdot 5 + x \cdot \left(t + z \cdot 2\right)\\
\end{array}
\end{array}
if x < -7.8000000000000004e33 or 4.09999999999999973e-51 < x Initial program 100.0%
fma-define100.0%
associate-+l+100.0%
+-commutative100.0%
count-2100.0%
Simplified100.0%
Taylor expanded in x around inf 97.3%
if -7.8000000000000004e33 < x < 4.09999999999999973e-51Initial program 99.9%
Taylor expanded in y around 0 98.7%
Final simplification98.0%
(FPCore (x y z t) :precision binary64 (if (or (<= x -5.6e-72) (not (<= x 1.75e-51))) (* x (+ t (* 2.0 (+ y z)))) (+ (* y 5.0) (* x t))))
double code(double x, double y, double z, double t) {
double tmp;
if ((x <= -5.6e-72) || !(x <= 1.75e-51)) {
tmp = x * (t + (2.0 * (y + z)));
} 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 <= (-5.6d-72)) .or. (.not. (x <= 1.75d-51))) then
tmp = x * (t + (2.0d0 * (y + z)))
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 <= -5.6e-72) || !(x <= 1.75e-51)) {
tmp = x * (t + (2.0 * (y + z)));
} else {
tmp = (y * 5.0) + (x * t);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (x <= -5.6e-72) or not (x <= 1.75e-51): tmp = x * (t + (2.0 * (y + z))) else: tmp = (y * 5.0) + (x * t) return tmp
function code(x, y, z, t) tmp = 0.0 if ((x <= -5.6e-72) || !(x <= 1.75e-51)) tmp = Float64(x * Float64(t + Float64(2.0 * Float64(y + z)))); 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 <= -5.6e-72) || ~((x <= 1.75e-51))) tmp = x * (t + (2.0 * (y + z))); else tmp = (y * 5.0) + (x * t); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[x, -5.6e-72], N[Not[LessEqual[x, 1.75e-51]], $MachinePrecision]], N[(x * N[(t + N[(2.0 * N[(y + z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(y * 5.0), $MachinePrecision] + N[(x * t), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -5.6 \cdot 10^{-72} \lor \neg \left(x \leq 1.75 \cdot 10^{-51}\right):\\
\;\;\;\;x \cdot \left(t + 2 \cdot \left(y + z\right)\right)\\
\mathbf{else}:\\
\;\;\;\;y \cdot 5 + x \cdot t\\
\end{array}
\end{array}
if x < -5.5999999999999996e-72 or 1.7499999999999999e-51 < x Initial program 100.0%
fma-define100.0%
associate-+l+100.0%
+-commutative100.0%
count-2100.0%
Simplified100.0%
Taylor expanded in x around inf 94.7%
if -5.5999999999999996e-72 < x < 1.7499999999999999e-51Initial program 100.0%
associate-+l+100.0%
+-commutative100.0%
flip-+0.0%
pow20.0%
pow20.0%
Applied egg-rr0.0%
Simplified90.5%
Taylor expanded in x around 0 90.5%
Final simplification93.0%
(FPCore (x y z t) :precision binary64 (+ (* x (+ t (+ y (+ y (* z 2.0))))) (* y 5.0)))
double code(double x, double y, double z, double t) {
return (x * (t + (y + (y + (z * 2.0))))) + (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 + (y + (z * 2.0d0))))) + (y * 5.0d0)
end function
public static double code(double x, double y, double z, double t) {
return (x * (t + (y + (y + (z * 2.0))))) + (y * 5.0);
}
def code(x, y, z, t): return (x * (t + (y + (y + (z * 2.0))))) + (y * 5.0)
function code(x, y, z, t) return Float64(Float64(x * Float64(t + Float64(y + Float64(y + Float64(z * 2.0))))) + Float64(y * 5.0)) end
function tmp = code(x, y, z, t) tmp = (x * (t + (y + (y + (z * 2.0))))) + (y * 5.0); end
code[x_, y_, z_, t_] := N[(N[(x * N[(t + N[(y + N[(y + N[(z * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(y * 5.0), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x \cdot \left(t + \left(y + \left(y + z \cdot 2\right)\right)\right) + y \cdot 5
\end{array}
Initial program 100.0%
Taylor expanded in y around 0 100.0%
Final simplification100.0%
(FPCore (x y z t) :precision binary64 (if (or (<= x -1e-17) (not (<= x 3.2e-100))) (* x t) (* y 5.0)))
double code(double x, double y, double z, double t) {
double tmp;
if ((x <= -1e-17) || !(x <= 3.2e-100)) {
tmp = x * t;
} 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 <= (-1d-17)) .or. (.not. (x <= 3.2d-100))) then
tmp = x * t
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 <= -1e-17) || !(x <= 3.2e-100)) {
tmp = x * t;
} else {
tmp = y * 5.0;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (x <= -1e-17) or not (x <= 3.2e-100): tmp = x * t else: tmp = y * 5.0 return tmp
function code(x, y, z, t) tmp = 0.0 if ((x <= -1e-17) || !(x <= 3.2e-100)) tmp = Float64(x * t); else tmp = Float64(y * 5.0); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((x <= -1e-17) || ~((x <= 3.2e-100))) tmp = x * t; else tmp = y * 5.0; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[x, -1e-17], N[Not[LessEqual[x, 3.2e-100]], $MachinePrecision]], N[(x * t), $MachinePrecision], N[(y * 5.0), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1 \cdot 10^{-17} \lor \neg \left(x \leq 3.2 \cdot 10^{-100}\right):\\
\;\;\;\;x \cdot t\\
\mathbf{else}:\\
\;\;\;\;y \cdot 5\\
\end{array}
\end{array}
if x < -1.00000000000000007e-17 or 3.20000000000000017e-100 < x Initial program 100.0%
Taylor expanded in t around inf 33.9%
Simplified33.9%
if -1.00000000000000007e-17 < x < 3.20000000000000017e-100Initial program 99.9%
Taylor expanded in x around 0 70.6%
Final simplification49.1%
(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 100.0%
Taylor expanded in x around 0 33.5%
Final simplification33.5%
herbie shell --seed 2024107
(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)))