
(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
(let* ((t_1 (* 2.0 (+ y z))))
(if (<= x -0.0035)
(* x (+ t (+ t_1 (* 5.0 (/ y x)))))
(if (<= x 3e+143)
(+ (* 2.0 (* x (+ y z))) (+ (* y 5.0) (* x t)))
(* x (+ t t_1))))))
double code(double x, double y, double z, double t) {
double t_1 = 2.0 * (y + z);
double tmp;
if (x <= -0.0035) {
tmp = x * (t + (t_1 + (5.0 * (y / x))));
} else if (x <= 3e+143) {
tmp = (2.0 * (x * (y + z))) + ((y * 5.0) + (x * t));
} else {
tmp = x * (t + 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 * (y + z)
if (x <= (-0.0035d0)) then
tmp = x * (t + (t_1 + (5.0d0 * (y / x))))
else if (x <= 3d+143) then
tmp = (2.0d0 * (x * (y + z))) + ((y * 5.0d0) + (x * t))
else
tmp = x * (t + 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 * (y + z);
double tmp;
if (x <= -0.0035) {
tmp = x * (t + (t_1 + (5.0 * (y / x))));
} else if (x <= 3e+143) {
tmp = (2.0 * (x * (y + z))) + ((y * 5.0) + (x * t));
} else {
tmp = x * (t + t_1);
}
return tmp;
}
def code(x, y, z, t): t_1 = 2.0 * (y + z) tmp = 0 if x <= -0.0035: tmp = x * (t + (t_1 + (5.0 * (y / x)))) elif x <= 3e+143: tmp = (2.0 * (x * (y + z))) + ((y * 5.0) + (x * t)) else: tmp = x * (t + t_1) return tmp
function code(x, y, z, t) t_1 = Float64(2.0 * Float64(y + z)) tmp = 0.0 if (x <= -0.0035) tmp = Float64(x * Float64(t + Float64(t_1 + Float64(5.0 * Float64(y / x))))); elseif (x <= 3e+143) tmp = Float64(Float64(2.0 * Float64(x * Float64(y + z))) + Float64(Float64(y * 5.0) + Float64(x * t))); else tmp = Float64(x * Float64(t + t_1)); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = 2.0 * (y + z); tmp = 0.0; if (x <= -0.0035) tmp = x * (t + (t_1 + (5.0 * (y / x)))); elseif (x <= 3e+143) tmp = (2.0 * (x * (y + z))) + ((y * 5.0) + (x * t)); else tmp = x * (t + t_1); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(2.0 * N[(y + z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -0.0035], N[(x * N[(t + N[(t$95$1 + N[(5.0 * N[(y / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 3e+143], N[(N[(2.0 * N[(x * N[(y + z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(y * 5.0), $MachinePrecision] + N[(x * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x * N[(t + t$95$1), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := 2 \cdot \left(y + z\right)\\
\mathbf{if}\;x \leq -0.0035:\\
\;\;\;\;x \cdot \left(t + \left(t\_1 + 5 \cdot \frac{y}{x}\right)\right)\\
\mathbf{elif}\;x \leq 3 \cdot 10^{+143}:\\
\;\;\;\;2 \cdot \left(x \cdot \left(y + z\right)\right) + \left(y \cdot 5 + x \cdot t\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(t + t\_1\right)\\
\end{array}
\end{array}
if x < -0.00350000000000000007Initial program 99.9%
fma-define99.9%
associate-+l+99.9%
+-commutative99.9%
count-299.9%
Simplified99.9%
Taylor expanded in x around inf 100.0%
if -0.00350000000000000007 < x < 3.0000000000000001e143Initial program 99.2%
fma-define99.2%
associate-+l+99.2%
+-commutative99.2%
count-299.2%
Simplified99.2%
Taylor expanded in t around 0 99.9%
if 3.0000000000000001e143 < 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%
Final simplification99.9%
(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.5%
fma-define99.5%
associate-+l+99.6%
associate-+l+99.6%
Simplified99.6%
(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.5%
fma-define99.5%
associate-+l+99.5%
+-commutative99.5%
count-299.5%
Simplified99.5%
Final simplification99.5%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* 2.0 (* x z))))
(if (<= x -6e+92)
t_1
(if (<= x -1.4e-33)
(* x t)
(if (<= x 6.1e-61)
(* y 5.0)
(if (<= x 4.5e+86)
(* x t)
(if (<= x 3.8e+202)
t_1
(if (<= x 6.5e+231) (* y (* x 2.0)) (* x t)))))))))
double code(double x, double y, double z, double t) {
double t_1 = 2.0 * (x * z);
double tmp;
if (x <= -6e+92) {
tmp = t_1;
} else if (x <= -1.4e-33) {
tmp = x * t;
} else if (x <= 6.1e-61) {
tmp = y * 5.0;
} else if (x <= 4.5e+86) {
tmp = x * t;
} else if (x <= 3.8e+202) {
tmp = t_1;
} else if (x <= 6.5e+231) {
tmp = y * (x * 2.0);
} else {
tmp = x * t;
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: tmp
t_1 = 2.0d0 * (x * z)
if (x <= (-6d+92)) then
tmp = t_1
else if (x <= (-1.4d-33)) then
tmp = x * t
else if (x <= 6.1d-61) then
tmp = y * 5.0d0
else if (x <= 4.5d+86) then
tmp = x * t
else if (x <= 3.8d+202) then
tmp = t_1
else if (x <= 6.5d+231) then
tmp = y * (x * 2.0d0)
else
tmp = x * t
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = 2.0 * (x * z);
double tmp;
if (x <= -6e+92) {
tmp = t_1;
} else if (x <= -1.4e-33) {
tmp = x * t;
} else if (x <= 6.1e-61) {
tmp = y * 5.0;
} else if (x <= 4.5e+86) {
tmp = x * t;
} else if (x <= 3.8e+202) {
tmp = t_1;
} else if (x <= 6.5e+231) {
tmp = y * (x * 2.0);
} else {
tmp = x * t;
}
return tmp;
}
def code(x, y, z, t): t_1 = 2.0 * (x * z) tmp = 0 if x <= -6e+92: tmp = t_1 elif x <= -1.4e-33: tmp = x * t elif x <= 6.1e-61: tmp = y * 5.0 elif x <= 4.5e+86: tmp = x * t elif x <= 3.8e+202: tmp = t_1 elif x <= 6.5e+231: tmp = y * (x * 2.0) else: tmp = x * t return tmp
function code(x, y, z, t) t_1 = Float64(2.0 * Float64(x * z)) tmp = 0.0 if (x <= -6e+92) tmp = t_1; elseif (x <= -1.4e-33) tmp = Float64(x * t); elseif (x <= 6.1e-61) tmp = Float64(y * 5.0); elseif (x <= 4.5e+86) tmp = Float64(x * t); elseif (x <= 3.8e+202) tmp = t_1; elseif (x <= 6.5e+231) tmp = Float64(y * Float64(x * 2.0)); else tmp = Float64(x * t); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = 2.0 * (x * z); tmp = 0.0; if (x <= -6e+92) tmp = t_1; elseif (x <= -1.4e-33) tmp = x * t; elseif (x <= 6.1e-61) tmp = y * 5.0; elseif (x <= 4.5e+86) tmp = x * t; elseif (x <= 3.8e+202) tmp = t_1; elseif (x <= 6.5e+231) tmp = y * (x * 2.0); else tmp = x * t; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(2.0 * N[(x * z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -6e+92], t$95$1, If[LessEqual[x, -1.4e-33], N[(x * t), $MachinePrecision], If[LessEqual[x, 6.1e-61], N[(y * 5.0), $MachinePrecision], If[LessEqual[x, 4.5e+86], N[(x * t), $MachinePrecision], If[LessEqual[x, 3.8e+202], t$95$1, If[LessEqual[x, 6.5e+231], N[(y * N[(x * 2.0), $MachinePrecision]), $MachinePrecision], N[(x * t), $MachinePrecision]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := 2 \cdot \left(x \cdot z\right)\\
\mathbf{if}\;x \leq -6 \cdot 10^{+92}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \leq -1.4 \cdot 10^{-33}:\\
\;\;\;\;x \cdot t\\
\mathbf{elif}\;x \leq 6.1 \cdot 10^{-61}:\\
\;\;\;\;y \cdot 5\\
\mathbf{elif}\;x \leq 4.5 \cdot 10^{+86}:\\
\;\;\;\;x \cdot t\\
\mathbf{elif}\;x \leq 3.8 \cdot 10^{+202}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \leq 6.5 \cdot 10^{+231}:\\
\;\;\;\;y \cdot \left(x \cdot 2\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot t\\
\end{array}
\end{array}
if x < -6.00000000000000026e92 or 4.49999999999999993e86 < x < 3.8000000000000001e202Initial program 99.9%
fma-define99.9%
associate-+l+99.9%
+-commutative99.9%
count-299.9%
Simplified99.9%
Taylor expanded in t around 0 91.7%
Taylor expanded in z around inf 53.3%
if -6.00000000000000026e92 < x < -1.4e-33 or 6.1000000000000001e-61 < x < 4.49999999999999993e86 or 6.49999999999999933e231 < x Initial program 100.0%
fma-define100.0%
associate-+l+100.0%
+-commutative100.0%
count-2100.0%
Simplified100.0%
Taylor expanded in t around 0 92.3%
Taylor expanded in t around inf 53.0%
*-commutative53.0%
Simplified53.0%
if -1.4e-33 < x < 6.1000000000000001e-61Initial program 98.9%
Taylor expanded in x around 0 66.1%
Simplified66.1%
if 3.8000000000000001e202 < x < 6.49999999999999933e231Initial 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 y around inf 80.7%
associate-*r*80.7%
*-commutative80.7%
*-commutative80.7%
Simplified80.7%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* 2.0 (* x z))))
(if (<= x -5.6e+92)
t_1
(if (<= x -7.2e-34)
(* x t)
(if (<= x 6.2e-61)
(* y 5.0)
(if (or (<= x 3.5e+86) (not (<= x 5e+171))) (* 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 <= -5.6e+92) {
tmp = t_1;
} else if (x <= -7.2e-34) {
tmp = x * t;
} else if (x <= 6.2e-61) {
tmp = y * 5.0;
} else if ((x <= 3.5e+86) || !(x <= 5e+171)) {
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 <= (-5.6d+92)) then
tmp = t_1
else if (x <= (-7.2d-34)) then
tmp = x * t
else if (x <= 6.2d-61) then
tmp = y * 5.0d0
else if ((x <= 3.5d+86) .or. (.not. (x <= 5d+171))) 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 <= -5.6e+92) {
tmp = t_1;
} else if (x <= -7.2e-34) {
tmp = x * t;
} else if (x <= 6.2e-61) {
tmp = y * 5.0;
} else if ((x <= 3.5e+86) || !(x <= 5e+171)) {
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 <= -5.6e+92: tmp = t_1 elif x <= -7.2e-34: tmp = x * t elif x <= 6.2e-61: tmp = y * 5.0 elif (x <= 3.5e+86) or not (x <= 5e+171): 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 <= -5.6e+92) tmp = t_1; elseif (x <= -7.2e-34) tmp = Float64(x * t); elseif (x <= 6.2e-61) tmp = Float64(y * 5.0); elseif ((x <= 3.5e+86) || !(x <= 5e+171)) 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 <= -5.6e+92) tmp = t_1; elseif (x <= -7.2e-34) tmp = x * t; elseif (x <= 6.2e-61) tmp = y * 5.0; elseif ((x <= 3.5e+86) || ~((x <= 5e+171))) 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, -5.6e+92], t$95$1, If[LessEqual[x, -7.2e-34], N[(x * t), $MachinePrecision], If[LessEqual[x, 6.2e-61], N[(y * 5.0), $MachinePrecision], If[Or[LessEqual[x, 3.5e+86], N[Not[LessEqual[x, 5e+171]], $MachinePrecision]], 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 -5.6 \cdot 10^{+92}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \leq -7.2 \cdot 10^{-34}:\\
\;\;\;\;x \cdot t\\
\mathbf{elif}\;x \leq 6.2 \cdot 10^{-61}:\\
\;\;\;\;y \cdot 5\\
\mathbf{elif}\;x \leq 3.5 \cdot 10^{+86} \lor \neg \left(x \leq 5 \cdot 10^{+171}\right):\\
\;\;\;\;x \cdot t\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if x < -5.60000000000000001e92 or 3.50000000000000019e86 < x < 5.0000000000000004e171Initial program 99.9%
fma-define99.9%
associate-+l+99.9%
+-commutative99.9%
count-299.9%
Simplified99.9%
Taylor expanded in t around 0 91.0%
Taylor expanded in z around inf 54.2%
if -5.60000000000000001e92 < x < -7.20000000000000016e-34 or 6.1999999999999999e-61 < x < 3.50000000000000019e86 or 5.0000000000000004e171 < x Initial program 100.0%
fma-define100.0%
associate-+l+100.0%
+-commutative100.0%
count-2100.0%
Simplified100.0%
Taylor expanded in t around 0 93.5%
Taylor expanded in t around inf 50.2%
*-commutative50.2%
Simplified50.2%
if -7.20000000000000016e-34 < x < 6.1999999999999999e-61Initial program 98.9%
Taylor expanded in x around 0 66.1%
Simplified66.1%
Final simplification57.2%
(FPCore (x y z t)
:precision binary64
(if (or (<= y -2.5e+127)
(not (or (<= y -2.8e+30) (and (not (<= y -6.8e-51)) (<= y 1.3e+85)))))
(* 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.5e+127) || !((y <= -2.8e+30) || (!(y <= -6.8e-51) && (y <= 1.3e+85)))) {
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.5d+127)) .or. (.not. (y <= (-2.8d+30)) .or. (.not. (y <= (-6.8d-51))) .and. (y <= 1.3d+85))) 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.5e+127) || !((y <= -2.8e+30) || (!(y <= -6.8e-51) && (y <= 1.3e+85)))) {
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.5e+127) or not ((y <= -2.8e+30) or (not (y <= -6.8e-51) and (y <= 1.3e+85))): 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.5e+127) || !((y <= -2.8e+30) || (!(y <= -6.8e-51) && (y <= 1.3e+85)))) 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.5e+127) || ~(((y <= -2.8e+30) || (~((y <= -6.8e-51)) && (y <= 1.3e+85))))) 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.5e+127], N[Not[Or[LessEqual[y, -2.8e+30], And[N[Not[LessEqual[y, -6.8e-51]], $MachinePrecision], LessEqual[y, 1.3e+85]]]], $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.5 \cdot 10^{+127} \lor \neg \left(y \leq -2.8 \cdot 10^{+30} \lor \neg \left(y \leq -6.8 \cdot 10^{-51}\right) \land y \leq 1.3 \cdot 10^{+85}\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.5000000000000002e127 or -2.79999999999999983e30 < y < -6.80000000000000005e-51 or 1.30000000000000005e85 < y Initial program 99.9%
Taylor expanded in y around inf 87.5%
Simplified87.5%
if -2.5000000000000002e127 < y < -2.79999999999999983e30 or -6.80000000000000005e-51 < y < 1.30000000000000005e85Initial program 99.3%
fma-define99.3%
associate-+l+99.3%
+-commutative99.3%
count-299.3%
Simplified99.3%
Taylor expanded in t around 0 96.7%
Taylor expanded in y around 0 81.6%
+-commutative81.6%
*-commutative81.6%
*-commutative81.6%
associate-*l*81.0%
*-commutative81.0%
distribute-lft-in83.6%
Simplified83.6%
Final simplification85.2%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* x (+ t (* z 2.0)))))
(if (<= x -6.2e-77)
t_1
(if (<= x 7.4e-62)
(* y 5.0)
(if (or (<= x 5.6e+203) (not (<= x 6.4e+274)))
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 <= -6.2e-77) {
tmp = t_1;
} else if (x <= 7.4e-62) {
tmp = y * 5.0;
} else if ((x <= 5.6e+203) || !(x <= 6.4e+274)) {
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 <= (-6.2d-77)) then
tmp = t_1
else if (x <= 7.4d-62) then
tmp = y * 5.0d0
else if ((x <= 5.6d+203) .or. (.not. (x <= 6.4d+274))) 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 <= -6.2e-77) {
tmp = t_1;
} else if (x <= 7.4e-62) {
tmp = y * 5.0;
} else if ((x <= 5.6e+203) || !(x <= 6.4e+274)) {
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 <= -6.2e-77: tmp = t_1 elif x <= 7.4e-62: tmp = y * 5.0 elif (x <= 5.6e+203) or not (x <= 6.4e+274): 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 <= -6.2e-77) tmp = t_1; elseif (x <= 7.4e-62) tmp = Float64(y * 5.0); elseif ((x <= 5.6e+203) || !(x <= 6.4e+274)) 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 <= -6.2e-77) tmp = t_1; elseif (x <= 7.4e-62) tmp = y * 5.0; elseif ((x <= 5.6e+203) || ~((x <= 6.4e+274))) 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, -6.2e-77], t$95$1, If[LessEqual[x, 7.4e-62], N[(y * 5.0), $MachinePrecision], If[Or[LessEqual[x, 5.6e+203], N[Not[LessEqual[x, 6.4e+274]], $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 -6.2 \cdot 10^{-77}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \leq 7.4 \cdot 10^{-62}:\\
\;\;\;\;y \cdot 5\\
\mathbf{elif}\;x \leq 5.6 \cdot 10^{+203} \lor \neg \left(x \leq 6.4 \cdot 10^{+274}\right):\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(t + y \cdot 2\right)\\
\end{array}
\end{array}
if x < -6.20000000000000016e-77 or 7.3999999999999996e-62 < x < 5.5999999999999998e203 or 6.39999999999999965e274 < x Initial program 99.3%
fma-define99.3%
associate-+l+99.3%
+-commutative99.3%
count-299.3%
Simplified99.3%
Taylor expanded in t around 0 93.3%
Taylor expanded in y around 0 69.9%
+-commutative69.9%
*-commutative69.9%
*-commutative69.9%
associate-*l*69.3%
*-commutative69.3%
distribute-lft-in73.3%
Simplified73.3%
if -6.20000000000000016e-77 < x < 7.3999999999999996e-62Initial program 99.8%
Taylor expanded in x around 0 68.2%
Simplified68.2%
if 5.5999999999999998e203 < x < 6.39999999999999965e274Initial 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 85.6%
Final simplification72.5%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* x (+ t (* y 2.0)))))
(if (<= x -9.5e+114)
t_1
(if (<= x -1.6e+95)
(* 2.0 (* x z))
(if (or (<= x -2e-35) (not (<= x 3.3e-62))) t_1 (* y 5.0))))))
double code(double x, double y, double z, double t) {
double t_1 = x * (t + (y * 2.0));
double tmp;
if (x <= -9.5e+114) {
tmp = t_1;
} else if (x <= -1.6e+95) {
tmp = 2.0 * (x * z);
} else if ((x <= -2e-35) || !(x <= 3.3e-62)) {
tmp = t_1;
} 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) :: t_1
real(8) :: tmp
t_1 = x * (t + (y * 2.0d0))
if (x <= (-9.5d+114)) then
tmp = t_1
else if (x <= (-1.6d+95)) then
tmp = 2.0d0 * (x * z)
else if ((x <= (-2d-35)) .or. (.not. (x <= 3.3d-62))) then
tmp = t_1
else
tmp = y * 5.0d0
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = x * (t + (y * 2.0));
double tmp;
if (x <= -9.5e+114) {
tmp = t_1;
} else if (x <= -1.6e+95) {
tmp = 2.0 * (x * z);
} else if ((x <= -2e-35) || !(x <= 3.3e-62)) {
tmp = t_1;
} else {
tmp = y * 5.0;
}
return tmp;
}
def code(x, y, z, t): t_1 = x * (t + (y * 2.0)) tmp = 0 if x <= -9.5e+114: tmp = t_1 elif x <= -1.6e+95: tmp = 2.0 * (x * z) elif (x <= -2e-35) or not (x <= 3.3e-62): tmp = t_1 else: tmp = y * 5.0 return tmp
function code(x, y, z, t) t_1 = Float64(x * Float64(t + Float64(y * 2.0))) tmp = 0.0 if (x <= -9.5e+114) tmp = t_1; elseif (x <= -1.6e+95) tmp = Float64(2.0 * Float64(x * z)); elseif ((x <= -2e-35) || !(x <= 3.3e-62)) tmp = t_1; else tmp = Float64(y * 5.0); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = x * (t + (y * 2.0)); tmp = 0.0; if (x <= -9.5e+114) tmp = t_1; elseif (x <= -1.6e+95) tmp = 2.0 * (x * z); elseif ((x <= -2e-35) || ~((x <= 3.3e-62))) tmp = t_1; else tmp = y * 5.0; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(x * N[(t + N[(y * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -9.5e+114], t$95$1, If[LessEqual[x, -1.6e+95], N[(2.0 * N[(x * z), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[x, -2e-35], N[Not[LessEqual[x, 3.3e-62]], $MachinePrecision]], t$95$1, N[(y * 5.0), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot \left(t + y \cdot 2\right)\\
\mathbf{if}\;x \leq -9.5 \cdot 10^{+114}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \leq -1.6 \cdot 10^{+95}:\\
\;\;\;\;2 \cdot \left(x \cdot z\right)\\
\mathbf{elif}\;x \leq -2 \cdot 10^{-35} \lor \neg \left(x \leq 3.3 \cdot 10^{-62}\right):\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;y \cdot 5\\
\end{array}
\end{array}
if x < -9.5000000000000001e114 or -1.6e95 < x < -2.00000000000000002e-35 or 3.30000000000000004e-62 < 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.6%
Taylor expanded in z around 0 66.9%
if -9.5000000000000001e114 < x < -1.6e95Initial program 99.8%
fma-define99.8%
associate-+l+99.8%
+-commutative99.8%
count-299.8%
Simplified99.8%
Taylor expanded in t around 0 100.0%
Taylor expanded in z around inf 80.4%
if -2.00000000000000002e-35 < x < 3.30000000000000004e-62Initial program 98.9%
Taylor expanded in x around 0 66.1%
Simplified66.1%
Final simplification67.0%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* y (+ 5.0 (* x 2.0)))))
(if (<= y -8.2e+205)
t_1
(if (<= y 5.2e+68)
(* x (+ t (+ (* 2.0 (+ y z)) (* 5.0 (/ y x)))))
(+ t_1 (* x t))))))
double code(double x, double y, double z, double t) {
double t_1 = y * (5.0 + (x * 2.0));
double tmp;
if (y <= -8.2e+205) {
tmp = t_1;
} else if (y <= 5.2e+68) {
tmp = x * (t + ((2.0 * (y + z)) + (5.0 * (y / x))));
} else {
tmp = t_1 + (x * t);
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: tmp
t_1 = y * (5.0d0 + (x * 2.0d0))
if (y <= (-8.2d+205)) then
tmp = t_1
else if (y <= 5.2d+68) then
tmp = x * (t + ((2.0d0 * (y + z)) + (5.0d0 * (y / x))))
else
tmp = t_1 + (x * t)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = y * (5.0 + (x * 2.0));
double tmp;
if (y <= -8.2e+205) {
tmp = t_1;
} else if (y <= 5.2e+68) {
tmp = x * (t + ((2.0 * (y + z)) + (5.0 * (y / x))));
} else {
tmp = t_1 + (x * t);
}
return tmp;
}
def code(x, y, z, t): t_1 = y * (5.0 + (x * 2.0)) tmp = 0 if y <= -8.2e+205: tmp = t_1 elif y <= 5.2e+68: tmp = x * (t + ((2.0 * (y + z)) + (5.0 * (y / x)))) else: tmp = t_1 + (x * t) return tmp
function code(x, y, z, t) t_1 = Float64(y * Float64(5.0 + Float64(x * 2.0))) tmp = 0.0 if (y <= -8.2e+205) tmp = t_1; elseif (y <= 5.2e+68) tmp = Float64(x * Float64(t + Float64(Float64(2.0 * Float64(y + z)) + Float64(5.0 * Float64(y / x))))); else tmp = Float64(t_1 + Float64(x * t)); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = y * (5.0 + (x * 2.0)); tmp = 0.0; if (y <= -8.2e+205) tmp = t_1; elseif (y <= 5.2e+68) tmp = x * (t + ((2.0 * (y + z)) + (5.0 * (y / x)))); else tmp = t_1 + (x * t); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(y * N[(5.0 + N[(x * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -8.2e+205], t$95$1, If[LessEqual[y, 5.2e+68], 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[(t$95$1 + N[(x * t), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := y \cdot \left(5 + x \cdot 2\right)\\
\mathbf{if}\;y \leq -8.2 \cdot 10^{+205}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq 5.2 \cdot 10^{+68}:\\
\;\;\;\;x \cdot \left(t + \left(2 \cdot \left(y + z\right) + 5 \cdot \frac{y}{x}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1 + x \cdot t\\
\end{array}
\end{array}
if y < -8.2000000000000006e205Initial program 99.9%
Taylor expanded in y around inf 99.9%
Simplified99.9%
if -8.2000000000000006e205 < y < 5.1999999999999996e68Initial program 99.4%
fma-define99.4%
associate-+l+99.4%
+-commutative99.4%
count-299.4%
Simplified99.4%
Taylor expanded in x around inf 98.3%
if 5.1999999999999996e68 < y Initial program 99.9%
fma-define99.9%
associate-+l+99.9%
+-commutative99.9%
count-299.9%
Simplified99.9%
Taylor expanded in t around 0 91.0%
Taylor expanded in y around inf 89.6%
associate-*r*89.6%
*-commutative89.6%
*-commutative89.6%
Simplified89.6%
Taylor expanded in y around 0 89.6%
Final simplification96.5%
(FPCore (x y z t) :precision binary64 (if (or (<= x -2.65e-8) (not (<= x 2.75e-33))) (* x (+ t (* 2.0 (+ y z)))) (+ (+ (* y 5.0) (* x t)) (* y (* x 2.0)))))
double code(double x, double y, double z, double t) {
double tmp;
if ((x <= -2.65e-8) || !(x <= 2.75e-33)) {
tmp = x * (t + (2.0 * (y + z)));
} else {
tmp = ((y * 5.0) + (x * t)) + (y * (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 <= (-2.65d-8)) .or. (.not. (x <= 2.75d-33))) then
tmp = x * (t + (2.0d0 * (y + z)))
else
tmp = ((y * 5.0d0) + (x * t)) + (y * (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 <= -2.65e-8) || !(x <= 2.75e-33)) {
tmp = x * (t + (2.0 * (y + z)));
} else {
tmp = ((y * 5.0) + (x * t)) + (y * (x * 2.0));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (x <= -2.65e-8) or not (x <= 2.75e-33): tmp = x * (t + (2.0 * (y + z))) else: tmp = ((y * 5.0) + (x * t)) + (y * (x * 2.0)) return tmp
function code(x, y, z, t) tmp = 0.0 if ((x <= -2.65e-8) || !(x <= 2.75e-33)) tmp = Float64(x * Float64(t + Float64(2.0 * Float64(y + z)))); else tmp = Float64(Float64(Float64(y * 5.0) + Float64(x * t)) + Float64(y * Float64(x * 2.0))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((x <= -2.65e-8) || ~((x <= 2.75e-33))) tmp = x * (t + (2.0 * (y + z))); else tmp = ((y * 5.0) + (x * t)) + (y * (x * 2.0)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[x, -2.65e-8], N[Not[LessEqual[x, 2.75e-33]], $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[(y * N[(x * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -2.65 \cdot 10^{-8} \lor \neg \left(x \leq 2.75 \cdot 10^{-33}\right):\\
\;\;\;\;x \cdot \left(t + 2 \cdot \left(y + z\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(y \cdot 5 + x \cdot t\right) + y \cdot \left(x \cdot 2\right)\\
\end{array}
\end{array}
if x < -2.6499999999999999e-8 or 2.75e-33 < x Initial program 99.9%
fma-define99.9%
associate-+l+99.9%
+-commutative99.9%
count-299.9%
Simplified99.9%
Taylor expanded in x around inf 98.7%
if -2.6499999999999999e-8 < x < 2.75e-33Initial program 99.0%
fma-define99.0%
associate-+l+99.0%
+-commutative99.0%
count-299.0%
Simplified99.0%
Taylor expanded in t around 0 99.9%
Taylor expanded in y around inf 84.0%
associate-*r*84.0%
*-commutative84.0%
*-commutative84.0%
Simplified84.0%
Final simplification92.4%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* y (+ 5.0 (* x 2.0)))))
(if (<= y -1.2e+133)
t_1
(if (<= y -5e-57)
(+ (* y 5.0) (* x t))
(if (<= y 2.1e+85) (* x (+ t (* z 2.0))) 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 <= -1.2e+133) {
tmp = t_1;
} else if (y <= -5e-57) {
tmp = (y * 5.0) + (x * t);
} else if (y <= 2.1e+85) {
tmp = x * (t + (z * 2.0));
} 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 <= (-1.2d+133)) then
tmp = t_1
else if (y <= (-5d-57)) then
tmp = (y * 5.0d0) + (x * t)
else if (y <= 2.1d+85) then
tmp = x * (t + (z * 2.0d0))
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 <= -1.2e+133) {
tmp = t_1;
} else if (y <= -5e-57) {
tmp = (y * 5.0) + (x * t);
} else if (y <= 2.1e+85) {
tmp = x * (t + (z * 2.0));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = y * (5.0 + (x * 2.0)) tmp = 0 if y <= -1.2e+133: tmp = t_1 elif y <= -5e-57: tmp = (y * 5.0) + (x * t) elif y <= 2.1e+85: tmp = x * (t + (z * 2.0)) 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 <= -1.2e+133) tmp = t_1; elseif (y <= -5e-57) tmp = Float64(Float64(y * 5.0) + Float64(x * t)); elseif (y <= 2.1e+85) tmp = Float64(x * Float64(t + Float64(z * 2.0))); 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 <= -1.2e+133) tmp = t_1; elseif (y <= -5e-57) tmp = (y * 5.0) + (x * t); elseif (y <= 2.1e+85) tmp = x * (t + (z * 2.0)); 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, -1.2e+133], t$95$1, If[LessEqual[y, -5e-57], N[(N[(y * 5.0), $MachinePrecision] + N[(x * t), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 2.1e+85], N[(x * N[(t + N[(z * 2.0), $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 -1.2 \cdot 10^{+133}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq -5 \cdot 10^{-57}:\\
\;\;\;\;y \cdot 5 + x \cdot t\\
\mathbf{elif}\;y \leq 2.1 \cdot 10^{+85}:\\
\;\;\;\;x \cdot \left(t + z \cdot 2\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y < -1.1999999999999999e133 or 2.1000000000000001e85 < y Initial program 99.9%
Taylor expanded in y around inf 90.8%
Simplified90.8%
if -1.1999999999999999e133 < y < -5.0000000000000002e-57Initial program 97.1%
Taylor expanded in t around inf 70.9%
Simplified70.9%
if -5.0000000000000002e-57 < y < 2.1000000000000001e85Initial program 99.9%
fma-define99.9%
associate-+l+99.9%
+-commutative99.9%
count-299.9%
Simplified99.9%
Taylor expanded in t around 0 97.8%
Taylor expanded in y around 0 82.4%
+-commutative82.4%
*-commutative82.4%
*-commutative82.4%
associate-*l*82.4%
*-commutative82.4%
distribute-lft-in84.6%
Simplified84.6%
Final simplification84.8%
(FPCore (x y z t) :precision binary64 (if (or (<= x -1.6e-18) (not (<= x 2.55e-37))) (* 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 <= -1.6e-18) || !(x <= 2.55e-37)) {
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 <= (-1.6d-18)) .or. (.not. (x <= 2.55d-37))) 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 <= -1.6e-18) || !(x <= 2.55e-37)) {
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 <= -1.6e-18) or not (x <= 2.55e-37): 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 <= -1.6e-18) || !(x <= 2.55e-37)) 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 <= -1.6e-18) || ~((x <= 2.55e-37))) 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, -1.6e-18], N[Not[LessEqual[x, 2.55e-37]], $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 -1.6 \cdot 10^{-18} \lor \neg \left(x \leq 2.55 \cdot 10^{-37}\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 < -1.6e-18 or 2.55e-37 < x Initial program 99.9%
fma-define99.9%
associate-+l+99.9%
+-commutative99.9%
count-299.9%
Simplified99.9%
Taylor expanded in x around inf 98.0%
if -1.6e-18 < x < 2.55e-37Initial program 99.0%
Taylor expanded in t around inf 84.6%
Simplified84.6%
Final simplification92.4%
(FPCore (x y z t) :precision binary64 (+ (* y 5.0) (* x (+ t (+ y (+ z (+ y z)))))))
double code(double x, double y, double z, double t) {
return (y * 5.0) + (x * (t + (y + (z + (y + z)))));
}
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) + (x * (t + (y + (z + (y + z)))))
end function
public static double code(double x, double y, double z, double t) {
return (y * 5.0) + (x * (t + (y + (z + (y + z)))));
}
def code(x, y, z, t): return (y * 5.0) + (x * (t + (y + (z + (y + z)))))
function code(x, y, z, t) return Float64(Float64(y * 5.0) + Float64(x * Float64(t + Float64(y + Float64(z + Float64(y + z)))))) end
function tmp = code(x, y, z, t) tmp = (y * 5.0) + (x * (t + (y + (z + (y + z))))); end
code[x_, y_, z_, t_] := N[(N[(y * 5.0), $MachinePrecision] + N[(x * N[(t + N[(y + N[(z + N[(y + z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
y \cdot 5 + x \cdot \left(t + \left(y + \left(z + \left(y + z\right)\right)\right)\right)
\end{array}
Initial program 99.5%
Final simplification99.5%
(FPCore (x y z t) :precision binary64 (if (or (<= x -1.6e-34) (not (<= x 6.4e-62))) (* x t) (* y 5.0)))
double code(double x, double y, double z, double t) {
double tmp;
if ((x <= -1.6e-34) || !(x <= 6.4e-62)) {
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 <= (-1.6d-34)) .or. (.not. (x <= 6.4d-62))) 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 <= -1.6e-34) || !(x <= 6.4e-62)) {
tmp = x * t;
} else {
tmp = y * 5.0;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (x <= -1.6e-34) or not (x <= 6.4e-62): tmp = x * t else: tmp = y * 5.0 return tmp
function code(x, y, z, t) tmp = 0.0 if ((x <= -1.6e-34) || !(x <= 6.4e-62)) 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 <= -1.6e-34) || ~((x <= 6.4e-62))) tmp = x * t; else tmp = y * 5.0; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[x, -1.6e-34], N[Not[LessEqual[x, 6.4e-62]], $MachinePrecision]], N[(x * t), $MachinePrecision], N[(y * 5.0), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.6 \cdot 10^{-34} \lor \neg \left(x \leq 6.4 \cdot 10^{-62}\right):\\
\;\;\;\;x \cdot t\\
\mathbf{else}:\\
\;\;\;\;y \cdot 5\\
\end{array}
\end{array}
if x < -1.60000000000000001e-34 or 6.40000000000000043e-62 < x Initial program 100.0%
fma-define100.0%
associate-+l+100.0%
+-commutative100.0%
count-2100.0%
Simplified100.0%
Taylor expanded in t around 0 92.5%
Taylor expanded in t around inf 39.6%
*-commutative39.6%
Simplified39.6%
if -1.60000000000000001e-34 < x < 6.40000000000000043e-62Initial program 98.9%
Taylor expanded in x around 0 66.1%
Simplified66.1%
Final simplification49.5%
(FPCore (x y z t) :precision binary64 (* x t))
double code(double x, double y, double z, double t) {
return x * t;
}
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
end function
public static double code(double x, double y, double z, double t) {
return x * t;
}
def code(x, y, z, t): return x * t
function code(x, y, z, t) return Float64(x * t) end
function tmp = code(x, y, z, t) tmp = x * t; end
code[x_, y_, z_, t_] := N[(x * t), $MachinePrecision]
\begin{array}{l}
\\
x \cdot t
\end{array}
Initial program 99.5%
fma-define99.5%
associate-+l+99.5%
+-commutative99.5%
count-299.5%
Simplified99.5%
Taylor expanded in t around 0 95.2%
Taylor expanded in t around inf 32.1%
*-commutative32.1%
Simplified32.1%
herbie shell --seed 2024091
(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)))