
(FPCore (x y z t) :precision binary64 (+ (* x (+ (+ (+ (+ y z) z) y) t)) (* y 5.0)))
double code(double x, double y, double z, double t) {
return (x * ((((y + z) + z) + y) + t)) + (y * 5.0);
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = (x * ((((y + z) + z) + y) + t)) + (y * 5.0d0)
end function
public static double code(double x, double y, double z, double t) {
return (x * ((((y + z) + z) + y) + t)) + (y * 5.0);
}
def code(x, y, z, t): return (x * ((((y + z) + z) + y) + t)) + (y * 5.0)
function code(x, y, z, t) return Float64(Float64(x * Float64(Float64(Float64(Float64(y + z) + z) + y) + t)) + Float64(y * 5.0)) end
function tmp = code(x, y, z, t) tmp = (x * ((((y + z) + z) + y) + t)) + (y * 5.0); end
code[x_, y_, z_, t_] := N[(N[(x * N[(N[(N[(N[(y + z), $MachinePrecision] + z), $MachinePrecision] + y), $MachinePrecision] + t), $MachinePrecision]), $MachinePrecision] + N[(y * 5.0), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x \cdot \left(\left(\left(\left(y + z\right) + z\right) + y\right) + t\right) + y \cdot 5
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 16 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t) :precision binary64 (+ (* x (+ (+ (+ (+ y z) z) y) t)) (* y 5.0)))
double code(double x, double y, double z, double t) {
return (x * ((((y + z) + z) + y) + t)) + (y * 5.0);
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = (x * ((((y + z) + z) + y) + t)) + (y * 5.0d0)
end function
public static double code(double x, double y, double z, double t) {
return (x * ((((y + z) + z) + y) + t)) + (y * 5.0);
}
def code(x, y, z, t): return (x * ((((y + z) + z) + y) + t)) + (y * 5.0)
function code(x, y, z, t) return Float64(Float64(x * Float64(Float64(Float64(Float64(y + z) + z) + y) + t)) + Float64(y * 5.0)) end
function tmp = code(x, y, z, t) tmp = (x * ((((y + z) + z) + y) + t)) + (y * 5.0); end
code[x_, y_, z_, t_] := N[(N[(x * N[(N[(N[(N[(y + z), $MachinePrecision] + z), $MachinePrecision] + y), $MachinePrecision] + t), $MachinePrecision]), $MachinePrecision] + N[(y * 5.0), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x \cdot \left(\left(\left(\left(y + z\right) + z\right) + y\right) + t\right) + y \cdot 5
\end{array}
(FPCore (x y z t) :precision binary64 (fma 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
(if (or (<= y -2e-26)
(and (not (<= y 5.6e-25)) (or (<= y 4.5e+20) (not (<= y 2.7e+90)))))
(* y (+ 5.0 (* x 2.0)))
(* x (+ t (* 2.0 z)))))
double code(double x, double y, double z, double t) {
double tmp;
if ((y <= -2e-26) || (!(y <= 5.6e-25) && ((y <= 4.5e+20) || !(y <= 2.7e+90)))) {
tmp = y * (5.0 + (x * 2.0));
} 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) :: tmp
if ((y <= (-2d-26)) .or. (.not. (y <= 5.6d-25)) .and. (y <= 4.5d+20) .or. (.not. (y <= 2.7d+90))) then
tmp = y * (5.0d0 + (x * 2.0d0))
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 tmp;
if ((y <= -2e-26) || (!(y <= 5.6e-25) && ((y <= 4.5e+20) || !(y <= 2.7e+90)))) {
tmp = y * (5.0 + (x * 2.0));
} else {
tmp = x * (t + (2.0 * z));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (y <= -2e-26) or (not (y <= 5.6e-25) and ((y <= 4.5e+20) or not (y <= 2.7e+90))): tmp = y * (5.0 + (x * 2.0)) else: tmp = x * (t + (2.0 * z)) return tmp
function code(x, y, z, t) tmp = 0.0 if ((y <= -2e-26) || (!(y <= 5.6e-25) && ((y <= 4.5e+20) || !(y <= 2.7e+90)))) tmp = Float64(y * Float64(5.0 + Float64(x * 2.0))); else tmp = Float64(x * Float64(t + Float64(2.0 * z))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((y <= -2e-26) || (~((y <= 5.6e-25)) && ((y <= 4.5e+20) || ~((y <= 2.7e+90))))) tmp = y * (5.0 + (x * 2.0)); else tmp = x * (t + (2.0 * z)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[y, -2e-26], And[N[Not[LessEqual[y, 5.6e-25]], $MachinePrecision], Or[LessEqual[y, 4.5e+20], N[Not[LessEqual[y, 2.7e+90]], $MachinePrecision]]]], N[(y * N[(5.0 + N[(x * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x * N[(t + N[(2.0 * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -2 \cdot 10^{-26} \lor \neg \left(y \leq 5.6 \cdot 10^{-25}\right) \land \left(y \leq 4.5 \cdot 10^{+20} \lor \neg \left(y \leq 2.7 \cdot 10^{+90}\right)\right):\\
\;\;\;\;y \cdot \left(5 + x \cdot 2\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(t + 2 \cdot z\right)\\
\end{array}
\end{array}
if y < -2.0000000000000001e-26 or 5.59999999999999976e-25 < y < 4.5e20 or 2.7e90 < y Initial program 99.9%
Taylor expanded in y around inf 84.1%
Simplified84.1%
if -2.0000000000000001e-26 < y < 5.59999999999999976e-25 or 4.5e20 < y < 2.7e90Initial program 100.0%
Taylor expanded in y around 0 86.5%
Final simplification85.3%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* x (+ t (* 2.0 z)))) (t_2 (* x (* 2.0 (+ y z)))))
(if (<= x -5500000000.0)
t_2
(if (<= x -2.3e-133)
t_1
(if (<= x 2.2e-67) (* y 5.0) (if (<= x 1.7e+173) 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 * (2.0 * (y + z));
double tmp;
if (x <= -5500000000.0) {
tmp = t_2;
} else if (x <= -2.3e-133) {
tmp = t_1;
} else if (x <= 2.2e-67) {
tmp = y * 5.0;
} else if (x <= 1.7e+173) {
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 * (2.0d0 * (y + z))
if (x <= (-5500000000.0d0)) then
tmp = t_2
else if (x <= (-2.3d-133)) then
tmp = t_1
else if (x <= 2.2d-67) then
tmp = y * 5.0d0
else if (x <= 1.7d+173) 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 * (2.0 * (y + z));
double tmp;
if (x <= -5500000000.0) {
tmp = t_2;
} else if (x <= -2.3e-133) {
tmp = t_1;
} else if (x <= 2.2e-67) {
tmp = y * 5.0;
} else if (x <= 1.7e+173) {
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 * (2.0 * (y + z)) tmp = 0 if x <= -5500000000.0: tmp = t_2 elif x <= -2.3e-133: tmp = t_1 elif x <= 2.2e-67: tmp = y * 5.0 elif x <= 1.7e+173: 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(2.0 * Float64(y + z))) tmp = 0.0 if (x <= -5500000000.0) tmp = t_2; elseif (x <= -2.3e-133) tmp = t_1; elseif (x <= 2.2e-67) tmp = Float64(y * 5.0); elseif (x <= 1.7e+173) 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 * (2.0 * (y + z)); tmp = 0.0; if (x <= -5500000000.0) tmp = t_2; elseif (x <= -2.3e-133) tmp = t_1; elseif (x <= 2.2e-67) tmp = y * 5.0; elseif (x <= 1.7e+173) 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[(2.0 * N[(y + z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -5500000000.0], t$95$2, If[LessEqual[x, -2.3e-133], t$95$1, If[LessEqual[x, 2.2e-67], N[(y * 5.0), $MachinePrecision], If[LessEqual[x, 1.7e+173], 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(2 \cdot \left(y + z\right)\right)\\
\mathbf{if}\;x \leq -5500000000:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;x \leq -2.3 \cdot 10^{-133}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \leq 2.2 \cdot 10^{-67}:\\
\;\;\;\;y \cdot 5\\
\mathbf{elif}\;x \leq 1.7 \cdot 10^{+173}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if x < -5.5e9 or 1.70000000000000011e173 < x Initial program 100.0%
Taylor expanded in t around 0 82.8%
Simplified82.8%
Taylor expanded in x around inf 82.6%
associate-*r*82.6%
*-commutative82.6%
associate-*r*82.6%
Simplified82.6%
if -5.5e9 < x < -2.3e-133 or 2.2000000000000001e-67 < x < 1.70000000000000011e173Initial program 100.0%
Taylor expanded in y around 0 73.2%
if -2.3e-133 < x < 2.2000000000000001e-67Initial program 99.8%
Taylor expanded in x around 0 67.5%
Final simplification74.8%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* y (+ 5.0 (* x 2.0)))))
(if (<= y -2.3e-26)
t_1
(if (<= y 2.1e+15)
(* x (+ (* 2.0 (+ y z)) t))
(if (<= y 2.8e+77)
(* t (+ x (* y (/ 5.0 t))))
(if (<= y 2.8e+90) (* 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 <= -2.3e-26) {
tmp = t_1;
} else if (y <= 2.1e+15) {
tmp = x * ((2.0 * (y + z)) + t);
} else if (y <= 2.8e+77) {
tmp = t * (x + (y * (5.0 / t)));
} else if (y <= 2.8e+90) {
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 <= (-2.3d-26)) then
tmp = t_1
else if (y <= 2.1d+15) then
tmp = x * ((2.0d0 * (y + z)) + t)
else if (y <= 2.8d+77) then
tmp = t * (x + (y * (5.0d0 / t)))
else if (y <= 2.8d+90) 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 <= -2.3e-26) {
tmp = t_1;
} else if (y <= 2.1e+15) {
tmp = x * ((2.0 * (y + z)) + t);
} else if (y <= 2.8e+77) {
tmp = t * (x + (y * (5.0 / t)));
} else if (y <= 2.8e+90) {
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 <= -2.3e-26: tmp = t_1 elif y <= 2.1e+15: tmp = x * ((2.0 * (y + z)) + t) elif y <= 2.8e+77: tmp = t * (x + (y * (5.0 / t))) elif y <= 2.8e+90: 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 <= -2.3e-26) tmp = t_1; elseif (y <= 2.1e+15) tmp = Float64(x * Float64(Float64(2.0 * Float64(y + z)) + t)); elseif (y <= 2.8e+77) tmp = Float64(t * Float64(x + Float64(y * Float64(5.0 / t)))); elseif (y <= 2.8e+90) 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 <= -2.3e-26) tmp = t_1; elseif (y <= 2.1e+15) tmp = x * ((2.0 * (y + z)) + t); elseif (y <= 2.8e+77) tmp = t * (x + (y * (5.0 / t))); elseif (y <= 2.8e+90) 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, -2.3e-26], t$95$1, If[LessEqual[y, 2.1e+15], N[(x * N[(N[(2.0 * N[(y + z), $MachinePrecision]), $MachinePrecision] + t), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 2.8e+77], N[(t * N[(x + N[(y * N[(5.0 / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 2.8e+90], 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 -2.3 \cdot 10^{-26}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq 2.1 \cdot 10^{+15}:\\
\;\;\;\;x \cdot \left(2 \cdot \left(y + z\right) + t\right)\\
\mathbf{elif}\;y \leq 2.8 \cdot 10^{+77}:\\
\;\;\;\;t \cdot \left(x + y \cdot \frac{5}{t}\right)\\
\mathbf{elif}\;y \leq 2.8 \cdot 10^{+90}:\\
\;\;\;\;x \cdot \left(t + 2 \cdot z\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y < -2.30000000000000009e-26 or 2.8e90 < y Initial program 99.9%
Taylor expanded in y around inf 85.5%
Simplified85.5%
if -2.30000000000000009e-26 < y < 2.1e15Initial program 100.0%
fma-define100.0%
associate-+l+100.0%
+-commutative100.0%
count-2100.0%
Simplified100.0%
Taylor expanded in x around inf 89.5%
if 2.1e15 < y < 2.8e77Initial program 99.9%
fma-define100.0%
associate-+l+100.0%
+-commutative100.0%
count-2100.0%
Simplified100.0%
Taylor expanded in t around inf 82.6%
Taylor expanded in x around 0 82.6%
associate-*r/82.9%
*-commutative82.9%
associate-/l*82.8%
Simplified82.8%
if 2.8e77 < y < 2.8e90Initial program 100.0%
Taylor expanded in y around 0 100.0%
Final simplification87.5%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* z (* x 2.0))))
(if (<= x -1.02e+48)
(* y (* x 2.0))
(if (<= x -1.75e-125)
t_1
(if (<= x 3.4e-56) (* y 5.0) (if (<= x 1.08e+204) (* x t) t_1))))))
double code(double x, double y, double z, double t) {
double t_1 = z * (x * 2.0);
double tmp;
if (x <= -1.02e+48) {
tmp = y * (x * 2.0);
} else if (x <= -1.75e-125) {
tmp = t_1;
} else if (x <= 3.4e-56) {
tmp = y * 5.0;
} else if (x <= 1.08e+204) {
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 (x <= (-1.02d+48)) then
tmp = y * (x * 2.0d0)
else if (x <= (-1.75d-125)) then
tmp = t_1
else if (x <= 3.4d-56) then
tmp = y * 5.0d0
else if (x <= 1.08d+204) 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 (x <= -1.02e+48) {
tmp = y * (x * 2.0);
} else if (x <= -1.75e-125) {
tmp = t_1;
} else if (x <= 3.4e-56) {
tmp = y * 5.0;
} else if (x <= 1.08e+204) {
tmp = x * t;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = z * (x * 2.0) tmp = 0 if x <= -1.02e+48: tmp = y * (x * 2.0) elif x <= -1.75e-125: tmp = t_1 elif x <= 3.4e-56: tmp = y * 5.0 elif x <= 1.08e+204: 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 (x <= -1.02e+48) tmp = Float64(y * Float64(x * 2.0)); elseif (x <= -1.75e-125) tmp = t_1; elseif (x <= 3.4e-56) tmp = Float64(y * 5.0); elseif (x <= 1.08e+204) 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 (x <= -1.02e+48) tmp = y * (x * 2.0); elseif (x <= -1.75e-125) tmp = t_1; elseif (x <= 3.4e-56) tmp = y * 5.0; elseif (x <= 1.08e+204) 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[x, -1.02e+48], N[(y * N[(x * 2.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, -1.75e-125], t$95$1, If[LessEqual[x, 3.4e-56], N[(y * 5.0), $MachinePrecision], If[LessEqual[x, 1.08e+204], N[(x * t), $MachinePrecision], t$95$1]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := z \cdot \left(x \cdot 2\right)\\
\mathbf{if}\;x \leq -1.02 \cdot 10^{+48}:\\
\;\;\;\;y \cdot \left(x \cdot 2\right)\\
\mathbf{elif}\;x \leq -1.75 \cdot 10^{-125}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \leq 3.4 \cdot 10^{-56}:\\
\;\;\;\;y \cdot 5\\
\mathbf{elif}\;x \leq 1.08 \cdot 10^{+204}:\\
\;\;\;\;x \cdot t\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if x < -1.02e48Initial 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%
Taylor expanded in z around 0 74.3%
Taylor expanded in t around 0 54.2%
*-commutative54.2%
associate-*l*54.2%
*-commutative54.2%
associate-*r*54.2%
Simplified54.2%
if -1.02e48 < x < -1.74999999999999999e-125 or 1.08e204 < x Initial program 100.0%
Taylor expanded in z around inf 55.9%
Simplified55.9%
if -1.74999999999999999e-125 < x < 3.39999999999999982e-56Initial program 99.8%
Taylor expanded in x around 0 67.5%
if 3.39999999999999982e-56 < x < 1.08e204Initial program 99.9%
Taylor expanded in t around inf 39.8%
Simplified39.8%
Final simplification56.2%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* 2.0 (+ y z))))
(if (<= y -1.05e+83)
(+ (* x t_1) (* y 5.0))
(if (<= y 1.05e+87)
(* x (+ t (+ t_1 (* 5.0 (/ y x)))))
(+ (* x (+ t (+ y y))) (* y 5.0))))))
double code(double x, double y, double z, double t) {
double t_1 = 2.0 * (y + z);
double tmp;
if (y <= -1.05e+83) {
tmp = (x * t_1) + (y * 5.0);
} else if (y <= 1.05e+87) {
tmp = x * (t + (t_1 + (5.0 * (y / x))));
} else {
tmp = (x * (t + (y + y))) + (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) :: t_1
real(8) :: tmp
t_1 = 2.0d0 * (y + z)
if (y <= (-1.05d+83)) then
tmp = (x * t_1) + (y * 5.0d0)
else if (y <= 1.05d+87) then
tmp = x * (t + (t_1 + (5.0d0 * (y / x))))
else
tmp = (x * (t + (y + y))) + (y * 5.0d0)
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 (y <= -1.05e+83) {
tmp = (x * t_1) + (y * 5.0);
} else if (y <= 1.05e+87) {
tmp = x * (t + (t_1 + (5.0 * (y / x))));
} else {
tmp = (x * (t + (y + y))) + (y * 5.0);
}
return tmp;
}
def code(x, y, z, t): t_1 = 2.0 * (y + z) tmp = 0 if y <= -1.05e+83: tmp = (x * t_1) + (y * 5.0) elif y <= 1.05e+87: tmp = x * (t + (t_1 + (5.0 * (y / x)))) else: tmp = (x * (t + (y + y))) + (y * 5.0) return tmp
function code(x, y, z, t) t_1 = Float64(2.0 * Float64(y + z)) tmp = 0.0 if (y <= -1.05e+83) tmp = Float64(Float64(x * t_1) + Float64(y * 5.0)); elseif (y <= 1.05e+87) tmp = Float64(x * Float64(t + Float64(t_1 + Float64(5.0 * Float64(y / x))))); else tmp = Float64(Float64(x * Float64(t + Float64(y + y))) + Float64(y * 5.0)); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = 2.0 * (y + z); tmp = 0.0; if (y <= -1.05e+83) tmp = (x * t_1) + (y * 5.0); elseif (y <= 1.05e+87) tmp = x * (t + (t_1 + (5.0 * (y / x)))); else tmp = (x * (t + (y + y))) + (y * 5.0); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(2.0 * N[(y + z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -1.05e+83], N[(N[(x * t$95$1), $MachinePrecision] + N[(y * 5.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.05e+87], N[(x * N[(t + N[(t$95$1 + N[(5.0 * N[(y / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x * N[(t + N[(y + y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(y * 5.0), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := 2 \cdot \left(y + z\right)\\
\mathbf{if}\;y \leq -1.05 \cdot 10^{+83}:\\
\;\;\;\;x \cdot t\_1 + y \cdot 5\\
\mathbf{elif}\;y \leq 1.05 \cdot 10^{+87}:\\
\;\;\;\;x \cdot \left(t + \left(t\_1 + 5 \cdot \frac{y}{x}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(t + \left(y + y\right)\right) + y \cdot 5\\
\end{array}
\end{array}
if y < -1.05000000000000001e83Initial program 99.9%
Taylor expanded in t around 0 95.9%
Simplified95.9%
if -1.05000000000000001e83 < y < 1.05e87Initial program 99.9%
fma-define100.0%
associate-+l+100.0%
+-commutative100.0%
count-2100.0%
Simplified100.0%
Taylor expanded in x around inf 99.3%
if 1.05e87 < y Initial program 99.9%
Taylor expanded in y around inf 97.6%
Final simplification98.4%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* y (+ 5.0 (* x 2.0)))))
(if (<= y -2.3e-26)
t_1
(if (<= y 1.1e-25)
(* x (+ t (* 2.0 z)))
(if (<= y 8.2e+93) (* t (+ x (* y (/ 5.0 t)))) 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 <= -2.3e-26) {
tmp = t_1;
} else if (y <= 1.1e-25) {
tmp = x * (t + (2.0 * z));
} else if (y <= 8.2e+93) {
tmp = t * (x + (y * (5.0 / 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 * (5.0d0 + (x * 2.0d0))
if (y <= (-2.3d-26)) then
tmp = t_1
else if (y <= 1.1d-25) then
tmp = x * (t + (2.0d0 * z))
else if (y <= 8.2d+93) then
tmp = t * (x + (y * (5.0d0 / 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 * 2.0));
double tmp;
if (y <= -2.3e-26) {
tmp = t_1;
} else if (y <= 1.1e-25) {
tmp = x * (t + (2.0 * z));
} else if (y <= 8.2e+93) {
tmp = t * (x + (y * (5.0 / t)));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = y * (5.0 + (x * 2.0)) tmp = 0 if y <= -2.3e-26: tmp = t_1 elif y <= 1.1e-25: tmp = x * (t + (2.0 * z)) elif y <= 8.2e+93: tmp = t * (x + (y * (5.0 / t))) 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 <= -2.3e-26) tmp = t_1; elseif (y <= 1.1e-25) tmp = Float64(x * Float64(t + Float64(2.0 * z))); elseif (y <= 8.2e+93) tmp = Float64(t * Float64(x + Float64(y * Float64(5.0 / t)))); 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 <= -2.3e-26) tmp = t_1; elseif (y <= 1.1e-25) tmp = x * (t + (2.0 * z)); elseif (y <= 8.2e+93) tmp = t * (x + (y * (5.0 / t))); 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, -2.3e-26], t$95$1, If[LessEqual[y, 1.1e-25], N[(x * N[(t + N[(2.0 * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 8.2e+93], N[(t * N[(x + N[(y * N[(5.0 / t), $MachinePrecision]), $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 -2.3 \cdot 10^{-26}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq 1.1 \cdot 10^{-25}:\\
\;\;\;\;x \cdot \left(t + 2 \cdot z\right)\\
\mathbf{elif}\;y \leq 8.2 \cdot 10^{+93}:\\
\;\;\;\;t \cdot \left(x + y \cdot \frac{5}{t}\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y < -2.30000000000000009e-26 or 8.2000000000000002e93 < y Initial program 99.9%
Taylor expanded in y around inf 85.5%
Simplified85.5%
if -2.30000000000000009e-26 < y < 1.1000000000000001e-25Initial program 100.0%
Taylor expanded in y around 0 89.8%
if 1.1000000000000001e-25 < y < 8.2000000000000002e93Initial program 99.9%
fma-define100.0%
associate-+l+100.0%
+-commutative100.0%
count-2100.0%
Simplified100.0%
Taylor expanded in t around inf 78.4%
Taylor expanded in x around 0 70.0%
associate-*r/70.3%
*-commutative70.3%
associate-/l*70.2%
Simplified70.2%
Final simplification85.4%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* 2.0 (+ y z))))
(if (<= t -5.4e+103)
(* x (+ t_1 t))
(if (<= t 4.5e+167)
(+ (* x t_1) (* y 5.0))
(* t (+ x (* y (/ 5.0 t))))))))
double code(double x, double y, double z, double t) {
double t_1 = 2.0 * (y + z);
double tmp;
if (t <= -5.4e+103) {
tmp = x * (t_1 + t);
} else if (t <= 4.5e+167) {
tmp = (x * t_1) + (y * 5.0);
} else {
tmp = t * (x + (y * (5.0 / 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 * (y + z)
if (t <= (-5.4d+103)) then
tmp = x * (t_1 + t)
else if (t <= 4.5d+167) then
tmp = (x * t_1) + (y * 5.0d0)
else
tmp = t * (x + (y * (5.0d0 / t)))
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 (t <= -5.4e+103) {
tmp = x * (t_1 + t);
} else if (t <= 4.5e+167) {
tmp = (x * t_1) + (y * 5.0);
} else {
tmp = t * (x + (y * (5.0 / t)));
}
return tmp;
}
def code(x, y, z, t): t_1 = 2.0 * (y + z) tmp = 0 if t <= -5.4e+103: tmp = x * (t_1 + t) elif t <= 4.5e+167: tmp = (x * t_1) + (y * 5.0) else: tmp = t * (x + (y * (5.0 / t))) return tmp
function code(x, y, z, t) t_1 = Float64(2.0 * Float64(y + z)) tmp = 0.0 if (t <= -5.4e+103) tmp = Float64(x * Float64(t_1 + t)); elseif (t <= 4.5e+167) tmp = Float64(Float64(x * t_1) + Float64(y * 5.0)); else tmp = Float64(t * Float64(x + Float64(y * Float64(5.0 / t)))); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = 2.0 * (y + z); tmp = 0.0; if (t <= -5.4e+103) tmp = x * (t_1 + t); elseif (t <= 4.5e+167) tmp = (x * t_1) + (y * 5.0); else tmp = t * (x + (y * (5.0 / t))); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(2.0 * N[(y + z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -5.4e+103], N[(x * N[(t$95$1 + t), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 4.5e+167], N[(N[(x * t$95$1), $MachinePrecision] + N[(y * 5.0), $MachinePrecision]), $MachinePrecision], N[(t * N[(x + N[(y * N[(5.0 / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := 2 \cdot \left(y + z\right)\\
\mathbf{if}\;t \leq -5.4 \cdot 10^{+103}:\\
\;\;\;\;x \cdot \left(t\_1 + t\right)\\
\mathbf{elif}\;t \leq 4.5 \cdot 10^{+167}:\\
\;\;\;\;x \cdot t\_1 + y \cdot 5\\
\mathbf{else}:\\
\;\;\;\;t \cdot \left(x + y \cdot \frac{5}{t}\right)\\
\end{array}
\end{array}
if t < -5.39999999999999985e103Initial program 100.0%
fma-define100.0%
associate-+l+100.0%
+-commutative100.0%
count-2100.0%
Simplified100.0%
Taylor expanded in x around inf 92.6%
if -5.39999999999999985e103 < t < 4.4999999999999999e167Initial program 99.9%
Taylor expanded in t around 0 93.6%
Simplified93.6%
if 4.4999999999999999e167 < t Initial program 99.9%
fma-define99.9%
associate-+l+99.9%
+-commutative99.9%
count-299.9%
Simplified99.9%
Taylor expanded in t around inf 95.6%
Taylor expanded in x around 0 92.0%
associate-*r/91.9%
*-commutative91.9%
associate-/l*92.0%
Simplified92.0%
Final simplification93.3%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* 2.0 (+ y z))))
(if (<= t -2.15e+104)
(* x (+ t_1 t))
(if (<= t 2.6e+137)
(+ (* x t_1) (* y 5.0))
(+ (* x (+ t (+ y y))) (* y 5.0))))))
double code(double x, double y, double z, double t) {
double t_1 = 2.0 * (y + z);
double tmp;
if (t <= -2.15e+104) {
tmp = x * (t_1 + t);
} else if (t <= 2.6e+137) {
tmp = (x * t_1) + (y * 5.0);
} else {
tmp = (x * (t + (y + y))) + (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) :: t_1
real(8) :: tmp
t_1 = 2.0d0 * (y + z)
if (t <= (-2.15d+104)) then
tmp = x * (t_1 + t)
else if (t <= 2.6d+137) then
tmp = (x * t_1) + (y * 5.0d0)
else
tmp = (x * (t + (y + y))) + (y * 5.0d0)
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 (t <= -2.15e+104) {
tmp = x * (t_1 + t);
} else if (t <= 2.6e+137) {
tmp = (x * t_1) + (y * 5.0);
} else {
tmp = (x * (t + (y + y))) + (y * 5.0);
}
return tmp;
}
def code(x, y, z, t): t_1 = 2.0 * (y + z) tmp = 0 if t <= -2.15e+104: tmp = x * (t_1 + t) elif t <= 2.6e+137: tmp = (x * t_1) + (y * 5.0) else: tmp = (x * (t + (y + y))) + (y * 5.0) return tmp
function code(x, y, z, t) t_1 = Float64(2.0 * Float64(y + z)) tmp = 0.0 if (t <= -2.15e+104) tmp = Float64(x * Float64(t_1 + t)); elseif (t <= 2.6e+137) tmp = Float64(Float64(x * t_1) + Float64(y * 5.0)); else tmp = Float64(Float64(x * Float64(t + Float64(y + y))) + Float64(y * 5.0)); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = 2.0 * (y + z); tmp = 0.0; if (t <= -2.15e+104) tmp = x * (t_1 + t); elseif (t <= 2.6e+137) tmp = (x * t_1) + (y * 5.0); else tmp = (x * (t + (y + y))) + (y * 5.0); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(2.0 * N[(y + z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -2.15e+104], N[(x * N[(t$95$1 + t), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 2.6e+137], N[(N[(x * t$95$1), $MachinePrecision] + N[(y * 5.0), $MachinePrecision]), $MachinePrecision], N[(N[(x * N[(t + N[(y + y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(y * 5.0), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := 2 \cdot \left(y + z\right)\\
\mathbf{if}\;t \leq -2.15 \cdot 10^{+104}:\\
\;\;\;\;x \cdot \left(t\_1 + t\right)\\
\mathbf{elif}\;t \leq 2.6 \cdot 10^{+137}:\\
\;\;\;\;x \cdot t\_1 + y \cdot 5\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(t + \left(y + y\right)\right) + y \cdot 5\\
\end{array}
\end{array}
if t < -2.1500000000000001e104Initial program 100.0%
fma-define100.0%
associate-+l+100.0%
+-commutative100.0%
count-2100.0%
Simplified100.0%
Taylor expanded in x around inf 92.6%
if -2.1500000000000001e104 < t < 2.5999999999999999e137Initial program 99.9%
Taylor expanded in t around 0 94.2%
Simplified94.2%
if 2.5999999999999999e137 < t Initial program 99.9%
Taylor expanded in y around inf 93.2%
Final simplification93.9%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* y (* x 2.0))))
(if (<= x -16000000.0)
t_1
(if (<= x 2.9e-55) (* y 5.0) (if (<= x 6.2e+155) (* 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 <= -16000000.0) {
tmp = t_1;
} else if (x <= 2.9e-55) {
tmp = y * 5.0;
} else if (x <= 6.2e+155) {
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 <= (-16000000.0d0)) then
tmp = t_1
else if (x <= 2.9d-55) then
tmp = y * 5.0d0
else if (x <= 6.2d+155) 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 <= -16000000.0) {
tmp = t_1;
} else if (x <= 2.9e-55) {
tmp = y * 5.0;
} else if (x <= 6.2e+155) {
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 <= -16000000.0: tmp = t_1 elif x <= 2.9e-55: tmp = y * 5.0 elif x <= 6.2e+155: 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 <= -16000000.0) tmp = t_1; elseif (x <= 2.9e-55) tmp = Float64(y * 5.0); elseif (x <= 6.2e+155) 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 <= -16000000.0) tmp = t_1; elseif (x <= 2.9e-55) tmp = y * 5.0; elseif (x <= 6.2e+155) 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, -16000000.0], t$95$1, If[LessEqual[x, 2.9e-55], N[(y * 5.0), $MachinePrecision], If[LessEqual[x, 6.2e+155], 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 -16000000:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \leq 2.9 \cdot 10^{-55}:\\
\;\;\;\;y \cdot 5\\
\mathbf{elif}\;x \leq 6.2 \cdot 10^{+155}:\\
\;\;\;\;x \cdot t\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if x < -1.6e7 or 6.19999999999999978e155 < 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%
Taylor expanded in z around 0 67.8%
Taylor expanded in t around 0 48.4%
*-commutative48.4%
associate-*l*48.4%
*-commutative48.4%
associate-*r*48.4%
Simplified48.4%
if -1.6e7 < x < 2.9e-55Initial program 99.9%
Taylor expanded in x around 0 55.2%
if 2.9e-55 < x < 6.19999999999999978e155Initial program 100.0%
Taylor expanded in t around inf 40.5%
Simplified40.5%
Final simplification50.3%
(FPCore (x y z t) :precision binary64 (if (<= x -1e+160) (* x (+ (* 2.0 (+ y z)) t)) (+ (* x (+ t (* 2.0 z))) (* y (+ 5.0 (* x 2.0))))))
double code(double x, double y, double z, double t) {
double tmp;
if (x <= -1e+160) {
tmp = x * ((2.0 * (y + z)) + t);
} else {
tmp = (x * (t + (2.0 * z))) + (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 <= (-1d+160)) then
tmp = x * ((2.0d0 * (y + z)) + t)
else
tmp = (x * (t + (2.0d0 * z))) + (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 <= -1e+160) {
tmp = x * ((2.0 * (y + z)) + t);
} else {
tmp = (x * (t + (2.0 * z))) + (y * (5.0 + (x * 2.0)));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if x <= -1e+160: tmp = x * ((2.0 * (y + z)) + t) else: tmp = (x * (t + (2.0 * z))) + (y * (5.0 + (x * 2.0))) return tmp
function code(x, y, z, t) tmp = 0.0 if (x <= -1e+160) tmp = Float64(x * Float64(Float64(2.0 * Float64(y + z)) + t)); else tmp = Float64(Float64(x * Float64(t + Float64(2.0 * z))) + 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 <= -1e+160) tmp = x * ((2.0 * (y + z)) + t); else tmp = (x * (t + (2.0 * z))) + (y * (5.0 + (x * 2.0))); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[x, -1e+160], 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 * N[(5.0 + N[(x * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1 \cdot 10^{+160}:\\
\;\;\;\;x \cdot \left(2 \cdot \left(y + z\right) + t\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(t + 2 \cdot z\right) + y \cdot \left(5 + x \cdot 2\right)\\
\end{array}
\end{array}
if x < -1.00000000000000001e160Initial 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 -1.00000000000000001e160 < x Initial program 99.9%
Taylor expanded in y around 0 98.6%
Final simplification98.8%
(FPCore (x y z t) :precision binary64 (if (or (<= x -1.6e-125) (not (<= x 3.3e-9))) (* x (+ (* 2.0 (+ y z)) t)) (* y (+ 5.0 (/ (* x t) y)))))
double code(double x, double y, double z, double t) {
double tmp;
if ((x <= -1.6e-125) || !(x <= 3.3e-9)) {
tmp = x * ((2.0 * (y + z)) + t);
} else {
tmp = y * (5.0 + ((x * t) / y));
}
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.6d-125)) .or. (.not. (x <= 3.3d-9))) then
tmp = x * ((2.0d0 * (y + z)) + t)
else
tmp = y * (5.0d0 + ((x * t) / y))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((x <= -1.6e-125) || !(x <= 3.3e-9)) {
tmp = x * ((2.0 * (y + z)) + t);
} else {
tmp = y * (5.0 + ((x * t) / y));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (x <= -1.6e-125) or not (x <= 3.3e-9): tmp = x * ((2.0 * (y + z)) + t) else: tmp = y * (5.0 + ((x * t) / y)) return tmp
function code(x, y, z, t) tmp = 0.0 if ((x <= -1.6e-125) || !(x <= 3.3e-9)) tmp = Float64(x * Float64(Float64(2.0 * Float64(y + z)) + t)); else tmp = Float64(y * Float64(5.0 + Float64(Float64(x * t) / y))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((x <= -1.6e-125) || ~((x <= 3.3e-9))) tmp = x * ((2.0 * (y + z)) + t); else tmp = y * (5.0 + ((x * t) / y)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[x, -1.6e-125], N[Not[LessEqual[x, 3.3e-9]], $MachinePrecision]], N[(x * N[(N[(2.0 * N[(y + z), $MachinePrecision]), $MachinePrecision] + t), $MachinePrecision]), $MachinePrecision], N[(y * N[(5.0 + N[(N[(x * t), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.6 \cdot 10^{-125} \lor \neg \left(x \leq 3.3 \cdot 10^{-9}\right):\\
\;\;\;\;x \cdot \left(2 \cdot \left(y + z\right) + t\right)\\
\mathbf{else}:\\
\;\;\;\;y \cdot \left(5 + \frac{x \cdot t}{y}\right)\\
\end{array}
\end{array}
if x < -1.5999999999999999e-125 or 3.30000000000000018e-9 < 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 93.3%
if -1.5999999999999999e-125 < x < 3.30000000000000018e-9Initial program 99.8%
Taylor expanded in y around inf 96.5%
Taylor expanded in z around 0 77.3%
Taylor expanded in t around inf 76.9%
Final simplification87.7%
(FPCore (x y z t) :precision binary64 (if (or (<= x -2.7e-134) (not (<= x 5.3e-9))) (* x (* 2.0 (+ y z))) (* y 5.0)))
double code(double x, double y, double z, double t) {
double tmp;
if ((x <= -2.7e-134) || !(x <= 5.3e-9)) {
tmp = x * (2.0 * (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 <= (-2.7d-134)) .or. (.not. (x <= 5.3d-9))) then
tmp = x * (2.0d0 * (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 <= -2.7e-134) || !(x <= 5.3e-9)) {
tmp = x * (2.0 * (y + z));
} else {
tmp = y * 5.0;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (x <= -2.7e-134) or not (x <= 5.3e-9): tmp = x * (2.0 * (y + z)) else: tmp = y * 5.0 return tmp
function code(x, y, z, t) tmp = 0.0 if ((x <= -2.7e-134) || !(x <= 5.3e-9)) tmp = Float64(x * Float64(2.0 * 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 <= -2.7e-134) || ~((x <= 5.3e-9))) tmp = x * (2.0 * (y + z)); else tmp = y * 5.0; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[x, -2.7e-134], N[Not[LessEqual[x, 5.3e-9]], $MachinePrecision]], N[(x * N[(2.0 * N[(y + z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(y * 5.0), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -2.7 \cdot 10^{-134} \lor \neg \left(x \leq 5.3 \cdot 10^{-9}\right):\\
\;\;\;\;x \cdot \left(2 \cdot \left(y + z\right)\right)\\
\mathbf{else}:\\
\;\;\;\;y \cdot 5\\
\end{array}
\end{array}
if x < -2.6999999999999998e-134 or 5.30000000000000031e-9 < x Initial program 100.0%
Taylor expanded in t around 0 76.6%
Simplified76.6%
Taylor expanded in x around inf 70.0%
associate-*r*70.0%
*-commutative70.0%
associate-*r*70.0%
Simplified70.0%
if -2.6999999999999998e-134 < x < 5.30000000000000031e-9Initial program 99.8%
Taylor expanded in x around 0 66.8%
Final simplification68.9%
(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 -9.5e-121) (not (<= x 1.12e-54))) (* x t) (* y 5.0)))
double code(double x, double y, double z, double t) {
double tmp;
if ((x <= -9.5e-121) || !(x <= 1.12e-54)) {
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 <= (-9.5d-121)) .or. (.not. (x <= 1.12d-54))) 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 <= -9.5e-121) || !(x <= 1.12e-54)) {
tmp = x * t;
} else {
tmp = y * 5.0;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (x <= -9.5e-121) or not (x <= 1.12e-54): tmp = x * t else: tmp = y * 5.0 return tmp
function code(x, y, z, t) tmp = 0.0 if ((x <= -9.5e-121) || !(x <= 1.12e-54)) 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 <= -9.5e-121) || ~((x <= 1.12e-54))) tmp = x * t; else tmp = y * 5.0; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[x, -9.5e-121], N[Not[LessEqual[x, 1.12e-54]], $MachinePrecision]], N[(x * t), $MachinePrecision], N[(y * 5.0), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -9.5 \cdot 10^{-121} \lor \neg \left(x \leq 1.12 \cdot 10^{-54}\right):\\
\;\;\;\;x \cdot t\\
\mathbf{else}:\\
\;\;\;\;y \cdot 5\\
\end{array}
\end{array}
if x < -9.4999999999999994e-121 or 1.11999999999999994e-54 < x Initial program 100.0%
Taylor expanded in t around inf 30.3%
Simplified30.3%
if -9.4999999999999994e-121 < x < 1.11999999999999994e-54Initial program 99.8%
Taylor expanded in x around 0 66.8%
Final simplification42.5%
(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.2%
Final simplification27.2%
herbie shell --seed 2024066
(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)))