
(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 (+ (* 2.0 (+ y z)) t) (* y 5.0)))
double code(double x, double y, double z, double t) {
return fma(x, ((2.0 * (y + z)) + t), (y * 5.0));
}
function code(x, y, z, t) return fma(x, Float64(Float64(2.0 * Float64(y + z)) + t), Float64(y * 5.0)) end
code[x_, y_, z_, t_] := N[(x * N[(N[(2.0 * N[(y + z), $MachinePrecision]), $MachinePrecision] + t), $MachinePrecision] + N[(y * 5.0), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\mathsf{fma}\left(x, 2 \cdot \left(y + z\right) + t, y \cdot 5\right)
\end{array}
Initial program 99.9%
fma-define99.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 (* z (* x 2.0))))
(if (<= z -1.6e+141)
t_1
(if (<= z -2.3e-228)
(* x t)
(if (<= z -3.95e-289)
(* y 5.0)
(if (<= z 3.6e-295)
(* x t)
(if (<= z 3.6e-120)
(* y (* x 2.0))
(if (<= z 2.6e-58)
(* x t)
(if (<= z 2.3e-17)
(* y 5.0)
(if (<= z 2.8e+103) (* x t) t_1))))))))))
double code(double x, double y, double z, double t) {
double t_1 = z * (x * 2.0);
double tmp;
if (z <= -1.6e+141) {
tmp = t_1;
} else if (z <= -2.3e-228) {
tmp = x * t;
} else if (z <= -3.95e-289) {
tmp = y * 5.0;
} else if (z <= 3.6e-295) {
tmp = x * t;
} else if (z <= 3.6e-120) {
tmp = y * (x * 2.0);
} else if (z <= 2.6e-58) {
tmp = x * t;
} else if (z <= 2.3e-17) {
tmp = y * 5.0;
} else if (z <= 2.8e+103) {
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 = z * (x * 2.0d0)
if (z <= (-1.6d+141)) then
tmp = t_1
else if (z <= (-2.3d-228)) then
tmp = x * t
else if (z <= (-3.95d-289)) then
tmp = y * 5.0d0
else if (z <= 3.6d-295) then
tmp = x * t
else if (z <= 3.6d-120) then
tmp = y * (x * 2.0d0)
else if (z <= 2.6d-58) then
tmp = x * t
else if (z <= 2.3d-17) then
tmp = y * 5.0d0
else if (z <= 2.8d+103) 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 = z * (x * 2.0);
double tmp;
if (z <= -1.6e+141) {
tmp = t_1;
} else if (z <= -2.3e-228) {
tmp = x * t;
} else if (z <= -3.95e-289) {
tmp = y * 5.0;
} else if (z <= 3.6e-295) {
tmp = x * t;
} else if (z <= 3.6e-120) {
tmp = y * (x * 2.0);
} else if (z <= 2.6e-58) {
tmp = x * t;
} else if (z <= 2.3e-17) {
tmp = y * 5.0;
} else if (z <= 2.8e+103) {
tmp = x * t;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = z * (x * 2.0) tmp = 0 if z <= -1.6e+141: tmp = t_1 elif z <= -2.3e-228: tmp = x * t elif z <= -3.95e-289: tmp = y * 5.0 elif z <= 3.6e-295: tmp = x * t elif z <= 3.6e-120: tmp = y * (x * 2.0) elif z <= 2.6e-58: tmp = x * t elif z <= 2.3e-17: tmp = y * 5.0 elif z <= 2.8e+103: tmp = x * t else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(z * Float64(x * 2.0)) tmp = 0.0 if (z <= -1.6e+141) tmp = t_1; elseif (z <= -2.3e-228) tmp = Float64(x * t); elseif (z <= -3.95e-289) tmp = Float64(y * 5.0); elseif (z <= 3.6e-295) tmp = Float64(x * t); elseif (z <= 3.6e-120) tmp = Float64(y * Float64(x * 2.0)); elseif (z <= 2.6e-58) tmp = Float64(x * t); elseif (z <= 2.3e-17) tmp = Float64(y * 5.0); elseif (z <= 2.8e+103) tmp = Float64(x * t); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = z * (x * 2.0); tmp = 0.0; if (z <= -1.6e+141) tmp = t_1; elseif (z <= -2.3e-228) tmp = x * t; elseif (z <= -3.95e-289) tmp = y * 5.0; elseif (z <= 3.6e-295) tmp = x * t; elseif (z <= 3.6e-120) tmp = y * (x * 2.0); elseif (z <= 2.6e-58) tmp = x * t; elseif (z <= 2.3e-17) tmp = y * 5.0; elseif (z <= 2.8e+103) tmp = x * t; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(z * N[(x * 2.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -1.6e+141], t$95$1, If[LessEqual[z, -2.3e-228], N[(x * t), $MachinePrecision], If[LessEqual[z, -3.95e-289], N[(y * 5.0), $MachinePrecision], If[LessEqual[z, 3.6e-295], N[(x * t), $MachinePrecision], If[LessEqual[z, 3.6e-120], N[(y * N[(x * 2.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 2.6e-58], N[(x * t), $MachinePrecision], If[LessEqual[z, 2.3e-17], N[(y * 5.0), $MachinePrecision], If[LessEqual[z, 2.8e+103], N[(x * t), $MachinePrecision], t$95$1]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := z \cdot \left(x \cdot 2\right)\\
\mathbf{if}\;z \leq -1.6 \cdot 10^{+141}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq -2.3 \cdot 10^{-228}:\\
\;\;\;\;x \cdot t\\
\mathbf{elif}\;z \leq -3.95 \cdot 10^{-289}:\\
\;\;\;\;y \cdot 5\\
\mathbf{elif}\;z \leq 3.6 \cdot 10^{-295}:\\
\;\;\;\;x \cdot t\\
\mathbf{elif}\;z \leq 3.6 \cdot 10^{-120}:\\
\;\;\;\;y \cdot \left(x \cdot 2\right)\\
\mathbf{elif}\;z \leq 2.6 \cdot 10^{-58}:\\
\;\;\;\;x \cdot t\\
\mathbf{elif}\;z \leq 2.3 \cdot 10^{-17}:\\
\;\;\;\;y \cdot 5\\
\mathbf{elif}\;z \leq 2.8 \cdot 10^{+103}:\\
\;\;\;\;x \cdot t\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -1.60000000000000009e141 or 2.80000000000000008e103 < z Initial program 100.0%
Taylor expanded in z around inf 76.4%
Simplified76.4%
if -1.60000000000000009e141 < z < -2.2999999999999999e-228 or -3.9499999999999999e-289 < z < 3.6000000000000001e-295 or 3.6000000000000003e-120 < z < 2.60000000000000007e-58 or 2.30000000000000009e-17 < z < 2.80000000000000008e103Initial program 99.9%
Taylor expanded in t around inf 54.6%
Simplified54.6%
if -2.2999999999999999e-228 < z < -3.9499999999999999e-289 or 2.60000000000000007e-58 < z < 2.30000000000000009e-17Initial program 100.0%
Taylor expanded in x around 0 71.1%
if 3.6000000000000001e-295 < z < 3.6000000000000003e-120Initial program 99.8%
Taylor expanded in y around 0 99.9%
Taylor expanded in x around inf 70.9%
*-commutative70.9%
*-commutative70.9%
associate-*r*70.9%
Simplified70.9%
Taylor expanded in y around inf 49.2%
associate-*r*49.2%
*-commutative49.2%
*-commutative49.2%
Simplified49.2%
Final simplification61.3%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* y (* x 2.0))))
(if (<= x -7.6e+202)
t_1
(if (<= x -2.3e+57)
(* x t)
(if (<= x -1250000000000.0)
t_1
(if (<= x -3.9e-87)
(* x t)
(if (<= x 3.8e-92)
(* y 5.0)
(if (or (<= x 6.4e+128) (not (<= x 1.28e+181)))
(* x t)
t_1))))))))
double code(double x, double y, double z, double t) {
double t_1 = y * (x * 2.0);
double tmp;
if (x <= -7.6e+202) {
tmp = t_1;
} else if (x <= -2.3e+57) {
tmp = x * t;
} else if (x <= -1250000000000.0) {
tmp = t_1;
} else if (x <= -3.9e-87) {
tmp = x * t;
} else if (x <= 3.8e-92) {
tmp = y * 5.0;
} else if ((x <= 6.4e+128) || !(x <= 1.28e+181)) {
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 = y * (x * 2.0d0)
if (x <= (-7.6d+202)) then
tmp = t_1
else if (x <= (-2.3d+57)) then
tmp = x * t
else if (x <= (-1250000000000.0d0)) then
tmp = t_1
else if (x <= (-3.9d-87)) then
tmp = x * t
else if (x <= 3.8d-92) then
tmp = y * 5.0d0
else if ((x <= 6.4d+128) .or. (.not. (x <= 1.28d+181))) 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 * (x * 2.0);
double tmp;
if (x <= -7.6e+202) {
tmp = t_1;
} else if (x <= -2.3e+57) {
tmp = x * t;
} else if (x <= -1250000000000.0) {
tmp = t_1;
} else if (x <= -3.9e-87) {
tmp = x * t;
} else if (x <= 3.8e-92) {
tmp = y * 5.0;
} else if ((x <= 6.4e+128) || !(x <= 1.28e+181)) {
tmp = x * t;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = y * (x * 2.0) tmp = 0 if x <= -7.6e+202: tmp = t_1 elif x <= -2.3e+57: tmp = x * t elif x <= -1250000000000.0: tmp = t_1 elif x <= -3.9e-87: tmp = x * t elif x <= 3.8e-92: tmp = y * 5.0 elif (x <= 6.4e+128) or not (x <= 1.28e+181): tmp = x * t else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(y * Float64(x * 2.0)) tmp = 0.0 if (x <= -7.6e+202) tmp = t_1; elseif (x <= -2.3e+57) tmp = Float64(x * t); elseif (x <= -1250000000000.0) tmp = t_1; elseif (x <= -3.9e-87) tmp = Float64(x * t); elseif (x <= 3.8e-92) tmp = Float64(y * 5.0); elseif ((x <= 6.4e+128) || !(x <= 1.28e+181)) tmp = Float64(x * t); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = y * (x * 2.0); tmp = 0.0; if (x <= -7.6e+202) tmp = t_1; elseif (x <= -2.3e+57) tmp = x * t; elseif (x <= -1250000000000.0) tmp = t_1; elseif (x <= -3.9e-87) tmp = x * t; elseif (x <= 3.8e-92) tmp = y * 5.0; elseif ((x <= 6.4e+128) || ~((x <= 1.28e+181))) tmp = x * t; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(y * N[(x * 2.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -7.6e+202], t$95$1, If[LessEqual[x, -2.3e+57], N[(x * t), $MachinePrecision], If[LessEqual[x, -1250000000000.0], t$95$1, If[LessEqual[x, -3.9e-87], N[(x * t), $MachinePrecision], If[LessEqual[x, 3.8e-92], N[(y * 5.0), $MachinePrecision], If[Or[LessEqual[x, 6.4e+128], N[Not[LessEqual[x, 1.28e+181]], $MachinePrecision]], N[(x * t), $MachinePrecision], t$95$1]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := y \cdot \left(x \cdot 2\right)\\
\mathbf{if}\;x \leq -7.6 \cdot 10^{+202}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \leq -2.3 \cdot 10^{+57}:\\
\;\;\;\;x \cdot t\\
\mathbf{elif}\;x \leq -1250000000000:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \leq -3.9 \cdot 10^{-87}:\\
\;\;\;\;x \cdot t\\
\mathbf{elif}\;x \leq 3.8 \cdot 10^{-92}:\\
\;\;\;\;y \cdot 5\\
\mathbf{elif}\;x \leq 6.4 \cdot 10^{+128} \lor \neg \left(x \leq 1.28 \cdot 10^{+181}\right):\\
\;\;\;\;x \cdot t\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if x < -7.6000000000000001e202 or -2.2999999999999999e57 < x < -1.25e12 or 6.39999999999999971e128 < x < 1.27999999999999997e181Initial program 100.0%
Taylor expanded in y around 0 88.6%
Taylor expanded in x around inf 88.0%
*-commutative88.0%
*-commutative88.0%
associate-*r*88.0%
Simplified88.0%
Taylor expanded in y around inf 58.1%
associate-*r*58.1%
*-commutative58.1%
*-commutative58.1%
Simplified58.1%
if -7.6000000000000001e202 < x < -2.2999999999999999e57 or -1.25e12 < x < -3.8999999999999998e-87 or 3.8000000000000001e-92 < x < 6.39999999999999971e128 or 1.27999999999999997e181 < x Initial program 100.0%
Taylor expanded in t around inf 51.0%
Simplified51.0%
if -3.8999999999999998e-87 < x < 3.8000000000000001e-92Initial program 99.9%
Taylor expanded in x around 0 63.8%
Final simplification56.7%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* x (+ t (* 2.0 z)))) (t_2 (* x (+ t (* 2.0 y)))))
(if (<= x -2900000000000.0)
t_2
(if (<= x -1.3e-87)
t_1
(if (<= x 1.22e-141)
(* y 5.0)
(if (or (<= x 2.2e+147) (not (<= x 6e+255))) t_1 t_2))))))
double code(double x, double y, double z, double t) {
double t_1 = x * (t + (2.0 * z));
double t_2 = x * (t + (2.0 * y));
double tmp;
if (x <= -2900000000000.0) {
tmp = t_2;
} else if (x <= -1.3e-87) {
tmp = t_1;
} else if (x <= 1.22e-141) {
tmp = y * 5.0;
} else if ((x <= 2.2e+147) || !(x <= 6e+255)) {
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 = x * (t + (2.0d0 * z))
t_2 = x * (t + (2.0d0 * y))
if (x <= (-2900000000000.0d0)) then
tmp = t_2
else if (x <= (-1.3d-87)) then
tmp = t_1
else if (x <= 1.22d-141) then
tmp = y * 5.0d0
else if ((x <= 2.2d+147) .or. (.not. (x <= 6d+255))) 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 * (t + (2.0 * z));
double t_2 = x * (t + (2.0 * y));
double tmp;
if (x <= -2900000000000.0) {
tmp = t_2;
} else if (x <= -1.3e-87) {
tmp = t_1;
} else if (x <= 1.22e-141) {
tmp = y * 5.0;
} else if ((x <= 2.2e+147) || !(x <= 6e+255)) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t): t_1 = x * (t + (2.0 * z)) t_2 = x * (t + (2.0 * y)) tmp = 0 if x <= -2900000000000.0: tmp = t_2 elif x <= -1.3e-87: tmp = t_1 elif x <= 1.22e-141: tmp = y * 5.0 elif (x <= 2.2e+147) or not (x <= 6e+255): tmp = t_1 else: tmp = t_2 return tmp
function code(x, y, z, t) t_1 = Float64(x * Float64(t + Float64(2.0 * z))) t_2 = Float64(x * Float64(t + Float64(2.0 * y))) tmp = 0.0 if (x <= -2900000000000.0) tmp = t_2; elseif (x <= -1.3e-87) tmp = t_1; elseif (x <= 1.22e-141) tmp = Float64(y * 5.0); elseif ((x <= 2.2e+147) || !(x <= 6e+255)) tmp = t_1; else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = x * (t + (2.0 * z)); t_2 = x * (t + (2.0 * y)); tmp = 0.0; if (x <= -2900000000000.0) tmp = t_2; elseif (x <= -1.3e-87) tmp = t_1; elseif (x <= 1.22e-141) tmp = y * 5.0; elseif ((x <= 2.2e+147) || ~((x <= 6e+255))) tmp = t_1; else tmp = t_2; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(x * N[(t + N[(2.0 * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(x * N[(t + N[(2.0 * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -2900000000000.0], t$95$2, If[LessEqual[x, -1.3e-87], t$95$1, If[LessEqual[x, 1.22e-141], N[(y * 5.0), $MachinePrecision], If[Or[LessEqual[x, 2.2e+147], N[Not[LessEqual[x, 6e+255]], $MachinePrecision]], t$95$1, t$95$2]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot \left(t + 2 \cdot z\right)\\
t_2 := x \cdot \left(t + 2 \cdot y\right)\\
\mathbf{if}\;x \leq -2900000000000:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;x \leq -1.3 \cdot 10^{-87}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \leq 1.22 \cdot 10^{-141}:\\
\;\;\;\;y \cdot 5\\
\mathbf{elif}\;x \leq 2.2 \cdot 10^{+147} \lor \neg \left(x \leq 6 \cdot 10^{+255}\right):\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if x < -2.9e12 or 2.2000000000000002e147 < x < 6.00000000000000035e255Initial program 100.0%
fma-define100.0%
associate-+l+100.0%
+-commutative100.0%
count-2100.0%
Simplified100.0%
Taylor expanded in x around inf 99.7%
Taylor expanded in z around 0 80.5%
if -2.9e12 < x < -1.30000000000000001e-87 or 1.22e-141 < x < 2.2000000000000002e147 or 6.00000000000000035e255 < x Initial program 100.0%
Taylor expanded in y around 0 78.8%
if -1.30000000000000001e-87 < x < 1.22e-141Initial program 99.9%
Taylor expanded in x around 0 67.5%
Final simplification75.7%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* y (+ 5.0 (* x 2.0)))))
(if (<= y -1.7e+89)
t_1
(if (<= y -4.6e+33)
(* x (+ t (* 2.0 y)))
(if (or (<= y -400000000000.0) (not (<= y 1.95e-19)))
t_1
(* x (+ t (* 2.0 z))))))))
double code(double x, double y, double z, double t) {
double t_1 = y * (5.0 + (x * 2.0));
double tmp;
if (y <= -1.7e+89) {
tmp = t_1;
} else if (y <= -4.6e+33) {
tmp = x * (t + (2.0 * y));
} else if ((y <= -400000000000.0) || !(y <= 1.95e-19)) {
tmp = t_1;
} else {
tmp = x * (t + (2.0 * 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) :: t_1
real(8) :: tmp
t_1 = y * (5.0d0 + (x * 2.0d0))
if (y <= (-1.7d+89)) then
tmp = t_1
else if (y <= (-4.6d+33)) then
tmp = x * (t + (2.0d0 * y))
else if ((y <= (-400000000000.0d0)) .or. (.not. (y <= 1.95d-19))) then
tmp = t_1
else
tmp = x * (t + (2.0d0 * z))
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.7e+89) {
tmp = t_1;
} else if (y <= -4.6e+33) {
tmp = x * (t + (2.0 * y));
} else if ((y <= -400000000000.0) || !(y <= 1.95e-19)) {
tmp = t_1;
} else {
tmp = x * (t + (2.0 * z));
}
return tmp;
}
def code(x, y, z, t): t_1 = y * (5.0 + (x * 2.0)) tmp = 0 if y <= -1.7e+89: tmp = t_1 elif y <= -4.6e+33: tmp = x * (t + (2.0 * y)) elif (y <= -400000000000.0) or not (y <= 1.95e-19): tmp = t_1 else: tmp = x * (t + (2.0 * z)) 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.7e+89) tmp = t_1; elseif (y <= -4.6e+33) tmp = Float64(x * Float64(t + Float64(2.0 * y))); elseif ((y <= -400000000000.0) || !(y <= 1.95e-19)) tmp = t_1; else tmp = Float64(x * Float64(t + Float64(2.0 * z))); 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.7e+89) tmp = t_1; elseif (y <= -4.6e+33) tmp = x * (t + (2.0 * y)); elseif ((y <= -400000000000.0) || ~((y <= 1.95e-19))) tmp = t_1; else tmp = x * (t + (2.0 * z)); 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.7e+89], t$95$1, If[LessEqual[y, -4.6e+33], N[(x * N[(t + N[(2.0 * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[y, -400000000000.0], N[Not[LessEqual[y, 1.95e-19]], $MachinePrecision]], t$95$1, N[(x * N[(t + N[(2.0 * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := y \cdot \left(5 + x \cdot 2\right)\\
\mathbf{if}\;y \leq -1.7 \cdot 10^{+89}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq -4.6 \cdot 10^{+33}:\\
\;\;\;\;x \cdot \left(t + 2 \cdot y\right)\\
\mathbf{elif}\;y \leq -400000000000 \lor \neg \left(y \leq 1.95 \cdot 10^{-19}\right):\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(t + 2 \cdot z\right)\\
\end{array}
\end{array}
if y < -1.7000000000000001e89 or -4.60000000000000021e33 < y < -4e11 or 1.94999999999999998e-19 < y Initial program 99.9%
Taylor expanded in y around inf 78.2%
Simplified78.2%
if -1.7000000000000001e89 < y < -4.60000000000000021e33Initial program 100.0%
fma-define100.0%
associate-+l+100.0%
+-commutative100.0%
count-2100.0%
Simplified100.0%
Taylor expanded in x around inf 78.2%
Taylor expanded in z around 0 78.2%
if -4e11 < y < 1.94999999999999998e-19Initial program 99.9%
Taylor expanded in y around 0 83.6%
Final simplification80.8%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* z (* x 2.0))) (t_2 (* x (+ t (* 2.0 y)))))
(if (<= z -2.95e+141)
t_1
(if (<= z -9.5e-229)
t_2
(if (<= z -7.8e-286) (* y 5.0) (if (<= z 4.65e+114) t_2 t_1))))))
double code(double x, double y, double z, double t) {
double t_1 = z * (x * 2.0);
double t_2 = x * (t + (2.0 * y));
double tmp;
if (z <= -2.95e+141) {
tmp = t_1;
} else if (z <= -9.5e-229) {
tmp = t_2;
} else if (z <= -7.8e-286) {
tmp = y * 5.0;
} else if (z <= 4.65e+114) {
tmp = t_2;
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = z * (x * 2.0d0)
t_2 = x * (t + (2.0d0 * y))
if (z <= (-2.95d+141)) then
tmp = t_1
else if (z <= (-9.5d-229)) then
tmp = t_2
else if (z <= (-7.8d-286)) then
tmp = y * 5.0d0
else if (z <= 4.65d+114) 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 = z * (x * 2.0);
double t_2 = x * (t + (2.0 * y));
double tmp;
if (z <= -2.95e+141) {
tmp = t_1;
} else if (z <= -9.5e-229) {
tmp = t_2;
} else if (z <= -7.8e-286) {
tmp = y * 5.0;
} else if (z <= 4.65e+114) {
tmp = t_2;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = z * (x * 2.0) t_2 = x * (t + (2.0 * y)) tmp = 0 if z <= -2.95e+141: tmp = t_1 elif z <= -9.5e-229: tmp = t_2 elif z <= -7.8e-286: tmp = y * 5.0 elif z <= 4.65e+114: tmp = t_2 else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(z * Float64(x * 2.0)) t_2 = Float64(x * Float64(t + Float64(2.0 * y))) tmp = 0.0 if (z <= -2.95e+141) tmp = t_1; elseif (z <= -9.5e-229) tmp = t_2; elseif (z <= -7.8e-286) tmp = Float64(y * 5.0); elseif (z <= 4.65e+114) tmp = t_2; else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = z * (x * 2.0); t_2 = x * (t + (2.0 * y)); tmp = 0.0; if (z <= -2.95e+141) tmp = t_1; elseif (z <= -9.5e-229) tmp = t_2; elseif (z <= -7.8e-286) tmp = y * 5.0; elseif (z <= 4.65e+114) tmp = t_2; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(z * N[(x * 2.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(x * N[(t + N[(2.0 * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -2.95e+141], t$95$1, If[LessEqual[z, -9.5e-229], t$95$2, If[LessEqual[z, -7.8e-286], N[(y * 5.0), $MachinePrecision], If[LessEqual[z, 4.65e+114], t$95$2, t$95$1]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := z \cdot \left(x \cdot 2\right)\\
t_2 := x \cdot \left(t + 2 \cdot y\right)\\
\mathbf{if}\;z \leq -2.95 \cdot 10^{+141}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq -9.5 \cdot 10^{-229}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;z \leq -7.8 \cdot 10^{-286}:\\
\;\;\;\;y \cdot 5\\
\mathbf{elif}\;z \leq 4.65 \cdot 10^{+114}:\\
\;\;\;\;t\_2\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -2.95000000000000014e141 or 4.6500000000000001e114 < z Initial program 100.0%
Taylor expanded in z around inf 77.4%
Simplified77.4%
if -2.95000000000000014e141 < z < -9.4999999999999997e-229 or -7.7999999999999999e-286 < z < 4.6500000000000001e114Initial program 99.9%
fma-define99.9%
associate-+l+99.9%
+-commutative99.9%
count-299.9%
Simplified99.9%
Taylor expanded in x around inf 72.7%
Taylor expanded in z around 0 65.9%
if -9.4999999999999997e-229 < z < -7.7999999999999999e-286Initial program 100.0%
Taylor expanded in x around 0 80.3%
Final simplification69.8%
(FPCore (x y z t) :precision binary64 (if (or (<= x -4.3e-16) (not (<= x 1.1e-10))) (* x (+ t (+ (* 2.0 (+ y z)) (* 5.0 (/ y x))))) (+ (* x (+ t (* 2.0 z))) (* y 5.0))))
double code(double x, double y, double z, double t) {
double tmp;
if ((x <= -4.3e-16) || !(x <= 1.1e-10)) {
tmp = x * (t + ((2.0 * (y + z)) + (5.0 * (y / x))));
} else {
tmp = (x * (t + (2.0 * 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 <= (-4.3d-16)) .or. (.not. (x <= 1.1d-10))) then
tmp = x * (t + ((2.0d0 * (y + z)) + (5.0d0 * (y / x))))
else
tmp = (x * (t + (2.0d0 * 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 <= -4.3e-16) || !(x <= 1.1e-10)) {
tmp = x * (t + ((2.0 * (y + z)) + (5.0 * (y / x))));
} else {
tmp = (x * (t + (2.0 * z))) + (y * 5.0);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (x <= -4.3e-16) or not (x <= 1.1e-10): tmp = x * (t + ((2.0 * (y + z)) + (5.0 * (y / x)))) else: tmp = (x * (t + (2.0 * z))) + (y * 5.0) return tmp
function code(x, y, z, t) tmp = 0.0 if ((x <= -4.3e-16) || !(x <= 1.1e-10)) tmp = Float64(x * Float64(t + Float64(Float64(2.0 * Float64(y + z)) + Float64(5.0 * Float64(y / x))))); else tmp = Float64(Float64(x * Float64(t + Float64(2.0 * z))) + Float64(y * 5.0)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((x <= -4.3e-16) || ~((x <= 1.1e-10))) tmp = x * (t + ((2.0 * (y + z)) + (5.0 * (y / x)))); else tmp = (x * (t + (2.0 * z))) + (y * 5.0); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[x, -4.3e-16], N[Not[LessEqual[x, 1.1e-10]], $MachinePrecision]], N[(x * N[(t + N[(N[(2.0 * N[(y + z), $MachinePrecision]), $MachinePrecision] + N[(5.0 * N[(y / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x * N[(t + N[(2.0 * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(y * 5.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -4.3 \cdot 10^{-16} \lor \neg \left(x \leq 1.1 \cdot 10^{-10}\right):\\
\;\;\;\;x \cdot \left(t + \left(2 \cdot \left(y + z\right) + 5 \cdot \frac{y}{x}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(t + 2 \cdot z\right) + y \cdot 5\\
\end{array}
\end{array}
if x < -4.2999999999999999e-16 or 1.09999999999999995e-10 < 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 100.0%
if -4.2999999999999999e-16 < x < 1.09999999999999995e-10Initial program 99.9%
Taylor expanded in y around 0 99.6%
Final simplification99.8%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* x (+ (* 2.0 (+ y z)) t))))
(if (<= x -7.3e-34)
t_1
(if (<= x 7e-280)
(+ (* y 5.0) (* x t))
(if (<= x 7.5e-117) (+ (* y 5.0) (* 2.0 (* x z))) t_1)))))
double code(double x, double y, double z, double t) {
double t_1 = x * ((2.0 * (y + z)) + t);
double tmp;
if (x <= -7.3e-34) {
tmp = t_1;
} else if (x <= 7e-280) {
tmp = (y * 5.0) + (x * t);
} else if (x <= 7.5e-117) {
tmp = (y * 5.0) + (2.0 * (x * z));
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: tmp
t_1 = x * ((2.0d0 * (y + z)) + t)
if (x <= (-7.3d-34)) then
tmp = t_1
else if (x <= 7d-280) then
tmp = (y * 5.0d0) + (x * t)
else if (x <= 7.5d-117) then
tmp = (y * 5.0d0) + (2.0d0 * (x * z))
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 * ((2.0 * (y + z)) + t);
double tmp;
if (x <= -7.3e-34) {
tmp = t_1;
} else if (x <= 7e-280) {
tmp = (y * 5.0) + (x * t);
} else if (x <= 7.5e-117) {
tmp = (y * 5.0) + (2.0 * (x * z));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = x * ((2.0 * (y + z)) + t) tmp = 0 if x <= -7.3e-34: tmp = t_1 elif x <= 7e-280: tmp = (y * 5.0) + (x * t) elif x <= 7.5e-117: tmp = (y * 5.0) + (2.0 * (x * z)) else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(x * Float64(Float64(2.0 * Float64(y + z)) + t)) tmp = 0.0 if (x <= -7.3e-34) tmp = t_1; elseif (x <= 7e-280) tmp = Float64(Float64(y * 5.0) + Float64(x * t)); elseif (x <= 7.5e-117) tmp = Float64(Float64(y * 5.0) + Float64(2.0 * Float64(x * z))); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = x * ((2.0 * (y + z)) + t); tmp = 0.0; if (x <= -7.3e-34) tmp = t_1; elseif (x <= 7e-280) tmp = (y * 5.0) + (x * t); elseif (x <= 7.5e-117) tmp = (y * 5.0) + (2.0 * (x * z)); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(x * N[(N[(2.0 * N[(y + z), $MachinePrecision]), $MachinePrecision] + t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -7.3e-34], t$95$1, If[LessEqual[x, 7e-280], N[(N[(y * 5.0), $MachinePrecision] + N[(x * t), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 7.5e-117], N[(N[(y * 5.0), $MachinePrecision] + N[(2.0 * N[(x * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot \left(2 \cdot \left(y + z\right) + t\right)\\
\mathbf{if}\;x \leq -7.3 \cdot 10^{-34}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \leq 7 \cdot 10^{-280}:\\
\;\;\;\;y \cdot 5 + x \cdot t\\
\mathbf{elif}\;x \leq 7.5 \cdot 10^{-117}:\\
\;\;\;\;y \cdot 5 + 2 \cdot \left(x \cdot z\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if x < -7.29999999999999996e-34 or 7.50000000000000066e-117 < 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 95.0%
if -7.29999999999999996e-34 < x < 7.0000000000000002e-280Initial program 99.9%
Taylor expanded in y around 0 99.9%
Taylor expanded in z around 0 90.9%
if 7.0000000000000002e-280 < x < 7.50000000000000066e-117Initial program 99.9%
Taylor expanded in y around 0 99.9%
Taylor expanded in t around 0 86.8%
Final simplification92.7%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* y (+ 5.0 (* x 2.0)))))
(if (<= y -4e+147)
t_1
(if (<= y -1.4e-46)
(+ (* y 5.0) (* x t))
(if (<= y 1.6e-18) (* x (+ t (* 2.0 z))) t_1)))))
double code(double x, double y, double z, double t) {
double t_1 = y * (5.0 + (x * 2.0));
double tmp;
if (y <= -4e+147) {
tmp = t_1;
} else if (y <= -1.4e-46) {
tmp = (y * 5.0) + (x * t);
} else if (y <= 1.6e-18) {
tmp = x * (t + (2.0 * z));
} 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 = y * (5.0d0 + (x * 2.0d0))
if (y <= (-4d+147)) then
tmp = t_1
else if (y <= (-1.4d-46)) then
tmp = (y * 5.0d0) + (x * t)
else if (y <= 1.6d-18) then
tmp = x * (t + (2.0d0 * z))
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = y * (5.0 + (x * 2.0));
double tmp;
if (y <= -4e+147) {
tmp = t_1;
} else if (y <= -1.4e-46) {
tmp = (y * 5.0) + (x * t);
} else if (y <= 1.6e-18) {
tmp = x * (t + (2.0 * z));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = y * (5.0 + (x * 2.0)) tmp = 0 if y <= -4e+147: tmp = t_1 elif y <= -1.4e-46: tmp = (y * 5.0) + (x * t) elif y <= 1.6e-18: tmp = x * (t + (2.0 * z)) else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(y * Float64(5.0 + Float64(x * 2.0))) tmp = 0.0 if (y <= -4e+147) tmp = t_1; elseif (y <= -1.4e-46) tmp = Float64(Float64(y * 5.0) + Float64(x * t)); elseif (y <= 1.6e-18) tmp = Float64(x * Float64(t + Float64(2.0 * z))); else tmp = t_1; 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 <= -4e+147) tmp = t_1; elseif (y <= -1.4e-46) tmp = (y * 5.0) + (x * t); elseif (y <= 1.6e-18) tmp = x * (t + (2.0 * z)); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(y * N[(5.0 + N[(x * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -4e+147], t$95$1, If[LessEqual[y, -1.4e-46], N[(N[(y * 5.0), $MachinePrecision] + N[(x * t), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.6e-18], N[(x * N[(t + N[(2.0 * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := y \cdot \left(5 + x \cdot 2\right)\\
\mathbf{if}\;y \leq -4 \cdot 10^{+147}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq -1.4 \cdot 10^{-46}:\\
\;\;\;\;y \cdot 5 + x \cdot t\\
\mathbf{elif}\;y \leq 1.6 \cdot 10^{-18}:\\
\;\;\;\;x \cdot \left(t + 2 \cdot z\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y < -3.9999999999999999e147 or 1.6e-18 < y Initial program 99.9%
Taylor expanded in y around inf 79.8%
Simplified79.8%
if -3.9999999999999999e147 < y < -1.3999999999999999e-46Initial program 99.9%
Taylor expanded in y around 0 84.4%
Taylor expanded in z around 0 75.0%
if -1.3999999999999999e-46 < y < 1.6e-18Initial program 100.0%
Taylor expanded in y around 0 87.1%
Final simplification82.0%
(FPCore (x y z t) :precision binary64 (if (or (<= x -650000000000.0) (not (<= x 2.5))) (* x (+ (* 2.0 (+ y z)) t)) (+ (* x (+ t (* 2.0 z))) (* y 5.0))))
double code(double x, double y, double z, double t) {
double tmp;
if ((x <= -650000000000.0) || !(x <= 2.5)) {
tmp = x * ((2.0 * (y + z)) + t);
} else {
tmp = (x * (t + (2.0 * 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 <= (-650000000000.0d0)) .or. (.not. (x <= 2.5d0))) then
tmp = x * ((2.0d0 * (y + z)) + t)
else
tmp = (x * (t + (2.0d0 * 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 <= -650000000000.0) || !(x <= 2.5)) {
tmp = x * ((2.0 * (y + z)) + t);
} else {
tmp = (x * (t + (2.0 * z))) + (y * 5.0);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (x <= -650000000000.0) or not (x <= 2.5): tmp = x * ((2.0 * (y + z)) + t) else: tmp = (x * (t + (2.0 * z))) + (y * 5.0) return tmp
function code(x, y, z, t) tmp = 0.0 if ((x <= -650000000000.0) || !(x <= 2.5)) tmp = Float64(x * Float64(Float64(2.0 * Float64(y + z)) + t)); else tmp = Float64(Float64(x * Float64(t + Float64(2.0 * z))) + Float64(y * 5.0)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((x <= -650000000000.0) || ~((x <= 2.5))) tmp = x * ((2.0 * (y + z)) + t); else tmp = (x * (t + (2.0 * z))) + (y * 5.0); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[x, -650000000000.0], N[Not[LessEqual[x, 2.5]], $MachinePrecision]], N[(x * N[(N[(2.0 * N[(y + z), $MachinePrecision]), $MachinePrecision] + t), $MachinePrecision]), $MachinePrecision], N[(N[(x * N[(t + N[(2.0 * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(y * 5.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -650000000000 \lor \neg \left(x \leq 2.5\right):\\
\;\;\;\;x \cdot \left(2 \cdot \left(y + z\right) + t\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(t + 2 \cdot z\right) + y \cdot 5\\
\end{array}
\end{array}
if x < -6.5e11 or 2.5 < 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.8%
if -6.5e11 < x < 2.5Initial program 99.9%
Taylor expanded in y around 0 98.5%
Final simplification99.1%
(FPCore (x y z t) :precision binary64 (if (or (<= x -3.9e-34) (not (<= x 3.8e-92))) (* x (+ (* 2.0 (+ y z)) t)) (+ (* y 5.0) (* x t))))
double code(double x, double y, double z, double t) {
double tmp;
if ((x <= -3.9e-34) || !(x <= 3.8e-92)) {
tmp = x * ((2.0 * (y + z)) + t);
} 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.9d-34)) .or. (.not. (x <= 3.8d-92))) then
tmp = x * ((2.0d0 * (y + z)) + t)
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.9e-34) || !(x <= 3.8e-92)) {
tmp = x * ((2.0 * (y + z)) + t);
} else {
tmp = (y * 5.0) + (x * t);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (x <= -3.9e-34) or not (x <= 3.8e-92): tmp = x * ((2.0 * (y + z)) + t) else: tmp = (y * 5.0) + (x * t) return tmp
function code(x, y, z, t) tmp = 0.0 if ((x <= -3.9e-34) || !(x <= 3.8e-92)) tmp = Float64(x * Float64(Float64(2.0 * Float64(y + z)) + t)); 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.9e-34) || ~((x <= 3.8e-92))) tmp = x * ((2.0 * (y + z)) + t); else tmp = (y * 5.0) + (x * t); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[x, -3.9e-34], N[Not[LessEqual[x, 3.8e-92]], $MachinePrecision]], N[(x * N[(N[(2.0 * N[(y + z), $MachinePrecision]), $MachinePrecision] + t), $MachinePrecision]), $MachinePrecision], N[(N[(y * 5.0), $MachinePrecision] + N[(x * t), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -3.9 \cdot 10^{-34} \lor \neg \left(x \leq 3.8 \cdot 10^{-92}\right):\\
\;\;\;\;x \cdot \left(2 \cdot \left(y + z\right) + t\right)\\
\mathbf{else}:\\
\;\;\;\;y \cdot 5 + x \cdot t\\
\end{array}
\end{array}
if x < -3.89999999999999991e-34 or 3.8000000000000001e-92 < 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 96.2%
if -3.89999999999999991e-34 < x < 3.8000000000000001e-92Initial program 99.9%
Taylor expanded in y around 0 99.9%
Taylor expanded in z around 0 83.7%
Final simplification91.0%
(FPCore (x y z t) :precision binary64 (+ (* x (+ t (* 2.0 z))) (* y (+ 5.0 (* x 2.0)))))
double code(double x, double y, double z, double t) {
return (x * (t + (2.0 * z))) + (y * (5.0 + (x * 2.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 + (2.0d0 * z))) + (y * (5.0d0 + (x * 2.0d0)))
end function
public static double code(double x, double y, double z, double t) {
return (x * (t + (2.0 * z))) + (y * (5.0 + (x * 2.0)));
}
def code(x, y, z, t): return (x * (t + (2.0 * z))) + (y * (5.0 + (x * 2.0)))
function code(x, y, z, t) return Float64(Float64(x * Float64(t + Float64(2.0 * z))) + Float64(y * Float64(5.0 + Float64(x * 2.0)))) end
function tmp = code(x, y, z, t) tmp = (x * (t + (2.0 * z))) + (y * (5.0 + (x * 2.0))); end
code[x_, y_, z_, t_] := N[(N[(x * N[(t + N[(2.0 * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(y * N[(5.0 + N[(x * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x \cdot \left(t + 2 \cdot z\right) + y \cdot \left(5 + x \cdot 2\right)
\end{array}
Initial program 99.9%
Taylor expanded in y around 0 96.8%
Final simplification96.8%
(FPCore (x y z t) :precision binary64 (+ (* x (+ t (+ y (+ z (+ y z))))) (* y 5.0)))
double code(double x, double y, double z, double t) {
return (x * (t + (y + (z + (y + z))))) + (y * 5.0);
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = (x * (t + (y + (z + (y + z))))) + (y * 5.0d0)
end function
public static double code(double x, double y, double z, double t) {
return (x * (t + (y + (z + (y + z))))) + (y * 5.0);
}
def code(x, y, z, t): return (x * (t + (y + (z + (y + z))))) + (y * 5.0)
function code(x, y, z, t) return Float64(Float64(x * Float64(t + Float64(y + Float64(z + Float64(y + z))))) + Float64(y * 5.0)) end
function tmp = code(x, y, z, t) tmp = (x * (t + (y + (z + (y + z))))) + (y * 5.0); end
code[x_, y_, z_, t_] := N[(N[(x * N[(t + N[(y + N[(z + N[(y + z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(y * 5.0), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x \cdot \left(t + \left(y + \left(z + \left(y + z\right)\right)\right)\right) + y \cdot 5
\end{array}
Initial program 99.9%
Final simplification99.9%
(FPCore (x y z t) :precision binary64 (if (or (<= x -4.6e-87) (not (<= x 1.9e-93))) (* x t) (* y 5.0)))
double code(double x, double y, double z, double t) {
double tmp;
if ((x <= -4.6e-87) || !(x <= 1.9e-93)) {
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 <= (-4.6d-87)) .or. (.not. (x <= 1.9d-93))) 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 <= -4.6e-87) || !(x <= 1.9e-93)) {
tmp = x * t;
} else {
tmp = y * 5.0;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (x <= -4.6e-87) or not (x <= 1.9e-93): tmp = x * t else: tmp = y * 5.0 return tmp
function code(x, y, z, t) tmp = 0.0 if ((x <= -4.6e-87) || !(x <= 1.9e-93)) 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 <= -4.6e-87) || ~((x <= 1.9e-93))) tmp = x * t; else tmp = y * 5.0; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[x, -4.6e-87], N[Not[LessEqual[x, 1.9e-93]], $MachinePrecision]], N[(x * t), $MachinePrecision], N[(y * 5.0), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -4.6 \cdot 10^{-87} \lor \neg \left(x \leq 1.9 \cdot 10^{-93}\right):\\
\;\;\;\;x \cdot t\\
\mathbf{else}:\\
\;\;\;\;y \cdot 5\\
\end{array}
\end{array}
if x < -4.6000000000000003e-87 or 1.8999999999999999e-93 < x Initial program 100.0%
Taylor expanded in t around inf 43.5%
Simplified43.5%
if -4.6000000000000003e-87 < x < 1.8999999999999999e-93Initial program 99.9%
Taylor expanded in x around 0 63.8%
Final simplification51.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 99.9%
Taylor expanded in x around 0 27.7%
Final simplification27.7%
herbie shell --seed 2024082
(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)))