
(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 19 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-define99.9%
associate-+l+99.9%
associate-+l+99.9%
Simplified99.9%
(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-define99.9%
associate-+l+99.9%
+-commutative99.9%
count-299.9%
Simplified99.9%
Final simplification99.9%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* x (+ t (* z 2.0)))))
(if (<= x -8.5e+175)
(* x (* 2.0 (+ y z)))
(if (<= x -8.5e-49)
t_1
(if (<= x 1.6e-75)
(* y 5.0)
(if (<= x 1.05e+55) 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 <= -8.5e+175) {
tmp = x * (2.0 * (y + z));
} else if (x <= -8.5e-49) {
tmp = t_1;
} else if (x <= 1.6e-75) {
tmp = y * 5.0;
} else if (x <= 1.05e+55) {
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 <= (-8.5d+175)) then
tmp = x * (2.0d0 * (y + z))
else if (x <= (-8.5d-49)) then
tmp = t_1
else if (x <= 1.6d-75) then
tmp = y * 5.0d0
else if (x <= 1.05d+55) 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 <= -8.5e+175) {
tmp = x * (2.0 * (y + z));
} else if (x <= -8.5e-49) {
tmp = t_1;
} else if (x <= 1.6e-75) {
tmp = y * 5.0;
} else if (x <= 1.05e+55) {
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 <= -8.5e+175: tmp = x * (2.0 * (y + z)) elif x <= -8.5e-49: tmp = t_1 elif x <= 1.6e-75: tmp = y * 5.0 elif x <= 1.05e+55: 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 <= -8.5e+175) tmp = Float64(x * Float64(2.0 * Float64(y + z))); elseif (x <= -8.5e-49) tmp = t_1; elseif (x <= 1.6e-75) tmp = Float64(y * 5.0); elseif (x <= 1.05e+55) 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 <= -8.5e+175) tmp = x * (2.0 * (y + z)); elseif (x <= -8.5e-49) tmp = t_1; elseif (x <= 1.6e-75) tmp = y * 5.0; elseif (x <= 1.05e+55) 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, -8.5e+175], N[(x * N[(2.0 * N[(y + z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, -8.5e-49], t$95$1, If[LessEqual[x, 1.6e-75], N[(y * 5.0), $MachinePrecision], If[LessEqual[x, 1.05e+55], 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 -8.5 \cdot 10^{+175}:\\
\;\;\;\;x \cdot \left(2 \cdot \left(y + z\right)\right)\\
\mathbf{elif}\;x \leq -8.5 \cdot 10^{-49}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \leq 1.6 \cdot 10^{-75}:\\
\;\;\;\;y \cdot 5\\
\mathbf{elif}\;x \leq 1.05 \cdot 10^{+55}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(t + y \cdot 2\right)\\
\end{array}
\end{array}
if x < -8.50000000000000034e175Initial 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 t around 0 91.0%
associate-*r*91.0%
*-commutative91.0%
associate-*l*91.0%
+-commutative91.0%
Simplified91.0%
if -8.50000000000000034e175 < x < -8.50000000000000069e-49 or 1.59999999999999988e-75 < x < 1.05e55Initial program 99.9%
Taylor expanded in y around 0 74.3%
if -8.50000000000000069e-49 < x < 1.59999999999999988e-75Initial program 99.9%
Taylor expanded in x around 0 65.3%
if 1.05e55 < 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%
Taylor expanded in z around 0 92.4%
Final simplification76.5%
(FPCore (x y z t) :precision binary64 (if (or (<= x -1.65e-62) (not (<= x 4e-32))) (* x (+ t (+ (* 2.0 (+ y z)) (* 5.0 (/ y x))))) (+ (* x (+ t (* z 2.0))) (* y 5.0))))
double code(double x, double y, double z, double t) {
double tmp;
if ((x <= -1.65e-62) || !(x <= 4e-32)) {
tmp = x * (t + ((2.0 * (y + z)) + (5.0 * (y / x))));
} else {
tmp = (x * (t + (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 <= (-1.65d-62)) .or. (.not. (x <= 4d-32))) then
tmp = x * (t + ((2.0d0 * (y + z)) + (5.0d0 * (y / x))))
else
tmp = (x * (t + (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 <= -1.65e-62) || !(x <= 4e-32)) {
tmp = x * (t + ((2.0 * (y + z)) + (5.0 * (y / x))));
} else {
tmp = (x * (t + (z * 2.0))) + (y * 5.0);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (x <= -1.65e-62) or not (x <= 4e-32): tmp = x * (t + ((2.0 * (y + z)) + (5.0 * (y / x)))) else: tmp = (x * (t + (z * 2.0))) + (y * 5.0) return tmp
function code(x, y, z, t) tmp = 0.0 if ((x <= -1.65e-62) || !(x <= 4e-32)) tmp = Float64(x * Float64(t + Float64(Float64(2.0 * Float64(y + z)) + Float64(5.0 * Float64(y / x))))); else tmp = Float64(Float64(x * Float64(t + Float64(z * 2.0))) + Float64(y * 5.0)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((x <= -1.65e-62) || ~((x <= 4e-32))) tmp = x * (t + ((2.0 * (y + z)) + (5.0 * (y / x)))); else tmp = (x * (t + (z * 2.0))) + (y * 5.0); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[x, -1.65e-62], N[Not[LessEqual[x, 4e-32]], $MachinePrecision]], N[(x * N[(t + N[(N[(2.0 * N[(y + z), $MachinePrecision]), $MachinePrecision] + N[(5.0 * N[(y / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x * N[(t + N[(z * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(y * 5.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.65 \cdot 10^{-62} \lor \neg \left(x \leq 4 \cdot 10^{-32}\right):\\
\;\;\;\;x \cdot \left(t + \left(2 \cdot \left(y + z\right) + 5 \cdot \frac{y}{x}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(t + z \cdot 2\right) + y \cdot 5\\
\end{array}
\end{array}
if x < -1.65000000000000002e-62 or 4.00000000000000022e-32 < x Initial program 99.9%
fma-define100.0%
associate-+l+100.0%
+-commutative100.0%
count-2100.0%
Simplified100.0%
Taylor expanded in x around inf 100.0%
if -1.65000000000000002e-62 < x < 4.00000000000000022e-32Initial program 99.9%
Taylor expanded in y around 0 99.9%
Final simplification99.9%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* 2.0 (+ y z))))
(if (<= x -5e+157)
(* x (+ t t_1))
(if (<= x 2e-27)
(+ (* 2.0 (* x (+ y z))) (+ (* y 5.0) (* x t)))
(* x (+ t (+ t_1 (* 5.0 (/ y x)))))))))
double code(double x, double y, double z, double t) {
double t_1 = 2.0 * (y + z);
double tmp;
if (x <= -5e+157) {
tmp = x * (t + t_1);
} else if (x <= 2e-27) {
tmp = (2.0 * (x * (y + z))) + ((y * 5.0) + (x * t));
} else {
tmp = x * (t + (t_1 + (5.0 * (y / x))));
}
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 <= (-5d+157)) then
tmp = x * (t + t_1)
else if (x <= 2d-27) then
tmp = (2.0d0 * (x * (y + z))) + ((y * 5.0d0) + (x * t))
else
tmp = x * (t + (t_1 + (5.0d0 * (y / x))))
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 <= -5e+157) {
tmp = x * (t + t_1);
} else if (x <= 2e-27) {
tmp = (2.0 * (x * (y + z))) + ((y * 5.0) + (x * t));
} else {
tmp = x * (t + (t_1 + (5.0 * (y / x))));
}
return tmp;
}
def code(x, y, z, t): t_1 = 2.0 * (y + z) tmp = 0 if x <= -5e+157: tmp = x * (t + t_1) elif x <= 2e-27: tmp = (2.0 * (x * (y + z))) + ((y * 5.0) + (x * t)) else: tmp = x * (t + (t_1 + (5.0 * (y / x)))) return tmp
function code(x, y, z, t) t_1 = Float64(2.0 * Float64(y + z)) tmp = 0.0 if (x <= -5e+157) tmp = Float64(x * Float64(t + t_1)); elseif (x <= 2e-27) tmp = Float64(Float64(2.0 * Float64(x * Float64(y + z))) + Float64(Float64(y * 5.0) + Float64(x * t))); else tmp = Float64(x * Float64(t + Float64(t_1 + Float64(5.0 * Float64(y / x))))); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = 2.0 * (y + z); tmp = 0.0; if (x <= -5e+157) tmp = x * (t + t_1); elseif (x <= 2e-27) tmp = (2.0 * (x * (y + z))) + ((y * 5.0) + (x * t)); else tmp = x * (t + (t_1 + (5.0 * (y / x)))); 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, -5e+157], N[(x * N[(t + t$95$1), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 2e-27], 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 + N[(t$95$1 + N[(5.0 * N[(y / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := 2 \cdot \left(y + z\right)\\
\mathbf{if}\;x \leq -5 \cdot 10^{+157}:\\
\;\;\;\;x \cdot \left(t + t\_1\right)\\
\mathbf{elif}\;x \leq 2 \cdot 10^{-27}:\\
\;\;\;\;2 \cdot \left(x \cdot \left(y + z\right)\right) + \left(y \cdot 5 + x \cdot t\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(t + \left(t\_1 + 5 \cdot \frac{y}{x}\right)\right)\\
\end{array}
\end{array}
if x < -4.99999999999999976e157Initial program 100.0%
fma-define100.0%
associate-+l+100.0%
+-commutative100.0%
count-2100.0%
Simplified100.0%
Taylor expanded in x around inf 100.0%
if -4.99999999999999976e157 < x < 2.0000000000000001e-27Initial 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%
if 2.0000000000000001e-27 < 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
(let* ((t_1 (* x (* 2.0 (+ y z)))))
(if (<= x -3.8e-37)
t_1
(if (<= x 1.45e-92) (* y 5.0) (if (<= x 7.8e+49) t_1 (* x (+ y t)))))))
double code(double x, double y, double z, double t) {
double t_1 = x * (2.0 * (y + z));
double tmp;
if (x <= -3.8e-37) {
tmp = t_1;
} else if (x <= 1.45e-92) {
tmp = y * 5.0;
} else if (x <= 7.8e+49) {
tmp = t_1;
} else {
tmp = x * (y + 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 = x * (2.0d0 * (y + z))
if (x <= (-3.8d-37)) then
tmp = t_1
else if (x <= 1.45d-92) then
tmp = y * 5.0d0
else if (x <= 7.8d+49) then
tmp = t_1
else
tmp = x * (y + t)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = x * (2.0 * (y + z));
double tmp;
if (x <= -3.8e-37) {
tmp = t_1;
} else if (x <= 1.45e-92) {
tmp = y * 5.0;
} else if (x <= 7.8e+49) {
tmp = t_1;
} else {
tmp = x * (y + t);
}
return tmp;
}
def code(x, y, z, t): t_1 = x * (2.0 * (y + z)) tmp = 0 if x <= -3.8e-37: tmp = t_1 elif x <= 1.45e-92: tmp = y * 5.0 elif x <= 7.8e+49: tmp = t_1 else: tmp = x * (y + t) return tmp
function code(x, y, z, t) t_1 = Float64(x * Float64(2.0 * Float64(y + z))) tmp = 0.0 if (x <= -3.8e-37) tmp = t_1; elseif (x <= 1.45e-92) tmp = Float64(y * 5.0); elseif (x <= 7.8e+49) tmp = t_1; else tmp = Float64(x * Float64(y + t)); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = x * (2.0 * (y + z)); tmp = 0.0; if (x <= -3.8e-37) tmp = t_1; elseif (x <= 1.45e-92) tmp = y * 5.0; elseif (x <= 7.8e+49) tmp = t_1; else tmp = x * (y + t); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(x * N[(2.0 * N[(y + z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -3.8e-37], t$95$1, If[LessEqual[x, 1.45e-92], N[(y * 5.0), $MachinePrecision], If[LessEqual[x, 7.8e+49], t$95$1, N[(x * N[(y + t), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot \left(2 \cdot \left(y + z\right)\right)\\
\mathbf{if}\;x \leq -3.8 \cdot 10^{-37}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \leq 1.45 \cdot 10^{-92}:\\
\;\;\;\;y \cdot 5\\
\mathbf{elif}\;x \leq 7.8 \cdot 10^{+49}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(y + t\right)\\
\end{array}
\end{array}
if x < -3.8000000000000004e-37 or 1.44999999999999992e-92 < x < 7.8000000000000002e49Initial program 99.9%
fma-define99.9%
associate-+l+99.9%
+-commutative99.9%
count-299.9%
Simplified99.9%
Taylor expanded in x around inf 90.7%
Taylor expanded in t around 0 67.1%
associate-*r*67.1%
*-commutative67.1%
associate-*l*67.1%
+-commutative67.1%
Simplified67.1%
if -3.8000000000000004e-37 < x < 1.44999999999999992e-92Initial program 99.9%
Taylor expanded in x around 0 64.3%
if 7.8000000000000002e49 < x Initial program 100.0%
Taylor expanded in x around inf 100.0%
Simplified86.2%
Taylor expanded in z around 0 80.3%
Final simplification68.7%
(FPCore (x y z t) :precision binary64 (if (or (<= x -2.5) (not (<= x 0.00105))) (* x (+ t (* 2.0 (+ y z)))) (+ (* x (+ t (* z 2.0))) (* y 5.0))))
double code(double x, double y, double z, double t) {
double tmp;
if ((x <= -2.5) || !(x <= 0.00105)) {
tmp = x * (t + (2.0 * (y + z)));
} else {
tmp = (x * (t + (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 <= 0.00105d0))) then
tmp = x * (t + (2.0d0 * (y + z)))
else
tmp = (x * (t + (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 <= 0.00105)) {
tmp = x * (t + (2.0 * (y + z)));
} else {
tmp = (x * (t + (z * 2.0))) + (y * 5.0);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (x <= -2.5) or not (x <= 0.00105): tmp = x * (t + (2.0 * (y + z))) else: tmp = (x * (t + (z * 2.0))) + (y * 5.0) return tmp
function code(x, y, z, t) tmp = 0.0 if ((x <= -2.5) || !(x <= 0.00105)) tmp = Float64(x * Float64(t + Float64(2.0 * Float64(y + z)))); else tmp = Float64(Float64(x * Float64(t + 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 <= 0.00105))) tmp = x * (t + (2.0 * (y + z))); else tmp = (x * (t + (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, 0.00105]], $MachinePrecision]], N[(x * N[(t + N[(2.0 * N[(y + z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x * N[(t + N[(z * 2.0), $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 0.00105\right):\\
\;\;\;\;x \cdot \left(t + 2 \cdot \left(y + z\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(t + z \cdot 2\right) + y \cdot 5\\
\end{array}
\end{array}
if x < -2.5 or 0.00104999999999999994 < 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.1%
if -2.5 < x < 0.00104999999999999994Initial program 99.9%
Taylor expanded in y around 0 99.4%
Final simplification99.2%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* 2.0 (* x z))))
(if (<= z -1.85e+50)
t_1
(if (<= z -5.2e-38) (* y 5.0) (if (<= z 1.6e+54) (* x t) t_1)))))
double code(double x, double y, double z, double t) {
double t_1 = 2.0 * (x * z);
double tmp;
if (z <= -1.85e+50) {
tmp = t_1;
} else if (z <= -5.2e-38) {
tmp = y * 5.0;
} else if (z <= 1.6e+54) {
tmp = x * t;
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: tmp
t_1 = 2.0d0 * (x * z)
if (z <= (-1.85d+50)) then
tmp = t_1
else if (z <= (-5.2d-38)) then
tmp = y * 5.0d0
else if (z <= 1.6d+54) then
tmp = x * t
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = 2.0 * (x * z);
double tmp;
if (z <= -1.85e+50) {
tmp = t_1;
} else if (z <= -5.2e-38) {
tmp = y * 5.0;
} else if (z <= 1.6e+54) {
tmp = x * t;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = 2.0 * (x * z) tmp = 0 if z <= -1.85e+50: tmp = t_1 elif z <= -5.2e-38: tmp = y * 5.0 elif z <= 1.6e+54: tmp = x * t else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(2.0 * Float64(x * z)) tmp = 0.0 if (z <= -1.85e+50) tmp = t_1; elseif (z <= -5.2e-38) tmp = Float64(y * 5.0); elseif (z <= 1.6e+54) tmp = Float64(x * t); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = 2.0 * (x * z); tmp = 0.0; if (z <= -1.85e+50) tmp = t_1; elseif (z <= -5.2e-38) tmp = y * 5.0; elseif (z <= 1.6e+54) tmp = x * t; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(2.0 * N[(x * z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -1.85e+50], t$95$1, If[LessEqual[z, -5.2e-38], N[(y * 5.0), $MachinePrecision], If[LessEqual[z, 1.6e+54], N[(x * t), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := 2 \cdot \left(x \cdot z\right)\\
\mathbf{if}\;z \leq -1.85 \cdot 10^{+50}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq -5.2 \cdot 10^{-38}:\\
\;\;\;\;y \cdot 5\\
\mathbf{elif}\;z \leq 1.6 \cdot 10^{+54}:\\
\;\;\;\;x \cdot t\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -1.85e50 or 1.6e54 < z Initial program 99.9%
Taylor expanded in z around inf 65.2%
if -1.85e50 < z < -5.20000000000000022e-38Initial program 99.9%
Taylor expanded in x around 0 57.0%
if -5.20000000000000022e-38 < z < 1.6e54Initial program 99.9%
Taylor expanded in t around inf 45.3%
Simplified45.3%
Final simplification54.7%
(FPCore (x y z t) :precision binary64 (if (or (<= x -1.15e-14) (not (<= x 3e-28))) (* x (+ t (* 2.0 (+ y z)))) (+ (* y 5.0) (* 2.0 (* x z)))))
double code(double x, double y, double z, double t) {
double tmp;
if ((x <= -1.15e-14) || !(x <= 3e-28)) {
tmp = x * (t + (2.0 * (y + z)));
} else {
tmp = (y * 5.0) + (2.0 * (x * z));
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if ((x <= (-1.15d-14)) .or. (.not. (x <= 3d-28))) then
tmp = x * (t + (2.0d0 * (y + z)))
else
tmp = (y * 5.0d0) + (2.0d0 * (x * z))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((x <= -1.15e-14) || !(x <= 3e-28)) {
tmp = x * (t + (2.0 * (y + z)));
} else {
tmp = (y * 5.0) + (2.0 * (x * z));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (x <= -1.15e-14) or not (x <= 3e-28): tmp = x * (t + (2.0 * (y + z))) else: tmp = (y * 5.0) + (2.0 * (x * z)) return tmp
function code(x, y, z, t) tmp = 0.0 if ((x <= -1.15e-14) || !(x <= 3e-28)) tmp = Float64(x * Float64(t + Float64(2.0 * Float64(y + z)))); else tmp = Float64(Float64(y * 5.0) + Float64(2.0 * Float64(x * z))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((x <= -1.15e-14) || ~((x <= 3e-28))) tmp = x * (t + (2.0 * (y + z))); else tmp = (y * 5.0) + (2.0 * (x * z)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[x, -1.15e-14], N[Not[LessEqual[x, 3e-28]], $MachinePrecision]], N[(x * N[(t + N[(2.0 * N[(y + z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(y * 5.0), $MachinePrecision] + N[(2.0 * N[(x * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.15 \cdot 10^{-14} \lor \neg \left(x \leq 3 \cdot 10^{-28}\right):\\
\;\;\;\;x \cdot \left(t + 2 \cdot \left(y + z\right)\right)\\
\mathbf{else}:\\
\;\;\;\;y \cdot 5 + 2 \cdot \left(x \cdot z\right)\\
\end{array}
\end{array}
if x < -1.14999999999999999e-14 or 3.00000000000000003e-28 < 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 98.6%
if -1.14999999999999999e-14 < x < 3.00000000000000003e-28Initial program 99.8%
Taylor expanded in y around 0 99.8%
Taylor expanded in t around 0 83.5%
Final simplification91.7%
(FPCore (x y z t) :precision binary64 (if (or (<= x -2.1e-37) (not (<= x 9.2e-94))) (* 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 <= -2.1e-37) || !(x <= 9.2e-94)) {
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 <= (-2.1d-37)) .or. (.not. (x <= 9.2d-94))) 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 <= -2.1e-37) || !(x <= 9.2e-94)) {
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 <= -2.1e-37) or not (x <= 9.2e-94): 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 <= -2.1e-37) || !(x <= 9.2e-94)) 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 <= -2.1e-37) || ~((x <= 9.2e-94))) 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, -2.1e-37], N[Not[LessEqual[x, 9.2e-94]], $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 -2.1 \cdot 10^{-37} \lor \neg \left(x \leq 9.2 \cdot 10^{-94}\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 < -2.1000000000000001e-37 or 9.1999999999999997e-94 < x Initial program 99.9%
fma-define100.0%
associate-+l+100.0%
+-commutative100.0%
count-2100.0%
Simplified100.0%
Taylor expanded in x around inf 93.8%
if -2.1000000000000001e-37 < x < 9.1999999999999997e-94Initial program 99.9%
associate-+l+99.9%
+-commutative99.9%
flip-+0.0%
pow20.0%
pow20.0%
Applied egg-rr0.0%
Simplified81.0%
Taylor expanded in x around 0 81.0%
Final simplification88.9%
(FPCore (x y z t) :precision binary64 (if (<= x -2.7e+174) (* x y) (if (or (<= x -1e-47) (not (<= x 1.35e-24))) (* x t) (* y 5.0))))
double code(double x, double y, double z, double t) {
double tmp;
if (x <= -2.7e+174) {
tmp = x * y;
} else if ((x <= -1e-47) || !(x <= 1.35e-24)) {
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 <= (-2.7d+174)) then
tmp = x * y
else if ((x <= (-1d-47)) .or. (.not. (x <= 1.35d-24))) 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 <= -2.7e+174) {
tmp = x * y;
} else if ((x <= -1e-47) || !(x <= 1.35e-24)) {
tmp = x * t;
} else {
tmp = y * 5.0;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if x <= -2.7e+174: tmp = x * y elif (x <= -1e-47) or not (x <= 1.35e-24): tmp = x * t else: tmp = y * 5.0 return tmp
function code(x, y, z, t) tmp = 0.0 if (x <= -2.7e+174) tmp = Float64(x * y); elseif ((x <= -1e-47) || !(x <= 1.35e-24)) 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 <= -2.7e+174) tmp = x * y; elseif ((x <= -1e-47) || ~((x <= 1.35e-24))) tmp = x * t; else tmp = y * 5.0; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[x, -2.7e+174], N[(x * y), $MachinePrecision], If[Or[LessEqual[x, -1e-47], N[Not[LessEqual[x, 1.35e-24]], $MachinePrecision]], N[(x * t), $MachinePrecision], N[(y * 5.0), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -2.7 \cdot 10^{+174}:\\
\;\;\;\;x \cdot y\\
\mathbf{elif}\;x \leq -1 \cdot 10^{-47} \lor \neg \left(x \leq 1.35 \cdot 10^{-24}\right):\\
\;\;\;\;x \cdot t\\
\mathbf{else}:\\
\;\;\;\;y \cdot 5\\
\end{array}
\end{array}
if x < -2.6999999999999999e174Initial program 100.0%
Taylor expanded in x around inf 100.0%
Simplified77.1%
Taylor expanded in y around inf 41.1%
if -2.6999999999999999e174 < x < -9.9999999999999997e-48 or 1.35000000000000003e-24 < x Initial program 100.0%
Taylor expanded in t around inf 42.7%
Simplified42.7%
if -9.9999999999999997e-48 < x < 1.35000000000000003e-24Initial program 99.8%
Taylor expanded in x around 0 62.3%
Final simplification50.9%
(FPCore (x y z t) :precision binary64 (if (or (<= y -2.2e+17) (not (<= y 5.8e-8))) (* 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.2e+17) || !(y <= 5.8e-8)) {
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.2d+17)) .or. (.not. (y <= 5.8d-8))) 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.2e+17) || !(y <= 5.8e-8)) {
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.2e+17) or not (y <= 5.8e-8): 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.2e+17) || !(y <= 5.8e-8)) 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.2e+17) || ~((y <= 5.8e-8))) 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.2e+17], N[Not[LessEqual[y, 5.8e-8]], $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.2 \cdot 10^{+17} \lor \neg \left(y \leq 5.8 \cdot 10^{-8}\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.2e17 or 5.8000000000000003e-8 < y Initial program 99.9%
Taylor expanded in y around inf 77.6%
if -2.2e17 < y < 5.8000000000000003e-8Initial program 99.9%
Taylor expanded in y around 0 83.9%
Final simplification80.6%
(FPCore (x y z t) :precision binary64 (if (<= x -1.1e-36) (* x (* 2.0 (+ y z))) (if (<= x 2.2e-28) (* y 5.0) (* x (+ t (* y 2.0))))))
double code(double x, double y, double z, double t) {
double tmp;
if (x <= -1.1e-36) {
tmp = x * (2.0 * (y + z));
} else if (x <= 2.2e-28) {
tmp = y * 5.0;
} 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) :: tmp
if (x <= (-1.1d-36)) then
tmp = x * (2.0d0 * (y + z))
else if (x <= 2.2d-28) then
tmp = y * 5.0d0
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 tmp;
if (x <= -1.1e-36) {
tmp = x * (2.0 * (y + z));
} else if (x <= 2.2e-28) {
tmp = y * 5.0;
} else {
tmp = x * (t + (y * 2.0));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if x <= -1.1e-36: tmp = x * (2.0 * (y + z)) elif x <= 2.2e-28: tmp = y * 5.0 else: tmp = x * (t + (y * 2.0)) return tmp
function code(x, y, z, t) tmp = 0.0 if (x <= -1.1e-36) tmp = Float64(x * Float64(2.0 * Float64(y + z))); elseif (x <= 2.2e-28) tmp = Float64(y * 5.0); else tmp = Float64(x * Float64(t + Float64(y * 2.0))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (x <= -1.1e-36) tmp = x * (2.0 * (y + z)); elseif (x <= 2.2e-28) tmp = y * 5.0; else tmp = x * (t + (y * 2.0)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[x, -1.1e-36], N[(x * N[(2.0 * N[(y + z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 2.2e-28], N[(y * 5.0), $MachinePrecision], N[(x * N[(t + N[(y * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.1 \cdot 10^{-36}:\\
\;\;\;\;x \cdot \left(2 \cdot \left(y + z\right)\right)\\
\mathbf{elif}\;x \leq 2.2 \cdot 10^{-28}:\\
\;\;\;\;y \cdot 5\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(t + y \cdot 2\right)\\
\end{array}
\end{array}
if x < -1.1e-36Initial program 100.0%
fma-define100.0%
associate-+l+100.0%
+-commutative100.0%
count-2100.0%
Simplified100.0%
Taylor expanded in x around inf 96.9%
Taylor expanded in t around 0 73.6%
associate-*r*73.6%
*-commutative73.6%
associate-*l*73.6%
+-commutative73.6%
Simplified73.6%
if -1.1e-36 < x < 2.19999999999999996e-28Initial program 99.8%
Taylor expanded in x around 0 61.1%
if 2.19999999999999996e-28 < 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 98.4%
Taylor expanded in z around 0 79.4%
Final simplification69.6%
(FPCore (x y z t) :precision binary64 (if (or (<= x -7.5e-15) (not (<= x 2.1e-23))) (* x (+ y t)) (* y 5.0)))
double code(double x, double y, double z, double t) {
double tmp;
if ((x <= -7.5e-15) || !(x <= 2.1e-23)) {
tmp = x * (y + 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 <= (-7.5d-15)) .or. (.not. (x <= 2.1d-23))) then
tmp = x * (y + 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 <= -7.5e-15) || !(x <= 2.1e-23)) {
tmp = x * (y + t);
} else {
tmp = y * 5.0;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (x <= -7.5e-15) or not (x <= 2.1e-23): tmp = x * (y + t) else: tmp = y * 5.0 return tmp
function code(x, y, z, t) tmp = 0.0 if ((x <= -7.5e-15) || !(x <= 2.1e-23)) tmp = Float64(x * Float64(y + t)); else tmp = Float64(y * 5.0); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((x <= -7.5e-15) || ~((x <= 2.1e-23))) tmp = x * (y + t); else tmp = y * 5.0; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[x, -7.5e-15], N[Not[LessEqual[x, 2.1e-23]], $MachinePrecision]], N[(x * N[(y + t), $MachinePrecision]), $MachinePrecision], N[(y * 5.0), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -7.5 \cdot 10^{-15} \lor \neg \left(x \leq 2.1 \cdot 10^{-23}\right):\\
\;\;\;\;x \cdot \left(y + t\right)\\
\mathbf{else}:\\
\;\;\;\;y \cdot 5\\
\end{array}
\end{array}
if x < -7.4999999999999996e-15 or 2.1000000000000001e-23 < x Initial program 100.0%
Taylor expanded in x around inf 98.6%
Simplified71.3%
Taylor expanded in z around 0 59.1%
if -7.4999999999999996e-15 < x < 2.1000000000000001e-23Initial program 99.8%
Taylor expanded in x around 0 60.4%
Final simplification59.7%
(FPCore (x y z t) :precision binary64 (if (<= x -3.6e-47) (* x (+ z t)) (if (<= x 1.6e-26) (* y 5.0) (* x (+ y t)))))
double code(double x, double y, double z, double t) {
double tmp;
if (x <= -3.6e-47) {
tmp = x * (z + t);
} else if (x <= 1.6e-26) {
tmp = y * 5.0;
} else {
tmp = x * (y + 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-47)) then
tmp = x * (z + t)
else if (x <= 1.6d-26) then
tmp = y * 5.0d0
else
tmp = x * (y + 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-47) {
tmp = x * (z + t);
} else if (x <= 1.6e-26) {
tmp = y * 5.0;
} else {
tmp = x * (y + t);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if x <= -3.6e-47: tmp = x * (z + t) elif x <= 1.6e-26: tmp = y * 5.0 else: tmp = x * (y + t) return tmp
function code(x, y, z, t) tmp = 0.0 if (x <= -3.6e-47) tmp = Float64(x * Float64(z + t)); elseif (x <= 1.6e-26) tmp = Float64(y * 5.0); else tmp = Float64(x * Float64(y + t)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (x <= -3.6e-47) tmp = x * (z + t); elseif (x <= 1.6e-26) tmp = y * 5.0; else tmp = x * (y + t); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[x, -3.6e-47], N[(x * N[(z + t), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 1.6e-26], N[(y * 5.0), $MachinePrecision], N[(x * N[(y + t), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -3.6 \cdot 10^{-47}:\\
\;\;\;\;x \cdot \left(z + t\right)\\
\mathbf{elif}\;x \leq 1.6 \cdot 10^{-26}:\\
\;\;\;\;y \cdot 5\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(y + t\right)\\
\end{array}
\end{array}
if x < -3.59999999999999991e-47Initial program 100.0%
Taylor expanded in x around inf 95.7%
Simplified63.8%
Taylor expanded in y around 0 52.7%
if -3.59999999999999991e-47 < x < 1.6000000000000001e-26Initial program 99.8%
Taylor expanded in x around 0 62.3%
if 1.6000000000000001e-26 < x Initial program 100.0%
Taylor expanded in x around inf 98.4%
Simplified75.8%
Taylor expanded in z around 0 69.4%
Final simplification61.5%
(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 (+ (* x (+ t (* z 2.0))) (* y (+ 5.0 (* x 2.0)))))
double code(double x, double y, double z, double t) {
return (x * (t + (z * 2.0))) + (y * (5.0 + (x * 2.0)));
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = (x * (t + (z * 2.0d0))) + (y * (5.0d0 + (x * 2.0d0)))
end function
public static double code(double x, double y, double z, double t) {
return (x * (t + (z * 2.0))) + (y * (5.0 + (x * 2.0)));
}
def code(x, y, z, t): return (x * (t + (z * 2.0))) + (y * (5.0 + (x * 2.0)))
function code(x, y, z, t) return Float64(Float64(x * Float64(t + Float64(z * 2.0))) + Float64(y * Float64(5.0 + Float64(x * 2.0)))) end
function tmp = code(x, y, z, t) tmp = (x * (t + (z * 2.0))) + (y * (5.0 + (x * 2.0))); end
code[x_, y_, z_, t_] := N[(N[(x * N[(t + N[(z * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(y * N[(5.0 + N[(x * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x \cdot \left(t + z \cdot 2\right) + y \cdot \left(5 + x \cdot 2\right)
\end{array}
Initial program 99.9%
Taylor expanded in y around 0 97.6%
Final simplification97.6%
(FPCore (x y z t) :precision binary64 (if (or (<= x -5e-48) (not (<= x 7.5e-28))) (* x t) (* y 5.0)))
double code(double x, double y, double z, double t) {
double tmp;
if ((x <= -5e-48) || !(x <= 7.5e-28)) {
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 <= (-5d-48)) .or. (.not. (x <= 7.5d-28))) 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 <= -5e-48) || !(x <= 7.5e-28)) {
tmp = x * t;
} else {
tmp = y * 5.0;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (x <= -5e-48) or not (x <= 7.5e-28): tmp = x * t else: tmp = y * 5.0 return tmp
function code(x, y, z, t) tmp = 0.0 if ((x <= -5e-48) || !(x <= 7.5e-28)) 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 <= -5e-48) || ~((x <= 7.5e-28))) tmp = x * t; else tmp = y * 5.0; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[x, -5e-48], N[Not[LessEqual[x, 7.5e-28]], $MachinePrecision]], N[(x * t), $MachinePrecision], N[(y * 5.0), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -5 \cdot 10^{-48} \lor \neg \left(x \leq 7.5 \cdot 10^{-28}\right):\\
\;\;\;\;x \cdot t\\
\mathbf{else}:\\
\;\;\;\;y \cdot 5\\
\end{array}
\end{array}
if x < -4.9999999999999999e-48 or 7.5000000000000003e-28 < x Initial program 100.0%
Taylor expanded in t around inf 39.3%
Simplified39.3%
if -4.9999999999999999e-48 < x < 7.5000000000000003e-28Initial program 99.8%
Taylor expanded in x around 0 62.3%
Final simplification49.2%
(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.3%
Final simplification29.3%
herbie shell --seed 2024116
(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)))