
(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 x (+ (+ y (+ z z)) (+ y t)) (* y 5.0)))
double code(double x, double y, double z, double t) {
return fma(x, ((y + (z + z)) + (y + t)), (y * 5.0));
}
function code(x, y, z, t) return fma(x, Float64(Float64(y + Float64(z + z)) + Float64(y + t)), Float64(y * 5.0)) end
code[x_, y_, z_, t_] := N[(x * N[(N[(y + N[(z + z), $MachinePrecision]), $MachinePrecision] + N[(y + t), $MachinePrecision]), $MachinePrecision] + N[(y * 5.0), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\mathsf{fma}\left(x, \left(y + \left(z + z\right)\right) + \left(y + t\right), y \cdot 5\right)
\end{array}
Initial program 99.9%
fma-define100.0%
associate-+l+100.0%
associate-+l+100.0%
Simplified100.0%
Final simplification100.0%
(FPCore (x y z t) :precision binary64 (fma x (+ t (* 2.0 (+ y z))) (* y 5.0)))
double code(double x, double y, double z, double t) {
return fma(x, (t + (2.0 * (y + z))), (y * 5.0));
}
function code(x, y, z, t) return fma(x, Float64(t + Float64(2.0 * Float64(y + z))), Float64(y * 5.0)) end
code[x_, y_, z_, t_] := N[(x * N[(t + N[(2.0 * N[(y + z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(y * 5.0), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\mathsf{fma}\left(x, t + 2 \cdot \left(y + z\right), y \cdot 5\right)
\end{array}
Initial program 99.9%
fma-define100.0%
associate-+l+99.9%
+-commutative99.9%
count-299.9%
Simplified99.9%
Final simplification99.9%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* x (+ t (* z 2.0)))))
(if (<= x -3.1e+15)
(* x (* 2.0 (+ y z)))
(if (<= x -1.45e-62)
t_1
(if (<= x 1.04e-181)
(* y 5.0)
(if (<= x 2.45e-147)
t_1
(if (<= x 3.4e-48)
(* y 5.0)
(if (or (<= x 5.8e+156) (not (<= x 1.8e+280)))
t_1
(* x (+ t (* y 2.0)))))))))))
double code(double x, double y, double z, double t) {
double t_1 = x * (t + (z * 2.0));
double tmp;
if (x <= -3.1e+15) {
tmp = x * (2.0 * (y + z));
} else if (x <= -1.45e-62) {
tmp = t_1;
} else if (x <= 1.04e-181) {
tmp = y * 5.0;
} else if (x <= 2.45e-147) {
tmp = t_1;
} else if (x <= 3.4e-48) {
tmp = y * 5.0;
} else if ((x <= 5.8e+156) || !(x <= 1.8e+280)) {
tmp = t_1;
} else {
tmp = x * (t + (y * 2.0));
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: tmp
t_1 = x * (t + (z * 2.0d0))
if (x <= (-3.1d+15)) then
tmp = x * (2.0d0 * (y + z))
else if (x <= (-1.45d-62)) then
tmp = t_1
else if (x <= 1.04d-181) then
tmp = y * 5.0d0
else if (x <= 2.45d-147) then
tmp = t_1
else if (x <= 3.4d-48) then
tmp = y * 5.0d0
else if ((x <= 5.8d+156) .or. (.not. (x <= 1.8d+280))) then
tmp = t_1
else
tmp = x * (t + (y * 2.0d0))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = x * (t + (z * 2.0));
double tmp;
if (x <= -3.1e+15) {
tmp = x * (2.0 * (y + z));
} else if (x <= -1.45e-62) {
tmp = t_1;
} else if (x <= 1.04e-181) {
tmp = y * 5.0;
} else if (x <= 2.45e-147) {
tmp = t_1;
} else if (x <= 3.4e-48) {
tmp = y * 5.0;
} else if ((x <= 5.8e+156) || !(x <= 1.8e+280)) {
tmp = t_1;
} else {
tmp = x * (t + (y * 2.0));
}
return tmp;
}
def code(x, y, z, t): t_1 = x * (t + (z * 2.0)) tmp = 0 if x <= -3.1e+15: tmp = x * (2.0 * (y + z)) elif x <= -1.45e-62: tmp = t_1 elif x <= 1.04e-181: tmp = y * 5.0 elif x <= 2.45e-147: tmp = t_1 elif x <= 3.4e-48: tmp = y * 5.0 elif (x <= 5.8e+156) or not (x <= 1.8e+280): tmp = t_1 else: tmp = x * (t + (y * 2.0)) return tmp
function code(x, y, z, t) t_1 = Float64(x * Float64(t + Float64(z * 2.0))) tmp = 0.0 if (x <= -3.1e+15) tmp = Float64(x * Float64(2.0 * Float64(y + z))); elseif (x <= -1.45e-62) tmp = t_1; elseif (x <= 1.04e-181) tmp = Float64(y * 5.0); elseif (x <= 2.45e-147) tmp = t_1; elseif (x <= 3.4e-48) tmp = Float64(y * 5.0); elseif ((x <= 5.8e+156) || !(x <= 1.8e+280)) tmp = t_1; else tmp = Float64(x * Float64(t + Float64(y * 2.0))); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = x * (t + (z * 2.0)); tmp = 0.0; if (x <= -3.1e+15) tmp = x * (2.0 * (y + z)); elseif (x <= -1.45e-62) tmp = t_1; elseif (x <= 1.04e-181) tmp = y * 5.0; elseif (x <= 2.45e-147) tmp = t_1; elseif (x <= 3.4e-48) tmp = y * 5.0; elseif ((x <= 5.8e+156) || ~((x <= 1.8e+280))) tmp = t_1; else tmp = x * (t + (y * 2.0)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(x * N[(t + N[(z * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -3.1e+15], N[(x * N[(2.0 * N[(y + z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, -1.45e-62], t$95$1, If[LessEqual[x, 1.04e-181], N[(y * 5.0), $MachinePrecision], If[LessEqual[x, 2.45e-147], t$95$1, If[LessEqual[x, 3.4e-48], N[(y * 5.0), $MachinePrecision], If[Or[LessEqual[x, 5.8e+156], N[Not[LessEqual[x, 1.8e+280]], $MachinePrecision]], t$95$1, N[(x * N[(t + N[(y * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot \left(t + z \cdot 2\right)\\
\mathbf{if}\;x \leq -3.1 \cdot 10^{+15}:\\
\;\;\;\;x \cdot \left(2 \cdot \left(y + z\right)\right)\\
\mathbf{elif}\;x \leq -1.45 \cdot 10^{-62}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \leq 1.04 \cdot 10^{-181}:\\
\;\;\;\;y \cdot 5\\
\mathbf{elif}\;x \leq 2.45 \cdot 10^{-147}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \leq 3.4 \cdot 10^{-48}:\\
\;\;\;\;y \cdot 5\\
\mathbf{elif}\;x \leq 5.8 \cdot 10^{+156} \lor \neg \left(x \leq 1.8 \cdot 10^{+280}\right):\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(t + y \cdot 2\right)\\
\end{array}
\end{array}
if x < -3.1e15Initial program 99.9%
fma-define99.9%
associate-+l+99.9%
+-commutative99.9%
count-299.9%
Simplified99.9%
Taylor expanded in x around inf 99.9%
Taylor expanded in t around 0 78.0%
associate-*r*78.0%
*-commutative78.0%
associate-*r*78.0%
Simplified78.0%
if -3.1e15 < x < -1.44999999999999993e-62 or 1.04000000000000002e-181 < x < 2.45000000000000002e-147 or 3.40000000000000028e-48 < x < 5.80000000000000021e156 or 1.8e280 < x Initial program 99.9%
Taylor expanded in y around 0 76.9%
if -1.44999999999999993e-62 < x < 1.04000000000000002e-181 or 2.45000000000000002e-147 < x < 3.40000000000000028e-48Initial program 99.9%
Taylor expanded in x around 0 69.7%
if 5.80000000000000021e156 < x < 1.8e280Initial 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 87.5%
*-commutative87.5%
Simplified87.5%
Final simplification75.4%
(FPCore (x y z t)
:precision binary64
(if (<= x -1.1e+14)
(* x (* 2.0 (+ y z)))
(if (or (<= x -1e-62)
(and (not (<= x 1.05e-181))
(or (<= x 1.5e-153) (not (<= x 3.4e-48)))))
(* x (+ t (* z 2.0)))
(* y 5.0))))
double code(double x, double y, double z, double t) {
double tmp;
if (x <= -1.1e+14) {
tmp = x * (2.0 * (y + z));
} else if ((x <= -1e-62) || (!(x <= 1.05e-181) && ((x <= 1.5e-153) || !(x <= 3.4e-48)))) {
tmp = x * (t + (z * 2.0));
} else {
tmp = y * 5.0;
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (x <= (-1.1d+14)) then
tmp = x * (2.0d0 * (y + z))
else if ((x <= (-1d-62)) .or. (.not. (x <= 1.05d-181)) .and. (x <= 1.5d-153) .or. (.not. (x <= 3.4d-48))) then
tmp = x * (t + (z * 2.0d0))
else
tmp = y * 5.0d0
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (x <= -1.1e+14) {
tmp = x * (2.0 * (y + z));
} else if ((x <= -1e-62) || (!(x <= 1.05e-181) && ((x <= 1.5e-153) || !(x <= 3.4e-48)))) {
tmp = x * (t + (z * 2.0));
} else {
tmp = y * 5.0;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if x <= -1.1e+14: tmp = x * (2.0 * (y + z)) elif (x <= -1e-62) or (not (x <= 1.05e-181) and ((x <= 1.5e-153) or not (x <= 3.4e-48))): tmp = x * (t + (z * 2.0)) else: tmp = y * 5.0 return tmp
function code(x, y, z, t) tmp = 0.0 if (x <= -1.1e+14) tmp = Float64(x * Float64(2.0 * Float64(y + z))); elseif ((x <= -1e-62) || (!(x <= 1.05e-181) && ((x <= 1.5e-153) || !(x <= 3.4e-48)))) tmp = Float64(x * Float64(t + Float64(z * 2.0))); else tmp = Float64(y * 5.0); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (x <= -1.1e+14) tmp = x * (2.0 * (y + z)); elseif ((x <= -1e-62) || (~((x <= 1.05e-181)) && ((x <= 1.5e-153) || ~((x <= 3.4e-48))))) tmp = x * (t + (z * 2.0)); else tmp = y * 5.0; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[x, -1.1e+14], N[(x * N[(2.0 * N[(y + z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[x, -1e-62], And[N[Not[LessEqual[x, 1.05e-181]], $MachinePrecision], Or[LessEqual[x, 1.5e-153], N[Not[LessEqual[x, 3.4e-48]], $MachinePrecision]]]], N[(x * N[(t + N[(z * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(y * 5.0), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.1 \cdot 10^{+14}:\\
\;\;\;\;x \cdot \left(2 \cdot \left(y + z\right)\right)\\
\mathbf{elif}\;x \leq -1 \cdot 10^{-62} \lor \neg \left(x \leq 1.05 \cdot 10^{-181}\right) \land \left(x \leq 1.5 \cdot 10^{-153} \lor \neg \left(x \leq 3.4 \cdot 10^{-48}\right)\right):\\
\;\;\;\;x \cdot \left(t + z \cdot 2\right)\\
\mathbf{else}:\\
\;\;\;\;y \cdot 5\\
\end{array}
\end{array}
if x < -1.1e14Initial program 99.9%
fma-define99.9%
associate-+l+99.9%
+-commutative99.9%
count-299.9%
Simplified99.9%
Taylor expanded in x around inf 99.9%
Taylor expanded in t around 0 78.0%
associate-*r*78.0%
*-commutative78.0%
associate-*r*78.0%
Simplified78.0%
if -1.1e14 < x < -1e-62 or 1.05000000000000002e-181 < x < 1.5e-153 or 3.40000000000000028e-48 < x Initial program 100.0%
Taylor expanded in y around 0 74.2%
if -1e-62 < x < 1.05000000000000002e-181 or 1.5e-153 < x < 3.40000000000000028e-48Initial program 99.9%
Taylor expanded in x around 0 69.7%
Final simplification73.3%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* 2.0 (* x z))))
(if (<= x -2.3e+101)
t_1
(if (<= x -1.2e+15)
(* 2.0 (* x y))
(if (<= x -1.7e-62)
t_1
(if (<= x 1.15e-47) (* y 5.0) (if (<= x 1.9e+82) (* x t) t_1)))))))
double code(double x, double y, double z, double t) {
double t_1 = 2.0 * (x * z);
double tmp;
if (x <= -2.3e+101) {
tmp = t_1;
} else if (x <= -1.2e+15) {
tmp = 2.0 * (x * y);
} else if (x <= -1.7e-62) {
tmp = t_1;
} else if (x <= 1.15e-47) {
tmp = y * 5.0;
} else if (x <= 1.9e+82) {
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 (x <= (-2.3d+101)) then
tmp = t_1
else if (x <= (-1.2d+15)) then
tmp = 2.0d0 * (x * y)
else if (x <= (-1.7d-62)) then
tmp = t_1
else if (x <= 1.15d-47) then
tmp = y * 5.0d0
else if (x <= 1.9d+82) 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 (x <= -2.3e+101) {
tmp = t_1;
} else if (x <= -1.2e+15) {
tmp = 2.0 * (x * y);
} else if (x <= -1.7e-62) {
tmp = t_1;
} else if (x <= 1.15e-47) {
tmp = y * 5.0;
} else if (x <= 1.9e+82) {
tmp = x * t;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = 2.0 * (x * z) tmp = 0 if x <= -2.3e+101: tmp = t_1 elif x <= -1.2e+15: tmp = 2.0 * (x * y) elif x <= -1.7e-62: tmp = t_1 elif x <= 1.15e-47: tmp = y * 5.0 elif x <= 1.9e+82: 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 (x <= -2.3e+101) tmp = t_1; elseif (x <= -1.2e+15) tmp = Float64(2.0 * Float64(x * y)); elseif (x <= -1.7e-62) tmp = t_1; elseif (x <= 1.15e-47) tmp = Float64(y * 5.0); elseif (x <= 1.9e+82) 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 (x <= -2.3e+101) tmp = t_1; elseif (x <= -1.2e+15) tmp = 2.0 * (x * y); elseif (x <= -1.7e-62) tmp = t_1; elseif (x <= 1.15e-47) tmp = y * 5.0; elseif (x <= 1.9e+82) 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[x, -2.3e+101], t$95$1, If[LessEqual[x, -1.2e+15], N[(2.0 * N[(x * y), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, -1.7e-62], t$95$1, If[LessEqual[x, 1.15e-47], N[(y * 5.0), $MachinePrecision], If[LessEqual[x, 1.9e+82], N[(x * t), $MachinePrecision], t$95$1]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := 2 \cdot \left(x \cdot z\right)\\
\mathbf{if}\;x \leq -2.3 \cdot 10^{+101}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \leq -1.2 \cdot 10^{+15}:\\
\;\;\;\;2 \cdot \left(x \cdot y\right)\\
\mathbf{elif}\;x \leq -1.7 \cdot 10^{-62}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \leq 1.15 \cdot 10^{-47}:\\
\;\;\;\;y \cdot 5\\
\mathbf{elif}\;x \leq 1.9 \cdot 10^{+82}:\\
\;\;\;\;x \cdot t\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if x < -2.3000000000000001e101 or -1.2e15 < x < -1.69999999999999994e-62 or 1.90000000000000017e82 < x Initial program 100.0%
Taylor expanded in z around inf 48.6%
if -2.3000000000000001e101 < x < -1.2e15Initial program 99.8%
fma-define99.8%
associate-+l+99.8%
+-commutative99.8%
count-299.8%
Simplified99.8%
Taylor expanded in x around inf 99.8%
Taylor expanded in y around inf 54.5%
associate-*r*54.5%
*-commutative54.5%
associate-*r/54.5%
metadata-eval54.5%
Simplified54.5%
Taylor expanded in x around inf 54.5%
if -1.69999999999999994e-62 < x < 1.14999999999999991e-47Initial program 99.9%
Taylor expanded in x around 0 65.8%
if 1.14999999999999991e-47 < x < 1.90000000000000017e82Initial program 100.0%
Taylor expanded in t around inf 44.3%
Simplified44.3%
Final simplification55.2%
(FPCore (x y z t) :precision binary64 (if (or (<= x -5e-13) (not (<= x 5.5e-17))) (* x (+ t (+ (* 2.0 (+ y z)) (* 5.0 (/ y x))))) (+ (+ (* y 5.0) (* x t)) (* 2.0 (* x z)))))
double code(double x, double y, double z, double t) {
double tmp;
if ((x <= -5e-13) || !(x <= 5.5e-17)) {
tmp = x * (t + ((2.0 * (y + z)) + (5.0 * (y / x))));
} else {
tmp = ((y * 5.0) + (x * t)) + (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 <= (-5d-13)) .or. (.not. (x <= 5.5d-17))) then
tmp = x * (t + ((2.0d0 * (y + z)) + (5.0d0 * (y / x))))
else
tmp = ((y * 5.0d0) + (x * t)) + (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 <= -5e-13) || !(x <= 5.5e-17)) {
tmp = x * (t + ((2.0 * (y + z)) + (5.0 * (y / x))));
} else {
tmp = ((y * 5.0) + (x * t)) + (2.0 * (x * z));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (x <= -5e-13) or not (x <= 5.5e-17): tmp = x * (t + ((2.0 * (y + z)) + (5.0 * (y / x)))) else: tmp = ((y * 5.0) + (x * t)) + (2.0 * (x * z)) return tmp
function code(x, y, z, t) tmp = 0.0 if ((x <= -5e-13) || !(x <= 5.5e-17)) tmp = Float64(x * Float64(t + Float64(Float64(2.0 * Float64(y + z)) + Float64(5.0 * Float64(y / x))))); else tmp = Float64(Float64(Float64(y * 5.0) + Float64(x * t)) + Float64(2.0 * Float64(x * z))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((x <= -5e-13) || ~((x <= 5.5e-17))) tmp = x * (t + ((2.0 * (y + z)) + (5.0 * (y / x)))); else tmp = ((y * 5.0) + (x * t)) + (2.0 * (x * z)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[x, -5e-13], N[Not[LessEqual[x, 5.5e-17]], $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[(N[(y * 5.0), $MachinePrecision] + N[(x * t), $MachinePrecision]), $MachinePrecision] + N[(2.0 * N[(x * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -5 \cdot 10^{-13} \lor \neg \left(x \leq 5.5 \cdot 10^{-17}\right):\\
\;\;\;\;x \cdot \left(t + \left(2 \cdot \left(y + z\right) + 5 \cdot \frac{y}{x}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(y \cdot 5 + x \cdot t\right) + 2 \cdot \left(x \cdot z\right)\\
\end{array}
\end{array}
if x < -4.9999999999999999e-13 or 5.50000000000000001e-17 < x Initial program 100.0%
fma-define100.0%
associate-+l+100.0%
+-commutative100.0%
count-2100.0%
Simplified100.0%
Taylor expanded in x around inf 99.9%
if -4.9999999999999999e-13 < x < 5.50000000000000001e-17Initial program 99.9%
fma-define99.9%
associate-+l+99.9%
+-commutative99.9%
count-299.9%
Simplified99.9%
Taylor expanded in t around 0 99.9%
Taylor expanded in y around 0 99.9%
Final simplification99.9%
(FPCore (x y z t) :precision binary64 (if (or (<= x -2.5) (not (<= x 8e-17))) (* x (+ t (* 2.0 (+ y z)))) (+ (+ (* y 5.0) (* x t)) (* 2.0 (* x z)))))
double code(double x, double y, double z, double t) {
double tmp;
if ((x <= -2.5) || !(x <= 8e-17)) {
tmp = x * (t + (2.0 * (y + z)));
} else {
tmp = ((y * 5.0) + (x * t)) + (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 <= (-2.5d0)) .or. (.not. (x <= 8d-17))) then
tmp = x * (t + (2.0d0 * (y + z)))
else
tmp = ((y * 5.0d0) + (x * t)) + (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 <= -2.5) || !(x <= 8e-17)) {
tmp = x * (t + (2.0 * (y + z)));
} else {
tmp = ((y * 5.0) + (x * t)) + (2.0 * (x * z));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (x <= -2.5) or not (x <= 8e-17): tmp = x * (t + (2.0 * (y + z))) else: tmp = ((y * 5.0) + (x * t)) + (2.0 * (x * z)) return tmp
function code(x, y, z, t) tmp = 0.0 if ((x <= -2.5) || !(x <= 8e-17)) tmp = Float64(x * Float64(t + Float64(2.0 * Float64(y + z)))); else tmp = Float64(Float64(Float64(y * 5.0) + Float64(x * t)) + Float64(2.0 * Float64(x * z))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((x <= -2.5) || ~((x <= 8e-17))) tmp = x * (t + (2.0 * (y + z))); else tmp = ((y * 5.0) + (x * t)) + (2.0 * (x * z)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[x, -2.5], N[Not[LessEqual[x, 8e-17]], $MachinePrecision]], N[(x * N[(t + N[(2.0 * N[(y + z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(y * 5.0), $MachinePrecision] + N[(x * t), $MachinePrecision]), $MachinePrecision] + N[(2.0 * N[(x * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -2.5 \lor \neg \left(x \leq 8 \cdot 10^{-17}\right):\\
\;\;\;\;x \cdot \left(t + 2 \cdot \left(y + z\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(y \cdot 5 + x \cdot t\right) + 2 \cdot \left(x \cdot z\right)\\
\end{array}
\end{array}
if x < -2.5 or 8.00000000000000057e-17 < 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.0%
if -2.5 < x < 8.00000000000000057e-17Initial program 99.9%
fma-define99.9%
associate-+l+99.9%
+-commutative99.9%
count-299.9%
Simplified99.9%
Taylor expanded in t around 0 99.9%
Taylor expanded in y around 0 99.5%
Final simplification99.2%
(FPCore (x y z t) :precision binary64 (if (or (<= x -2.5) (not (<= x 8e-17))) (* x (+ t (* 2.0 (+ y z)))) (+ (* x (+ t (+ y (* z 2.0)))) (* y 5.0))))
double code(double x, double y, double z, double t) {
double tmp;
if ((x <= -2.5) || !(x <= 8e-17)) {
tmp = x * (t + (2.0 * (y + z)));
} else {
tmp = (x * (t + (y + (z * 2.0)))) + (y * 5.0);
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if ((x <= (-2.5d0)) .or. (.not. (x <= 8d-17))) then
tmp = x * (t + (2.0d0 * (y + z)))
else
tmp = (x * (t + (y + (z * 2.0d0)))) + (y * 5.0d0)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((x <= -2.5) || !(x <= 8e-17)) {
tmp = x * (t + (2.0 * (y + z)));
} else {
tmp = (x * (t + (y + (z * 2.0)))) + (y * 5.0);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (x <= -2.5) or not (x <= 8e-17): tmp = x * (t + (2.0 * (y + z))) else: tmp = (x * (t + (y + (z * 2.0)))) + (y * 5.0) return tmp
function code(x, y, z, t) tmp = 0.0 if ((x <= -2.5) || !(x <= 8e-17)) tmp = Float64(x * Float64(t + Float64(2.0 * Float64(y + z)))); else tmp = Float64(Float64(x * Float64(t + Float64(y + Float64(z * 2.0)))) + Float64(y * 5.0)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((x <= -2.5) || ~((x <= 8e-17))) tmp = x * (t + (2.0 * (y + z))); else tmp = (x * (t + (y + (z * 2.0)))) + (y * 5.0); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[x, -2.5], N[Not[LessEqual[x, 8e-17]], $MachinePrecision]], N[(x * N[(t + N[(2.0 * N[(y + z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x * N[(t + N[(y + N[(z * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(y * 5.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -2.5 \lor \neg \left(x \leq 8 \cdot 10^{-17}\right):\\
\;\;\;\;x \cdot \left(t + 2 \cdot \left(y + z\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(t + \left(y + z \cdot 2\right)\right) + y \cdot 5\\
\end{array}
\end{array}
if x < -2.5 or 8.00000000000000057e-17 < 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.0%
if -2.5 < x < 8.00000000000000057e-17Initial program 99.9%
Taylor expanded in y around 0 99.5%
Final simplification99.2%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* y (+ 5.0 (* x 2.0)))))
(if (<= y -2.1e+81)
t_1
(if (<= y 3.7e+43)
(* x (+ t (* z 2.0)))
(if (<= y 3.2e+144) (+ (* y 5.0) (* x 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.1e+81) {
tmp = t_1;
} else if (y <= 3.7e+43) {
tmp = x * (t + (z * 2.0));
} else if (y <= 3.2e+144) {
tmp = (y * 5.0) + (x * t);
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: tmp
t_1 = y * (5.0d0 + (x * 2.0d0))
if (y <= (-2.1d+81)) then
tmp = t_1
else if (y <= 3.7d+43) then
tmp = x * (t + (z * 2.0d0))
else if (y <= 3.2d+144) then
tmp = (y * 5.0d0) + (x * t)
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = y * (5.0 + (x * 2.0));
double tmp;
if (y <= -2.1e+81) {
tmp = t_1;
} else if (y <= 3.7e+43) {
tmp = x * (t + (z * 2.0));
} else if (y <= 3.2e+144) {
tmp = (y * 5.0) + (x * 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.1e+81: tmp = t_1 elif y <= 3.7e+43: tmp = x * (t + (z * 2.0)) elif y <= 3.2e+144: tmp = (y * 5.0) + (x * 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.1e+81) tmp = t_1; elseif (y <= 3.7e+43) tmp = Float64(x * Float64(t + Float64(z * 2.0))); elseif (y <= 3.2e+144) tmp = Float64(Float64(y * 5.0) + Float64(x * t)); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = y * (5.0 + (x * 2.0)); tmp = 0.0; if (y <= -2.1e+81) tmp = t_1; elseif (y <= 3.7e+43) tmp = x * (t + (z * 2.0)); elseif (y <= 3.2e+144) tmp = (y * 5.0) + (x * t); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(y * N[(5.0 + N[(x * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -2.1e+81], t$95$1, If[LessEqual[y, 3.7e+43], N[(x * N[(t + N[(z * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 3.2e+144], N[(N[(y * 5.0), $MachinePrecision] + N[(x * t), $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.1 \cdot 10^{+81}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq 3.7 \cdot 10^{+43}:\\
\;\;\;\;x \cdot \left(t + z \cdot 2\right)\\
\mathbf{elif}\;y \leq 3.2 \cdot 10^{+144}:\\
\;\;\;\;y \cdot 5 + x \cdot t\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y < -2.0999999999999999e81 or 3.2000000000000001e144 < y Initial program 100.0%
Taylor expanded in y around inf 89.9%
Simplified89.9%
if -2.0999999999999999e81 < y < 3.7000000000000001e43Initial program 99.9%
Taylor expanded in y around 0 79.5%
if 3.7000000000000001e43 < y < 3.2000000000000001e144Initial program 99.8%
associate-+l+99.8%
+-commutative99.8%
flip-+0.0%
pow20.0%
pow20.0%
Applied egg-rr0.0%
Simplified89.3%
Taylor expanded in x around 0 89.3%
Final simplification83.7%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* 2.0 (* x z))))
(if (<= x -3.1e-62)
t_1
(if (<= x 1.3e-47) (* y 5.0) (if (<= x 2.95e+82) (* x t) t_1)))))
double code(double x, double y, double z, double t) {
double t_1 = 2.0 * (x * z);
double tmp;
if (x <= -3.1e-62) {
tmp = t_1;
} else if (x <= 1.3e-47) {
tmp = y * 5.0;
} else if (x <= 2.95e+82) {
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 (x <= (-3.1d-62)) then
tmp = t_1
else if (x <= 1.3d-47) then
tmp = y * 5.0d0
else if (x <= 2.95d+82) 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 (x <= -3.1e-62) {
tmp = t_1;
} else if (x <= 1.3e-47) {
tmp = y * 5.0;
} else if (x <= 2.95e+82) {
tmp = x * t;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = 2.0 * (x * z) tmp = 0 if x <= -3.1e-62: tmp = t_1 elif x <= 1.3e-47: tmp = y * 5.0 elif x <= 2.95e+82: 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 (x <= -3.1e-62) tmp = t_1; elseif (x <= 1.3e-47) tmp = Float64(y * 5.0); elseif (x <= 2.95e+82) 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 (x <= -3.1e-62) tmp = t_1; elseif (x <= 1.3e-47) tmp = y * 5.0; elseif (x <= 2.95e+82) 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[x, -3.1e-62], t$95$1, If[LessEqual[x, 1.3e-47], N[(y * 5.0), $MachinePrecision], If[LessEqual[x, 2.95e+82], N[(x * t), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := 2 \cdot \left(x \cdot z\right)\\
\mathbf{if}\;x \leq -3.1 \cdot 10^{-62}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \leq 1.3 \cdot 10^{-47}:\\
\;\;\;\;y \cdot 5\\
\mathbf{elif}\;x \leq 2.95 \cdot 10^{+82}:\\
\;\;\;\;x \cdot t\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if x < -3.0999999999999999e-62 or 2.9499999999999998e82 < x Initial program 100.0%
Taylor expanded in z around inf 44.5%
if -3.0999999999999999e-62 < x < 1.3e-47Initial program 99.9%
Taylor expanded in x around 0 65.8%
if 1.3e-47 < x < 2.9499999999999998e82Initial program 100.0%
Taylor expanded in t around inf 44.3%
Simplified44.3%
Final simplification52.9%
(FPCore (x y z t) :precision binary64 (if (<= t -5.1e+143) (+ (* x (+ t (+ y (* z 2.0)))) (* y 5.0)) (+ (* 2.0 (* x (+ y z))) (+ (* y 5.0) (* x t)))))
double code(double x, double y, double z, double t) {
double tmp;
if (t <= -5.1e+143) {
tmp = (x * (t + (y + (z * 2.0)))) + (y * 5.0);
} else {
tmp = (2.0 * (x * (y + z))) + ((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 (t <= (-5.1d+143)) then
tmp = (x * (t + (y + (z * 2.0d0)))) + (y * 5.0d0)
else
tmp = (2.0d0 * (x * (y + z))) + ((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 (t <= -5.1e+143) {
tmp = (x * (t + (y + (z * 2.0)))) + (y * 5.0);
} else {
tmp = (2.0 * (x * (y + z))) + ((y * 5.0) + (x * t));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if t <= -5.1e+143: tmp = (x * (t + (y + (z * 2.0)))) + (y * 5.0) else: tmp = (2.0 * (x * (y + z))) + ((y * 5.0) + (x * t)) return tmp
function code(x, y, z, t) tmp = 0.0 if (t <= -5.1e+143) tmp = Float64(Float64(x * Float64(t + Float64(y + Float64(z * 2.0)))) + Float64(y * 5.0)); else tmp = Float64(Float64(2.0 * Float64(x * Float64(y + z))) + Float64(Float64(y * 5.0) + Float64(x * t))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (t <= -5.1e+143) tmp = (x * (t + (y + (z * 2.0)))) + (y * 5.0); else tmp = (2.0 * (x * (y + z))) + ((y * 5.0) + (x * t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[t, -5.1e+143], N[(N[(x * N[(t + N[(y + N[(z * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(y * 5.0), $MachinePrecision]), $MachinePrecision], N[(N[(2.0 * N[(x * N[(y + z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(y * 5.0), $MachinePrecision] + N[(x * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -5.1 \cdot 10^{+143}:\\
\;\;\;\;x \cdot \left(t + \left(y + z \cdot 2\right)\right) + y \cdot 5\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \left(x \cdot \left(y + z\right)\right) + \left(y \cdot 5 + x \cdot t\right)\\
\end{array}
\end{array}
if t < -5.10000000000000038e143Initial program 99.9%
Taylor expanded in y around 0 98.0%
if -5.10000000000000038e143 < t Initial program 99.9%
fma-define100.0%
associate-+l+99.9%
+-commutative99.9%
count-299.9%
Simplified99.9%
Taylor expanded in t around 0 98.5%
Final simplification98.5%
(FPCore (x y z t) :precision binary64 (if (or (<= x -3.6e-62) (not (<= x 6.8e-17))) (* x (+ t (* 2.0 (+ y z)))) (+ (* y 5.0) (* x t))))
double code(double x, double y, double z, double t) {
double tmp;
if ((x <= -3.6e-62) || !(x <= 6.8e-17)) {
tmp = x * (t + (2.0 * (y + z)));
} else {
tmp = (y * 5.0) + (x * t);
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if ((x <= (-3.6d-62)) .or. (.not. (x <= 6.8d-17))) then
tmp = x * (t + (2.0d0 * (y + z)))
else
tmp = (y * 5.0d0) + (x * t)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((x <= -3.6e-62) || !(x <= 6.8e-17)) {
tmp = x * (t + (2.0 * (y + z)));
} else {
tmp = (y * 5.0) + (x * t);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (x <= -3.6e-62) or not (x <= 6.8e-17): tmp = x * (t + (2.0 * (y + z))) else: tmp = (y * 5.0) + (x * t) return tmp
function code(x, y, z, t) tmp = 0.0 if ((x <= -3.6e-62) || !(x <= 6.8e-17)) tmp = Float64(x * Float64(t + Float64(2.0 * Float64(y + z)))); else tmp = Float64(Float64(y * 5.0) + Float64(x * t)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((x <= -3.6e-62) || ~((x <= 6.8e-17))) tmp = x * (t + (2.0 * (y + z))); else tmp = (y * 5.0) + (x * t); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[x, -3.6e-62], N[Not[LessEqual[x, 6.8e-17]], $MachinePrecision]], N[(x * N[(t + N[(2.0 * N[(y + z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(y * 5.0), $MachinePrecision] + N[(x * t), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -3.6 \cdot 10^{-62} \lor \neg \left(x \leq 6.8 \cdot 10^{-17}\right):\\
\;\;\;\;x \cdot \left(t + 2 \cdot \left(y + z\right)\right)\\
\mathbf{else}:\\
\;\;\;\;y \cdot 5 + x \cdot t\\
\end{array}
\end{array}
if x < -3.6e-62 or 6.7999999999999996e-17 < x Initial program 100.0%
fma-define100.0%
associate-+l+100.0%
+-commutative100.0%
count-2100.0%
Simplified100.0%
Taylor expanded in x around inf 97.1%
if -3.6e-62 < x < 6.7999999999999996e-17Initial program 99.9%
associate-+l+99.9%
+-commutative99.9%
flip-+0.0%
pow20.0%
pow20.0%
Applied egg-rr0.0%
Simplified85.3%
Taylor expanded in x around 0 85.3%
Final simplification92.2%
(FPCore (x y z t) :precision binary64 (if (or (<= x -2.6e-62) (not (<= x 3.7e-16))) (* x (* 2.0 (+ y z))) (* y 5.0)))
double code(double x, double y, double z, double t) {
double tmp;
if ((x <= -2.6e-62) || !(x <= 3.7e-16)) {
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.6d-62)) .or. (.not. (x <= 3.7d-16))) 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.6e-62) || !(x <= 3.7e-16)) {
tmp = x * (2.0 * (y + z));
} else {
tmp = y * 5.0;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (x <= -2.6e-62) or not (x <= 3.7e-16): 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.6e-62) || !(x <= 3.7e-16)) 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.6e-62) || ~((x <= 3.7e-16))) 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.6e-62], N[Not[LessEqual[x, 3.7e-16]], $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.6 \cdot 10^{-62} \lor \neg \left(x \leq 3.7 \cdot 10^{-16}\right):\\
\;\;\;\;x \cdot \left(2 \cdot \left(y + z\right)\right)\\
\mathbf{else}:\\
\;\;\;\;y \cdot 5\\
\end{array}
\end{array}
if x < -2.5999999999999999e-62 or 3.7e-16 < x Initial program 100.0%
fma-define100.0%
associate-+l+100.0%
+-commutative100.0%
count-2100.0%
Simplified100.0%
Taylor expanded in x around inf 97.1%
Taylor expanded in t around 0 68.8%
associate-*r*68.8%
*-commutative68.8%
associate-*r*68.8%
Simplified68.8%
if -2.5999999999999999e-62 < x < 3.7e-16Initial program 99.9%
Taylor expanded in x around 0 64.1%
Final simplification66.8%
(FPCore (x y z t) :precision binary64 (if (or (<= y -2.6e+81) (not (<= y 620000000.0))) (* y (+ 5.0 (* x 2.0))) (* x (+ t (* z 2.0)))))
double code(double x, double y, double z, double t) {
double tmp;
if ((y <= -2.6e+81) || !(y <= 620000000.0)) {
tmp = y * (5.0 + (x * 2.0));
} else {
tmp = x * (t + (z * 2.0));
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if ((y <= (-2.6d+81)) .or. (.not. (y <= 620000000.0d0))) then
tmp = y * (5.0d0 + (x * 2.0d0))
else
tmp = x * (t + (z * 2.0d0))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((y <= -2.6e+81) || !(y <= 620000000.0)) {
tmp = y * (5.0 + (x * 2.0));
} else {
tmp = x * (t + (z * 2.0));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (y <= -2.6e+81) or not (y <= 620000000.0): tmp = y * (5.0 + (x * 2.0)) else: tmp = x * (t + (z * 2.0)) return tmp
function code(x, y, z, t) tmp = 0.0 if ((y <= -2.6e+81) || !(y <= 620000000.0)) tmp = Float64(y * Float64(5.0 + Float64(x * 2.0))); else tmp = Float64(x * Float64(t + Float64(z * 2.0))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((y <= -2.6e+81) || ~((y <= 620000000.0))) tmp = y * (5.0 + (x * 2.0)); else tmp = x * (t + (z * 2.0)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[y, -2.6e+81], N[Not[LessEqual[y, 620000000.0]], $MachinePrecision]], N[(y * N[(5.0 + N[(x * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x * N[(t + N[(z * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -2.6 \cdot 10^{+81} \lor \neg \left(y \leq 620000000\right):\\
\;\;\;\;y \cdot \left(5 + x \cdot 2\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(t + z \cdot 2\right)\\
\end{array}
\end{array}
if y < -2.59999999999999992e81 or 6.2e8 < y Initial program 99.9%
Taylor expanded in y around inf 82.8%
Simplified82.8%
if -2.59999999999999992e81 < y < 6.2e8Initial program 99.9%
Taylor expanded in y around 0 81.1%
Final simplification81.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 -3.1e-62) (not (<= x 1.3e-47))) (* x t) (* y 5.0)))
double code(double x, double y, double z, double t) {
double tmp;
if ((x <= -3.1e-62) || !(x <= 1.3e-47)) {
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 <= (-3.1d-62)) .or. (.not. (x <= 1.3d-47))) 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 <= -3.1e-62) || !(x <= 1.3e-47)) {
tmp = x * t;
} else {
tmp = y * 5.0;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (x <= -3.1e-62) or not (x <= 1.3e-47): tmp = x * t else: tmp = y * 5.0 return tmp
function code(x, y, z, t) tmp = 0.0 if ((x <= -3.1e-62) || !(x <= 1.3e-47)) 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 <= -3.1e-62) || ~((x <= 1.3e-47))) tmp = x * t; else tmp = y * 5.0; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[x, -3.1e-62], N[Not[LessEqual[x, 1.3e-47]], $MachinePrecision]], N[(x * t), $MachinePrecision], N[(y * 5.0), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -3.1 \cdot 10^{-62} \lor \neg \left(x \leq 1.3 \cdot 10^{-47}\right):\\
\;\;\;\;x \cdot t\\
\mathbf{else}:\\
\;\;\;\;y \cdot 5\\
\end{array}
\end{array}
if x < -3.0999999999999999e-62 or 1.3e-47 < x Initial program 100.0%
Taylor expanded in t around inf 36.8%
Simplified36.8%
if -3.0999999999999999e-62 < x < 1.3e-47Initial program 99.9%
Taylor expanded in x around 0 65.8%
Final simplification48.3%
(FPCore (x y z t) :precision binary64 (* y 5.0))
double code(double x, double y, double z, double t) {
return y * 5.0;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = y * 5.0d0
end function
public static double code(double x, double y, double z, double t) {
return y * 5.0;
}
def code(x, y, z, t): return y * 5.0
function code(x, y, z, t) return Float64(y * 5.0) end
function tmp = code(x, y, z, t) tmp = y * 5.0; end
code[x_, y_, z_, t_] := N[(y * 5.0), $MachinePrecision]
\begin{array}{l}
\\
y \cdot 5
\end{array}
Initial program 99.9%
Taylor expanded in x around 0 29.4%
Final simplification29.4%
herbie shell --seed 2024071
(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)))