
(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 17 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-in95.6%
associate-+l+95.6%
+-commutative95.6%
count-295.6%
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 (* y (+ 5.0 x))) (t_2 (* 2.0 (* x z))))
(if (<= y -1.72e-43)
t_1
(if (<= y -1.7e-131)
t_2
(if (<= y -1.4e-260)
(* x t)
(if (<= y 3.25e-205)
t_2
(if (<= y 9.2e-154)
(* x t)
(if (<= y 7e-51)
t_2
(if (<= y 210000000000.0) (* x t) t_1)))))))))
double code(double x, double y, double z, double t) {
double t_1 = y * (5.0 + x);
double t_2 = 2.0 * (x * z);
double tmp;
if (y <= -1.72e-43) {
tmp = t_1;
} else if (y <= -1.7e-131) {
tmp = t_2;
} else if (y <= -1.4e-260) {
tmp = x * t;
} else if (y <= 3.25e-205) {
tmp = t_2;
} else if (y <= 9.2e-154) {
tmp = x * t;
} else if (y <= 7e-51) {
tmp = t_2;
} else if (y <= 210000000000.0) {
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) :: t_2
real(8) :: tmp
t_1 = y * (5.0d0 + x)
t_2 = 2.0d0 * (x * z)
if (y <= (-1.72d-43)) then
tmp = t_1
else if (y <= (-1.7d-131)) then
tmp = t_2
else if (y <= (-1.4d-260)) then
tmp = x * t
else if (y <= 3.25d-205) then
tmp = t_2
else if (y <= 9.2d-154) then
tmp = x * t
else if (y <= 7d-51) then
tmp = t_2
else if (y <= 210000000000.0d0) 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 = y * (5.0 + x);
double t_2 = 2.0 * (x * z);
double tmp;
if (y <= -1.72e-43) {
tmp = t_1;
} else if (y <= -1.7e-131) {
tmp = t_2;
} else if (y <= -1.4e-260) {
tmp = x * t;
} else if (y <= 3.25e-205) {
tmp = t_2;
} else if (y <= 9.2e-154) {
tmp = x * t;
} else if (y <= 7e-51) {
tmp = t_2;
} else if (y <= 210000000000.0) {
tmp = x * t;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = y * (5.0 + x) t_2 = 2.0 * (x * z) tmp = 0 if y <= -1.72e-43: tmp = t_1 elif y <= -1.7e-131: tmp = t_2 elif y <= -1.4e-260: tmp = x * t elif y <= 3.25e-205: tmp = t_2 elif y <= 9.2e-154: tmp = x * t elif y <= 7e-51: tmp = t_2 elif y <= 210000000000.0: tmp = x * t else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(y * Float64(5.0 + x)) t_2 = Float64(2.0 * Float64(x * z)) tmp = 0.0 if (y <= -1.72e-43) tmp = t_1; elseif (y <= -1.7e-131) tmp = t_2; elseif (y <= -1.4e-260) tmp = Float64(x * t); elseif (y <= 3.25e-205) tmp = t_2; elseif (y <= 9.2e-154) tmp = Float64(x * t); elseif (y <= 7e-51) tmp = t_2; elseif (y <= 210000000000.0) tmp = Float64(x * t); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = y * (5.0 + x); t_2 = 2.0 * (x * z); tmp = 0.0; if (y <= -1.72e-43) tmp = t_1; elseif (y <= -1.7e-131) tmp = t_2; elseif (y <= -1.4e-260) tmp = x * t; elseif (y <= 3.25e-205) tmp = t_2; elseif (y <= 9.2e-154) tmp = x * t; elseif (y <= 7e-51) tmp = t_2; elseif (y <= 210000000000.0) tmp = x * t; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(y * N[(5.0 + x), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(2.0 * N[(x * z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -1.72e-43], t$95$1, If[LessEqual[y, -1.7e-131], t$95$2, If[LessEqual[y, -1.4e-260], N[(x * t), $MachinePrecision], If[LessEqual[y, 3.25e-205], t$95$2, If[LessEqual[y, 9.2e-154], N[(x * t), $MachinePrecision], If[LessEqual[y, 7e-51], t$95$2, If[LessEqual[y, 210000000000.0], N[(x * t), $MachinePrecision], t$95$1]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := y \cdot \left(5 + x\right)\\
t_2 := 2 \cdot \left(x \cdot z\right)\\
\mathbf{if}\;y \leq -1.72 \cdot 10^{-43}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;y \leq -1.7 \cdot 10^{-131}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;y \leq -1.4 \cdot 10^{-260}:\\
\;\;\;\;x \cdot t\\
\mathbf{elif}\;y \leq 3.25 \cdot 10^{-205}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;y \leq 9.2 \cdot 10^{-154}:\\
\;\;\;\;x \cdot t\\
\mathbf{elif}\;y \leq 7 \cdot 10^{-51}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;y \leq 210000000000:\\
\;\;\;\;x \cdot t\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if y < -1.72000000000000005e-43 or 2.1e11 < y Initial program 99.8%
Taylor expanded in y around 0 83.8%
Simplified83.8%
Taylor expanded in y around inf 66.3%
+-commutative66.3%
Simplified66.3%
if -1.72000000000000005e-43 < y < -1.69999999999999998e-131 or -1.3999999999999999e-260 < y < 3.24999999999999978e-205 or 9.1999999999999999e-154 < y < 6.9999999999999995e-51Initial program 100.0%
Taylor expanded in z around inf 65.9%
if -1.69999999999999998e-131 < y < -1.3999999999999999e-260 or 3.24999999999999978e-205 < y < 9.1999999999999999e-154 or 6.9999999999999995e-51 < y < 2.1e11Initial program 100.0%
Taylor expanded in t around inf 59.5%
Final simplification64.7%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* x (+ y t))) (t_2 (* y (+ 5.0 x))) (t_3 (* 2.0 (* x z))))
(if (<= y -5.5e-42)
t_2
(if (<= y -1.82e-131)
t_3
(if (<= y -1.05e-260)
t_1
(if (<= y 1.45e-206)
t_3
(if (<= y 5.5e-154)
(* x t)
(if (<= y 2.6e-52) t_3 (if (<= y 5.3e+76) t_1 t_2)))))))))
double code(double x, double y, double z, double t) {
double t_1 = x * (y + t);
double t_2 = y * (5.0 + x);
double t_3 = 2.0 * (x * z);
double tmp;
if (y <= -5.5e-42) {
tmp = t_2;
} else if (y <= -1.82e-131) {
tmp = t_3;
} else if (y <= -1.05e-260) {
tmp = t_1;
} else if (y <= 1.45e-206) {
tmp = t_3;
} else if (y <= 5.5e-154) {
tmp = x * t;
} else if (y <= 2.6e-52) {
tmp = t_3;
} else if (y <= 5.3e+76) {
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) :: t_3
real(8) :: tmp
t_1 = x * (y + t)
t_2 = y * (5.0d0 + x)
t_3 = 2.0d0 * (x * z)
if (y <= (-5.5d-42)) then
tmp = t_2
else if (y <= (-1.82d-131)) then
tmp = t_3
else if (y <= (-1.05d-260)) then
tmp = t_1
else if (y <= 1.45d-206) then
tmp = t_3
else if (y <= 5.5d-154) then
tmp = x * t
else if (y <= 2.6d-52) then
tmp = t_3
else if (y <= 5.3d+76) 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 = x * (y + t);
double t_2 = y * (5.0 + x);
double t_3 = 2.0 * (x * z);
double tmp;
if (y <= -5.5e-42) {
tmp = t_2;
} else if (y <= -1.82e-131) {
tmp = t_3;
} else if (y <= -1.05e-260) {
tmp = t_1;
} else if (y <= 1.45e-206) {
tmp = t_3;
} else if (y <= 5.5e-154) {
tmp = x * t;
} else if (y <= 2.6e-52) {
tmp = t_3;
} else if (y <= 5.3e+76) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t): t_1 = x * (y + t) t_2 = y * (5.0 + x) t_3 = 2.0 * (x * z) tmp = 0 if y <= -5.5e-42: tmp = t_2 elif y <= -1.82e-131: tmp = t_3 elif y <= -1.05e-260: tmp = t_1 elif y <= 1.45e-206: tmp = t_3 elif y <= 5.5e-154: tmp = x * t elif y <= 2.6e-52: tmp = t_3 elif y <= 5.3e+76: tmp = t_1 else: tmp = t_2 return tmp
function code(x, y, z, t) t_1 = Float64(x * Float64(y + t)) t_2 = Float64(y * Float64(5.0 + x)) t_3 = Float64(2.0 * Float64(x * z)) tmp = 0.0 if (y <= -5.5e-42) tmp = t_2; elseif (y <= -1.82e-131) tmp = t_3; elseif (y <= -1.05e-260) tmp = t_1; elseif (y <= 1.45e-206) tmp = t_3; elseif (y <= 5.5e-154) tmp = Float64(x * t); elseif (y <= 2.6e-52) tmp = t_3; elseif (y <= 5.3e+76) tmp = t_1; else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = x * (y + t); t_2 = y * (5.0 + x); t_3 = 2.0 * (x * z); tmp = 0.0; if (y <= -5.5e-42) tmp = t_2; elseif (y <= -1.82e-131) tmp = t_3; elseif (y <= -1.05e-260) tmp = t_1; elseif (y <= 1.45e-206) tmp = t_3; elseif (y <= 5.5e-154) tmp = x * t; elseif (y <= 2.6e-52) tmp = t_3; elseif (y <= 5.3e+76) tmp = t_1; else tmp = t_2; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(x * N[(y + t), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(y * N[(5.0 + x), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(2.0 * N[(x * z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -5.5e-42], t$95$2, If[LessEqual[y, -1.82e-131], t$95$3, If[LessEqual[y, -1.05e-260], t$95$1, If[LessEqual[y, 1.45e-206], t$95$3, If[LessEqual[y, 5.5e-154], N[(x * t), $MachinePrecision], If[LessEqual[y, 2.6e-52], t$95$3, If[LessEqual[y, 5.3e+76], t$95$1, t$95$2]]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot \left(y + t\right)\\
t_2 := y \cdot \left(5 + x\right)\\
t_3 := 2 \cdot \left(x \cdot z\right)\\
\mathbf{if}\;y \leq -5.5 \cdot 10^{-42}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;y \leq -1.82 \cdot 10^{-131}:\\
\;\;\;\;t_3\\
\mathbf{elif}\;y \leq -1.05 \cdot 10^{-260}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;y \leq 1.45 \cdot 10^{-206}:\\
\;\;\;\;t_3\\
\mathbf{elif}\;y \leq 5.5 \cdot 10^{-154}:\\
\;\;\;\;x \cdot t\\
\mathbf{elif}\;y \leq 2.6 \cdot 10^{-52}:\\
\;\;\;\;t_3\\
\mathbf{elif}\;y \leq 5.3 \cdot 10^{+76}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;t_2\\
\end{array}
\end{array}
if y < -5.5e-42 or 5.30000000000000015e76 < y Initial program 99.9%
Taylor expanded in y around 0 83.4%
Simplified83.4%
Taylor expanded in y around inf 68.9%
+-commutative68.9%
Simplified68.9%
if -5.5e-42 < y < -1.8200000000000001e-131 or -1.05000000000000002e-260 < y < 1.4500000000000001e-206 or 5.50000000000000002e-154 < y < 2.5999999999999999e-52Initial program 100.0%
Taylor expanded in z around inf 65.9%
if -1.8200000000000001e-131 < y < -1.05000000000000002e-260 or 2.5999999999999999e-52 < y < 5.30000000000000015e76Initial program 99.8%
Taylor expanded in y around 0 88.7%
Simplified88.7%
Taylor expanded in z around 0 73.7%
fma-def73.7%
+-commutative73.7%
*-commutative73.7%
Simplified73.7%
Taylor expanded in x around inf 54.8%
if 1.4500000000000001e-206 < y < 5.50000000000000002e-154Initial program 99.9%
Taylor expanded in t around inf 78.5%
Final simplification65.5%
(FPCore (x y z t) :precision binary64 (if (or (<= x -66000.0) (not (<= x 5.0))) (* x (+ t (* (+ y z) 2.0))) (+ (* x (+ t (+ y (+ z z)))) (* y 5.0))))
double code(double x, double y, double z, double t) {
double tmp;
if ((x <= -66000.0) || !(x <= 5.0)) {
tmp = x * (t + ((y + z) * 2.0));
} else {
tmp = (x * (t + (y + (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 <= (-66000.0d0)) .or. (.not. (x <= 5.0d0))) then
tmp = x * (t + ((y + z) * 2.0d0))
else
tmp = (x * (t + (y + (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 <= -66000.0) || !(x <= 5.0)) {
tmp = x * (t + ((y + z) * 2.0));
} else {
tmp = (x * (t + (y + (z + z)))) + (y * 5.0);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (x <= -66000.0) or not (x <= 5.0): tmp = x * (t + ((y + z) * 2.0)) else: tmp = (x * (t + (y + (z + z)))) + (y * 5.0) return tmp
function code(x, y, z, t) tmp = 0.0 if ((x <= -66000.0) || !(x <= 5.0)) tmp = Float64(x * Float64(t + Float64(Float64(y + z) * 2.0))); else tmp = Float64(Float64(x * Float64(t + Float64(y + Float64(z + z)))) + Float64(y * 5.0)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((x <= -66000.0) || ~((x <= 5.0))) tmp = x * (t + ((y + z) * 2.0)); else tmp = (x * (t + (y + (z + z)))) + (y * 5.0); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[x, -66000.0], N[Not[LessEqual[x, 5.0]], $MachinePrecision]], N[(x * N[(t + N[(N[(y + z), $MachinePrecision] * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x * N[(t + N[(y + N[(z + z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(y * 5.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -66000 \lor \neg \left(x \leq 5\right):\\
\;\;\;\;x \cdot \left(t + \left(y + z\right) \cdot 2\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(t + \left(y + \left(z + z\right)\right)\right) + y \cdot 5\\
\end{array}
\end{array}
if x < -66000 or 5 < 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.5%
if -66000 < x < 5Initial program 99.8%
Taylor expanded in y around 0 98.1%
Simplified98.1%
Final simplification98.8%
(FPCore (x y z t)
:precision binary64
(if (or (<= y -7.2e+22)
(not (or (<= y 1.02e-14) (and (not (<= y 0.0275)) (<= y 2.9e+55)))))
(* 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 <= -7.2e+22) || !((y <= 1.02e-14) || (!(y <= 0.0275) && (y <= 2.9e+55)))) {
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 <= (-7.2d+22)) .or. (.not. (y <= 1.02d-14) .or. (.not. (y <= 0.0275d0)) .and. (y <= 2.9d+55))) 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 <= -7.2e+22) || !((y <= 1.02e-14) || (!(y <= 0.0275) && (y <= 2.9e+55)))) {
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 <= -7.2e+22) or not ((y <= 1.02e-14) or (not (y <= 0.0275) and (y <= 2.9e+55))): 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 <= -7.2e+22) || !((y <= 1.02e-14) || (!(y <= 0.0275) && (y <= 2.9e+55)))) 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 <= -7.2e+22) || ~(((y <= 1.02e-14) || (~((y <= 0.0275)) && (y <= 2.9e+55))))) 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, -7.2e+22], N[Not[Or[LessEqual[y, 1.02e-14], And[N[Not[LessEqual[y, 0.0275]], $MachinePrecision], LessEqual[y, 2.9e+55]]]], $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 -7.2 \cdot 10^{+22} \lor \neg \left(y \leq 1.02 \cdot 10^{-14} \lor \neg \left(y \leq 0.0275\right) \land y \leq 2.9 \cdot 10^{+55}\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 < -7.2e22 or 1.02e-14 < y < 0.0275000000000000001 or 2.8999999999999999e55 < y Initial program 99.9%
fma-def99.9%
associate-+l+99.9%
+-commutative99.9%
count-299.9%
Simplified99.9%
Taylor expanded in y around inf 86.8%
if -7.2e22 < y < 1.02e-14 or 0.0275000000000000001 < y < 2.8999999999999999e55Initial program 99.9%
Taylor expanded in y around 0 81.8%
Final simplification84.1%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* y (+ 5.0 (* x 2.0)))))
(if (<= y -24000000000000.0)
t_1
(if (<= y 1.02e-14)
(* x (+ t (* z 2.0)))
(if (or (<= y 0.027) (not (<= y 5.7e+48)))
t_1
(+ (* y 5.0) (* 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 <= -24000000000000.0) {
tmp = t_1;
} else if (y <= 1.02e-14) {
tmp = x * (t + (z * 2.0));
} else if ((y <= 0.027) || !(y <= 5.7e+48)) {
tmp = t_1;
} 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) :: t_1
real(8) :: tmp
t_1 = y * (5.0d0 + (x * 2.0d0))
if (y <= (-24000000000000.0d0)) then
tmp = t_1
else if (y <= 1.02d-14) then
tmp = x * (t + (z * 2.0d0))
else if ((y <= 0.027d0) .or. (.not. (y <= 5.7d+48))) then
tmp = t_1
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 t_1 = y * (5.0 + (x * 2.0));
double tmp;
if (y <= -24000000000000.0) {
tmp = t_1;
} else if (y <= 1.02e-14) {
tmp = x * (t + (z * 2.0));
} else if ((y <= 0.027) || !(y <= 5.7e+48)) {
tmp = t_1;
} else {
tmp = (y * 5.0) + (x * t);
}
return tmp;
}
def code(x, y, z, t): t_1 = y * (5.0 + (x * 2.0)) tmp = 0 if y <= -24000000000000.0: tmp = t_1 elif y <= 1.02e-14: tmp = x * (t + (z * 2.0)) elif (y <= 0.027) or not (y <= 5.7e+48): tmp = t_1 else: tmp = (y * 5.0) + (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 <= -24000000000000.0) tmp = t_1; elseif (y <= 1.02e-14) tmp = Float64(x * Float64(t + Float64(z * 2.0))); elseif ((y <= 0.027) || !(y <= 5.7e+48)) tmp = t_1; else tmp = Float64(Float64(y * 5.0) + 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 <= -24000000000000.0) tmp = t_1; elseif (y <= 1.02e-14) tmp = x * (t + (z * 2.0)); elseif ((y <= 0.027) || ~((y <= 5.7e+48))) tmp = t_1; else tmp = (y * 5.0) + (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, -24000000000000.0], t$95$1, If[LessEqual[y, 1.02e-14], N[(x * N[(t + N[(z * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[y, 0.027], N[Not[LessEqual[y, 5.7e+48]], $MachinePrecision]], t$95$1, N[(N[(y * 5.0), $MachinePrecision] + N[(x * t), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := y \cdot \left(5 + x \cdot 2\right)\\
\mathbf{if}\;y \leq -24000000000000:\\
\;\;\;\;t_1\\
\mathbf{elif}\;y \leq 1.02 \cdot 10^{-14}:\\
\;\;\;\;x \cdot \left(t + z \cdot 2\right)\\
\mathbf{elif}\;y \leq 0.027 \lor \neg \left(y \leq 5.7 \cdot 10^{+48}\right):\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;y \cdot 5 + x \cdot t\\
\end{array}
\end{array}
if y < -2.4e13 or 1.02e-14 < y < 0.0269999999999999997 or 5.69999999999999968e48 < y Initial program 99.8%
fma-def99.8%
associate-+l+99.8%
+-commutative99.8%
count-299.8%
Simplified99.8%
Taylor expanded in y around inf 86.0%
if -2.4e13 < y < 1.02e-14Initial program 100.0%
Taylor expanded in y around 0 83.5%
if 0.0269999999999999997 < y < 5.69999999999999968e48Initial program 99.9%
Taylor expanded in y around 0 99.9%
Taylor expanded in z around inf 99.9%
Taylor expanded in z around 0 79.2%
Final simplification84.5%
(FPCore (x y z t) :precision binary64 (if (or (<= x -0.003) (not (<= x 7.2e+14))) (* x (+ t (* (+ y z) 2.0))) (+ (* 2.0 (* x (+ y z))) (* y 5.0))))
double code(double x, double y, double z, double t) {
double tmp;
if ((x <= -0.003) || !(x <= 7.2e+14)) {
tmp = x * (t + ((y + z) * 2.0));
} else {
tmp = (2.0 * (x * (y + 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 <= (-0.003d0)) .or. (.not. (x <= 7.2d+14))) then
tmp = x * (t + ((y + z) * 2.0d0))
else
tmp = (2.0d0 * (x * (y + 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 <= -0.003) || !(x <= 7.2e+14)) {
tmp = x * (t + ((y + z) * 2.0));
} else {
tmp = (2.0 * (x * (y + z))) + (y * 5.0);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (x <= -0.003) or not (x <= 7.2e+14): tmp = x * (t + ((y + z) * 2.0)) else: tmp = (2.0 * (x * (y + z))) + (y * 5.0) return tmp
function code(x, y, z, t) tmp = 0.0 if ((x <= -0.003) || !(x <= 7.2e+14)) tmp = Float64(x * Float64(t + Float64(Float64(y + z) * 2.0))); else tmp = Float64(Float64(2.0 * Float64(x * Float64(y + z))) + Float64(y * 5.0)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((x <= -0.003) || ~((x <= 7.2e+14))) tmp = x * (t + ((y + z) * 2.0)); else tmp = (2.0 * (x * (y + z))) + (y * 5.0); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[x, -0.003], N[Not[LessEqual[x, 7.2e+14]], $MachinePrecision]], N[(x * N[(t + N[(N[(y + z), $MachinePrecision] * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(2.0 * N[(x * N[(y + z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(y * 5.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -0.003 \lor \neg \left(x \leq 7.2 \cdot 10^{+14}\right):\\
\;\;\;\;x \cdot \left(t + \left(y + z\right) \cdot 2\right)\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \left(x \cdot \left(y + z\right)\right) + y \cdot 5\\
\end{array}
\end{array}
if x < -0.0030000000000000001 or 7.2e14 < 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.6%
if -0.0030000000000000001 < x < 7.2e14Initial program 99.8%
fma-def99.8%
associate-+l+99.8%
+-commutative99.8%
count-299.8%
Simplified99.8%
Taylor expanded in t around 0 84.7%
Final simplification92.4%
(FPCore (x y z t) :precision binary64 (if (or (<= x -66000.0) (not (<= x 2.4))) (* x (+ t (* (+ y z) 2.0))) (+ (* y 5.0) (* x (+ t (* z 2.0))))))
double code(double x, double y, double z, double t) {
double tmp;
if ((x <= -66000.0) || !(x <= 2.4)) {
tmp = x * (t + ((y + z) * 2.0));
} 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 <= (-66000.0d0)) .or. (.not. (x <= 2.4d0))) then
tmp = x * (t + ((y + z) * 2.0d0))
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 <= -66000.0) || !(x <= 2.4)) {
tmp = x * (t + ((y + z) * 2.0));
} else {
tmp = (y * 5.0) + (x * (t + (z * 2.0)));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (x <= -66000.0) or not (x <= 2.4): tmp = x * (t + ((y + z) * 2.0)) else: tmp = (y * 5.0) + (x * (t + (z * 2.0))) return tmp
function code(x, y, z, t) tmp = 0.0 if ((x <= -66000.0) || !(x <= 2.4)) tmp = Float64(x * Float64(t + Float64(Float64(y + z) * 2.0))); 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 <= -66000.0) || ~((x <= 2.4))) tmp = x * (t + ((y + z) * 2.0)); else tmp = (y * 5.0) + (x * (t + (z * 2.0))); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[x, -66000.0], N[Not[LessEqual[x, 2.4]], $MachinePrecision]], N[(x * N[(t + N[(N[(y + z), $MachinePrecision] * 2.0), $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 -66000 \lor \neg \left(x \leq 2.4\right):\\
\;\;\;\;x \cdot \left(t + \left(y + z\right) \cdot 2\right)\\
\mathbf{else}:\\
\;\;\;\;y \cdot 5 + x \cdot \left(t + z \cdot 2\right)\\
\end{array}
\end{array}
if x < -66000 or 2.39999999999999991 < 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.5%
if -66000 < x < 2.39999999999999991Initial program 99.8%
Taylor expanded in y around 0 99.8%
Taylor expanded in z around inf 98.0%
Final simplification98.8%
(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 99.9%
Taylor expanded in y around 0 99.9%
Final simplification99.9%
(FPCore (x y z t)
:precision binary64
(if (<= x -3.6e+158)
(* x (+ y t))
(if (or (<= x -5.2e-13) (not (<= x 7.8e-57)))
(* 2.0 (* x (+ y z)))
(* y 5.0))))
double code(double x, double y, double z, double t) {
double tmp;
if (x <= -3.6e+158) {
tmp = x * (y + t);
} else if ((x <= -5.2e-13) || !(x <= 7.8e-57)) {
tmp = 2.0 * (x * (y + z));
} 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.6d+158)) then
tmp = x * (y + t)
else if ((x <= (-5.2d-13)) .or. (.not. (x <= 7.8d-57))) then
tmp = 2.0d0 * (x * (y + z))
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.6e+158) {
tmp = x * (y + t);
} else if ((x <= -5.2e-13) || !(x <= 7.8e-57)) {
tmp = 2.0 * (x * (y + z));
} else {
tmp = y * 5.0;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if x <= -3.6e+158: tmp = x * (y + t) elif (x <= -5.2e-13) or not (x <= 7.8e-57): tmp = 2.0 * (x * (y + z)) else: tmp = y * 5.0 return tmp
function code(x, y, z, t) tmp = 0.0 if (x <= -3.6e+158) tmp = Float64(x * Float64(y + t)); elseif ((x <= -5.2e-13) || !(x <= 7.8e-57)) tmp = Float64(2.0 * Float64(x * Float64(y + z))); else tmp = Float64(y * 5.0); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (x <= -3.6e+158) tmp = x * (y + t); elseif ((x <= -5.2e-13) || ~((x <= 7.8e-57))) tmp = 2.0 * (x * (y + z)); else tmp = y * 5.0; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[x, -3.6e+158], N[(x * N[(y + t), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[x, -5.2e-13], N[Not[LessEqual[x, 7.8e-57]], $MachinePrecision]], N[(2.0 * N[(x * N[(y + z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(y * 5.0), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -3.6 \cdot 10^{+158}:\\
\;\;\;\;x \cdot \left(y + t\right)\\
\mathbf{elif}\;x \leq -5.2 \cdot 10^{-13} \lor \neg \left(x \leq 7.8 \cdot 10^{-57}\right):\\
\;\;\;\;2 \cdot \left(x \cdot \left(y + z\right)\right)\\
\mathbf{else}:\\
\;\;\;\;y \cdot 5\\
\end{array}
\end{array}
if x < -3.59999999999999988e158Initial program 100.0%
Taylor expanded in y around 0 91.6%
Simplified91.6%
Taylor expanded in z around 0 74.8%
fma-def74.8%
+-commutative74.8%
*-commutative74.8%
Simplified74.8%
Taylor expanded in x around inf 74.8%
if -3.59999999999999988e158 < x < -5.2000000000000001e-13 or 7.80000000000000013e-57 < x Initial program 99.9%
fma-def99.9%
associate-+l+99.9%
+-commutative99.9%
count-299.9%
Simplified99.9%
Taylor expanded in t around 0 76.0%
Taylor expanded in x around inf 71.4%
if -5.2000000000000001e-13 < x < 7.80000000000000013e-57Initial program 99.8%
Taylor expanded in x around 0 65.7%
Final simplification69.4%
(FPCore (x y z t)
:precision binary64
(if (<= x -1.5e+157)
(* x (+ y t))
(if (or (<= x -9.5e-7) (not (<= x 1.45)))
(* 2.0 (* x (+ y z)))
(* y (+ 5.0 (* x 2.0))))))
double code(double x, double y, double z, double t) {
double tmp;
if (x <= -1.5e+157) {
tmp = x * (y + t);
} else if ((x <= -9.5e-7) || !(x <= 1.45)) {
tmp = 2.0 * (x * (y + z));
} else {
tmp = 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) :: tmp
if (x <= (-1.5d+157)) then
tmp = x * (y + t)
else if ((x <= (-9.5d-7)) .or. (.not. (x <= 1.45d0))) then
tmp = 2.0d0 * (x * (y + z))
else
tmp = 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 tmp;
if (x <= -1.5e+157) {
tmp = x * (y + t);
} else if ((x <= -9.5e-7) || !(x <= 1.45)) {
tmp = 2.0 * (x * (y + z));
} else {
tmp = y * (5.0 + (x * 2.0));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if x <= -1.5e+157: tmp = x * (y + t) elif (x <= -9.5e-7) or not (x <= 1.45): tmp = 2.0 * (x * (y + z)) else: tmp = y * (5.0 + (x * 2.0)) return tmp
function code(x, y, z, t) tmp = 0.0 if (x <= -1.5e+157) tmp = Float64(x * Float64(y + t)); elseif ((x <= -9.5e-7) || !(x <= 1.45)) tmp = Float64(2.0 * Float64(x * Float64(y + z))); else tmp = Float64(y * Float64(5.0 + Float64(x * 2.0))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (x <= -1.5e+157) tmp = x * (y + t); elseif ((x <= -9.5e-7) || ~((x <= 1.45))) tmp = 2.0 * (x * (y + z)); else tmp = y * (5.0 + (x * 2.0)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[x, -1.5e+157], N[(x * N[(y + t), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[x, -9.5e-7], N[Not[LessEqual[x, 1.45]], $MachinePrecision]], N[(2.0 * N[(x * N[(y + z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(y * N[(5.0 + N[(x * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.5 \cdot 10^{+157}:\\
\;\;\;\;x \cdot \left(y + t\right)\\
\mathbf{elif}\;x \leq -9.5 \cdot 10^{-7} \lor \neg \left(x \leq 1.45\right):\\
\;\;\;\;2 \cdot \left(x \cdot \left(y + z\right)\right)\\
\mathbf{else}:\\
\;\;\;\;y \cdot \left(5 + x \cdot 2\right)\\
\end{array}
\end{array}
if x < -1.50000000000000005e157Initial program 100.0%
Taylor expanded in y around 0 91.6%
Simplified91.6%
Taylor expanded in z around 0 74.8%
fma-def74.8%
+-commutative74.8%
*-commutative74.8%
Simplified74.8%
Taylor expanded in x around inf 74.8%
if -1.50000000000000005e157 < x < -9.5000000000000001e-7 or 1.44999999999999996 < x Initial program 99.9%
fma-def99.9%
associate-+l+99.9%
+-commutative99.9%
count-299.9%
Simplified99.9%
Taylor expanded in t around 0 74.7%
Taylor expanded in x around inf 73.8%
if -9.5000000000000001e-7 < x < 1.44999999999999996Initial program 99.8%
fma-def99.9%
associate-+l+99.9%
+-commutative99.9%
count-299.9%
Simplified99.9%
Taylor expanded in y around inf 64.5%
Final simplification69.6%
(FPCore (x y z t) :precision binary64 (if (or (<= x -3.7e-17) (not (<= x 5.4e-58))) (* 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-17) || !(x <= 5.4e-58)) {
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-17)) .or. (.not. (x <= 5.4d-58))) 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-17) || !(x <= 5.4e-58)) {
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-17) or not (x <= 5.4e-58): 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-17) || !(x <= 5.4e-58)) 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-17) || ~((x <= 5.4e-58))) 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-17], N[Not[LessEqual[x, 5.4e-58]], $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^{-17} \lor \neg \left(x \leq 5.4 \cdot 10^{-58}\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.6999999999999997e-17 or 5.3999999999999998e-58 < x Initial program 99.9%
fma-def99.9%
associate-+l+99.9%
+-commutative99.9%
count-299.9%
Simplified99.9%
Taylor expanded in x around inf 95.9%
if -3.6999999999999997e-17 < x < 5.3999999999999998e-58Initial program 99.8%
Taylor expanded in y around 0 99.8%
Taylor expanded in z around inf 99.8%
Taylor expanded in z around 0 81.5%
Final simplification89.8%
(FPCore (x y z t) :precision binary64 (if (or (<= x -0.002) (not (<= x 3e-5))) (* x (+ t (* (+ y z) 2.0))) (+ (* y 5.0) (* 2.0 (* x z)))))
double code(double x, double y, double z, double t) {
double tmp;
if ((x <= -0.002) || !(x <= 3e-5)) {
tmp = x * (t + ((y + z) * 2.0));
} else {
tmp = (y * 5.0) + (2.0 * (x * z));
}
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 <= (-0.002d0)) .or. (.not. (x <= 3d-5))) then
tmp = x * (t + ((y + z) * 2.0d0))
else
tmp = (y * 5.0d0) + (2.0d0 * (x * z))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((x <= -0.002) || !(x <= 3e-5)) {
tmp = x * (t + ((y + z) * 2.0));
} else {
tmp = (y * 5.0) + (2.0 * (x * z));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (x <= -0.002) or not (x <= 3e-5): tmp = x * (t + ((y + z) * 2.0)) else: tmp = (y * 5.0) + (2.0 * (x * z)) return tmp
function code(x, y, z, t) tmp = 0.0 if ((x <= -0.002) || !(x <= 3e-5)) tmp = Float64(x * Float64(t + Float64(Float64(y + z) * 2.0))); else tmp = Float64(Float64(y * 5.0) + Float64(2.0 * Float64(x * z))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((x <= -0.002) || ~((x <= 3e-5))) tmp = x * (t + ((y + z) * 2.0)); else tmp = (y * 5.0) + (2.0 * (x * z)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[x, -0.002], N[Not[LessEqual[x, 3e-5]], $MachinePrecision]], N[(x * N[(t + N[(N[(y + z), $MachinePrecision] * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(y * 5.0), $MachinePrecision] + N[(2.0 * N[(x * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -0.002 \lor \neg \left(x \leq 3 \cdot 10^{-5}\right):\\
\;\;\;\;x \cdot \left(t + \left(y + z\right) \cdot 2\right)\\
\mathbf{else}:\\
\;\;\;\;y \cdot 5 + 2 \cdot \left(x \cdot z\right)\\
\end{array}
\end{array}
if x < -2e-3 or 3.00000000000000008e-5 < 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.5%
if -2e-3 < x < 3.00000000000000008e-5Initial program 99.8%
fma-def99.8%
associate-+l+99.8%
+-commutative99.8%
count-299.8%
Simplified99.8%
Taylor expanded in t around 0 84.3%
Taylor expanded in y around 0 82.5%
Final simplification91.5%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* 2.0 (* x z))))
(if (<= z -9e+111)
t_1
(if (<= z 7e-133) (* y 5.0) (if (<= z 1.4e+56) (* 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 <= -9e+111) {
tmp = t_1;
} else if (z <= 7e-133) {
tmp = y * 5.0;
} else if (z <= 1.4e+56) {
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 <= (-9d+111)) then
tmp = t_1
else if (z <= 7d-133) then
tmp = y * 5.0d0
else if (z <= 1.4d+56) 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 <= -9e+111) {
tmp = t_1;
} else if (z <= 7e-133) {
tmp = y * 5.0;
} else if (z <= 1.4e+56) {
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 <= -9e+111: tmp = t_1 elif z <= 7e-133: tmp = y * 5.0 elif z <= 1.4e+56: 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 <= -9e+111) tmp = t_1; elseif (z <= 7e-133) tmp = Float64(y * 5.0); elseif (z <= 1.4e+56) 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 <= -9e+111) tmp = t_1; elseif (z <= 7e-133) tmp = y * 5.0; elseif (z <= 1.4e+56) 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, -9e+111], t$95$1, If[LessEqual[z, 7e-133], N[(y * 5.0), $MachinePrecision], If[LessEqual[z, 1.4e+56], 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 -9 \cdot 10^{+111}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq 7 \cdot 10^{-133}:\\
\;\;\;\;y \cdot 5\\
\mathbf{elif}\;z \leq 1.4 \cdot 10^{+56}:\\
\;\;\;\;x \cdot t\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if z < -9.00000000000000001e111 or 1.40000000000000004e56 < z Initial program 99.9%
Taylor expanded in z around inf 63.3%
if -9.00000000000000001e111 < z < 7.00000000000000006e-133Initial program 99.9%
Taylor expanded in x around 0 39.5%
if 7.00000000000000006e-133 < z < 1.40000000000000004e56Initial program 99.9%
Taylor expanded in t around inf 44.9%
Final simplification49.5%
(FPCore (x y z t) :precision binary64 (if (<= x -1.06e-13) (* x t) (if (<= x 1.8e+15) (* y 5.0) (* x t))))
double code(double x, double y, double z, double t) {
double tmp;
if (x <= -1.06e-13) {
tmp = x * t;
} else if (x <= 1.8e+15) {
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.06d-13)) then
tmp = x * t
else if (x <= 1.8d+15) 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.06e-13) {
tmp = x * t;
} else if (x <= 1.8e+15) {
tmp = y * 5.0;
} else {
tmp = x * t;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if x <= -1.06e-13: tmp = x * t elif x <= 1.8e+15: tmp = y * 5.0 else: tmp = x * t return tmp
function code(x, y, z, t) tmp = 0.0 if (x <= -1.06e-13) tmp = Float64(x * t); elseif (x <= 1.8e+15) 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.06e-13) tmp = x * t; elseif (x <= 1.8e+15) tmp = y * 5.0; else tmp = x * t; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[x, -1.06e-13], N[(x * t), $MachinePrecision], If[LessEqual[x, 1.8e+15], N[(y * 5.0), $MachinePrecision], N[(x * t), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.06 \cdot 10^{-13}:\\
\;\;\;\;x \cdot t\\
\mathbf{elif}\;x \leq 1.8 \cdot 10^{+15}:\\
\;\;\;\;y \cdot 5\\
\mathbf{else}:\\
\;\;\;\;x \cdot t\\
\end{array}
\end{array}
if x < -1.06e-13 or 1.8e15 < x Initial program 99.9%
Taylor expanded in t around inf 36.7%
if -1.06e-13 < x < 1.8e15Initial program 99.8%
Taylor expanded in x around 0 61.4%
Final simplification48.7%
(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 31.0%
Final simplification31.0%
herbie shell --seed 2023192
(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)))