
(FPCore (x y z t) :precision binary64 (+ (* x (+ (+ (+ (+ y z) z) y) t)) (* y 5.0)))
double code(double x, double y, double z, double t) {
return (x * ((((y + z) + z) + y) + t)) + (y * 5.0);
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = (x * ((((y + z) + z) + y) + t)) + (y * 5.0d0)
end function
public static double code(double x, double y, double z, double t) {
return (x * ((((y + z) + z) + y) + t)) + (y * 5.0);
}
def code(x, y, z, t): return (x * ((((y + z) + z) + y) + t)) + (y * 5.0)
function code(x, y, z, t) return Float64(Float64(x * Float64(Float64(Float64(Float64(y + z) + z) + y) + t)) + Float64(y * 5.0)) end
function tmp = code(x, y, z, t) tmp = (x * ((((y + z) + z) + y) + t)) + (y * 5.0); end
code[x_, y_, z_, t_] := N[(N[(x * N[(N[(N[(N[(y + z), $MachinePrecision] + z), $MachinePrecision] + y), $MachinePrecision] + t), $MachinePrecision]), $MachinePrecision] + N[(y * 5.0), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x \cdot \left(\left(\left(\left(y + z\right) + z\right) + y\right) + t\right) + y \cdot 5
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 15 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t) :precision binary64 (+ (* x (+ (+ (+ (+ y z) z) y) t)) (* y 5.0)))
double code(double x, double y, double z, double t) {
return (x * ((((y + z) + z) + y) + t)) + (y * 5.0);
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = (x * ((((y + z) + z) + y) + t)) + (y * 5.0d0)
end function
public static double code(double x, double y, double z, double t) {
return (x * ((((y + z) + z) + y) + t)) + (y * 5.0);
}
def code(x, y, z, t): return (x * ((((y + z) + z) + y) + t)) + (y * 5.0)
function code(x, y, z, t) return Float64(Float64(x * Float64(Float64(Float64(Float64(y + z) + z) + y) + t)) + Float64(y * 5.0)) end
function tmp = code(x, y, z, t) tmp = (x * ((((y + z) + z) + y) + t)) + (y * 5.0); end
code[x_, y_, z_, t_] := N[(N[(x * N[(N[(N[(N[(y + z), $MachinePrecision] + z), $MachinePrecision] + y), $MachinePrecision] + t), $MachinePrecision]), $MachinePrecision] + N[(y * 5.0), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x \cdot \left(\left(\left(\left(y + z\right) + z\right) + y\right) + t\right) + y \cdot 5
\end{array}
(FPCore (x y z t) :precision binary64 (fma x (+ (* 2.0 (+ y z)) t) (* y 5.0)))
double code(double x, double y, double z, double t) {
return fma(x, ((2.0 * (y + z)) + t), (y * 5.0));
}
function code(x, y, z, t) return fma(x, Float64(Float64(2.0 * Float64(y + z)) + t), Float64(y * 5.0)) end
code[x_, y_, z_, t_] := N[(x * N[(N[(2.0 * N[(y + z), $MachinePrecision]), $MachinePrecision] + t), $MachinePrecision] + N[(y * 5.0), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\mathsf{fma}\left(x, 2 \cdot \left(y + z\right) + t, y \cdot 5\right)
\end{array}
Initial program 99.9%
fma-define99.9%
associate-+l+99.9%
+-commutative99.9%
count-299.9%
Simplified99.9%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* x (+ t (* 2.0 y)))))
(if (<= x -1.7e-12)
t_1
(if (<= x 6.2e-48)
(* y 5.0)
(if (or (<= x 1.25e+212) (not (<= x 1.95e+235)))
t_1
(* z (* x 2.0)))))))
double code(double x, double y, double z, double t) {
double t_1 = x * (t + (2.0 * y));
double tmp;
if (x <= -1.7e-12) {
tmp = t_1;
} else if (x <= 6.2e-48) {
tmp = y * 5.0;
} else if ((x <= 1.25e+212) || !(x <= 1.95e+235)) {
tmp = t_1;
} else {
tmp = z * (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) :: t_1
real(8) :: tmp
t_1 = x * (t + (2.0d0 * y))
if (x <= (-1.7d-12)) then
tmp = t_1
else if (x <= 6.2d-48) then
tmp = y * 5.0d0
else if ((x <= 1.25d+212) .or. (.not. (x <= 1.95d+235))) then
tmp = t_1
else
tmp = z * (x * 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 + (2.0 * y));
double tmp;
if (x <= -1.7e-12) {
tmp = t_1;
} else if (x <= 6.2e-48) {
tmp = y * 5.0;
} else if ((x <= 1.25e+212) || !(x <= 1.95e+235)) {
tmp = t_1;
} else {
tmp = z * (x * 2.0);
}
return tmp;
}
def code(x, y, z, t): t_1 = x * (t + (2.0 * y)) tmp = 0 if x <= -1.7e-12: tmp = t_1 elif x <= 6.2e-48: tmp = y * 5.0 elif (x <= 1.25e+212) or not (x <= 1.95e+235): tmp = t_1 else: tmp = z * (x * 2.0) return tmp
function code(x, y, z, t) t_1 = Float64(x * Float64(t + Float64(2.0 * y))) tmp = 0.0 if (x <= -1.7e-12) tmp = t_1; elseif (x <= 6.2e-48) tmp = Float64(y * 5.0); elseif ((x <= 1.25e+212) || !(x <= 1.95e+235)) tmp = t_1; else tmp = Float64(z * Float64(x * 2.0)); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = x * (t + (2.0 * y)); tmp = 0.0; if (x <= -1.7e-12) tmp = t_1; elseif (x <= 6.2e-48) tmp = y * 5.0; elseif ((x <= 1.25e+212) || ~((x <= 1.95e+235))) tmp = t_1; else tmp = z * (x * 2.0); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(x * N[(t + N[(2.0 * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -1.7e-12], t$95$1, If[LessEqual[x, 6.2e-48], N[(y * 5.0), $MachinePrecision], If[Or[LessEqual[x, 1.25e+212], N[Not[LessEqual[x, 1.95e+235]], $MachinePrecision]], t$95$1, N[(z * N[(x * 2.0), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot \left(t + 2 \cdot y\right)\\
\mathbf{if}\;x \leq -1.7 \cdot 10^{-12}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \leq 6.2 \cdot 10^{-48}:\\
\;\;\;\;y \cdot 5\\
\mathbf{elif}\;x \leq 1.25 \cdot 10^{+212} \lor \neg \left(x \leq 1.95 \cdot 10^{+235}\right):\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;z \cdot \left(x \cdot 2\right)\\
\end{array}
\end{array}
if x < -1.7e-12 or 6.20000000000000033e-48 < x < 1.24999999999999998e212 or 1.9500000000000001e235 < 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.6%
Taylor expanded in z around 0 76.4%
if -1.7e-12 < x < 6.20000000000000033e-48Initial program 99.8%
Taylor expanded in x around 0 63.8%
if 1.24999999999999998e212 < x < 1.9500000000000001e235Initial program 100.0%
Taylor expanded in z around inf 86.1%
Simplified86.1%
Final simplification71.4%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* x (+ t (* 2.0 z)))) (t_2 (* x (+ t (* 2.0 y)))))
(if (<= x -8e+41)
t_2
(if (<= x -2.8e-101)
t_1
(if (<= x 5.5e-48) (* y 5.0) (if (<= x 1.25e+212) t_2 t_1))))))
double code(double x, double y, double z, double t) {
double t_1 = x * (t + (2.0 * z));
double t_2 = x * (t + (2.0 * y));
double tmp;
if (x <= -8e+41) {
tmp = t_2;
} else if (x <= -2.8e-101) {
tmp = t_1;
} else if (x <= 5.5e-48) {
tmp = y * 5.0;
} else if (x <= 1.25e+212) {
tmp = t_2;
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = x * (t + (2.0d0 * z))
t_2 = x * (t + (2.0d0 * y))
if (x <= (-8d+41)) then
tmp = t_2
else if (x <= (-2.8d-101)) then
tmp = t_1
else if (x <= 5.5d-48) then
tmp = y * 5.0d0
else if (x <= 1.25d+212) then
tmp = t_2
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = x * (t + (2.0 * z));
double t_2 = x * (t + (2.0 * y));
double tmp;
if (x <= -8e+41) {
tmp = t_2;
} else if (x <= -2.8e-101) {
tmp = t_1;
} else if (x <= 5.5e-48) {
tmp = y * 5.0;
} else if (x <= 1.25e+212) {
tmp = t_2;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = x * (t + (2.0 * z)) t_2 = x * (t + (2.0 * y)) tmp = 0 if x <= -8e+41: tmp = t_2 elif x <= -2.8e-101: tmp = t_1 elif x <= 5.5e-48: tmp = y * 5.0 elif x <= 1.25e+212: tmp = t_2 else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(x * Float64(t + Float64(2.0 * z))) t_2 = Float64(x * Float64(t + Float64(2.0 * y))) tmp = 0.0 if (x <= -8e+41) tmp = t_2; elseif (x <= -2.8e-101) tmp = t_1; elseif (x <= 5.5e-48) tmp = Float64(y * 5.0); elseif (x <= 1.25e+212) tmp = t_2; else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = x * (t + (2.0 * z)); t_2 = x * (t + (2.0 * y)); tmp = 0.0; if (x <= -8e+41) tmp = t_2; elseif (x <= -2.8e-101) tmp = t_1; elseif (x <= 5.5e-48) tmp = y * 5.0; elseif (x <= 1.25e+212) tmp = t_2; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(x * N[(t + N[(2.0 * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(x * N[(t + N[(2.0 * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -8e+41], t$95$2, If[LessEqual[x, -2.8e-101], t$95$1, If[LessEqual[x, 5.5e-48], N[(y * 5.0), $MachinePrecision], If[LessEqual[x, 1.25e+212], t$95$2, t$95$1]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot \left(t + 2 \cdot z\right)\\
t_2 := x \cdot \left(t + 2 \cdot y\right)\\
\mathbf{if}\;x \leq -8 \cdot 10^{+41}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;x \leq -2.8 \cdot 10^{-101}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \leq 5.5 \cdot 10^{-48}:\\
\;\;\;\;y \cdot 5\\
\mathbf{elif}\;x \leq 1.25 \cdot 10^{+212}:\\
\;\;\;\;t\_2\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if x < -8.00000000000000005e41 or 5.50000000000000047e-48 < x < 1.24999999999999998e212Initial program 100.0%
fma-define100.0%
associate-+l+100.0%
+-commutative100.0%
count-2100.0%
Simplified100.0%
Taylor expanded in x around inf 99.5%
Taylor expanded in z around 0 77.8%
if -8.00000000000000005e41 < x < -2.79999999999999989e-101 or 1.24999999999999998e212 < x Initial program 99.9%
Taylor expanded in y around 0 75.0%
if -2.79999999999999989e-101 < x < 5.50000000000000047e-48Initial program 99.8%
Taylor expanded in x around 0 68.9%
Final simplification74.2%
(FPCore (x y z t)
:precision binary64
(if (<= x -1.02e-8)
(* y (* x 2.0))
(if (<= x 8.5e-48)
(* y 5.0)
(if (or (<= x 5.2e+211) (not (<= x 2.55e+238)))
(* x t)
(* z (* x 2.0))))))
double code(double x, double y, double z, double t) {
double tmp;
if (x <= -1.02e-8) {
tmp = y * (x * 2.0);
} else if (x <= 8.5e-48) {
tmp = y * 5.0;
} else if ((x <= 5.2e+211) || !(x <= 2.55e+238)) {
tmp = x * t;
} else {
tmp = z * (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 <= (-1.02d-8)) then
tmp = y * (x * 2.0d0)
else if (x <= 8.5d-48) then
tmp = y * 5.0d0
else if ((x <= 5.2d+211) .or. (.not. (x <= 2.55d+238))) then
tmp = x * t
else
tmp = z * (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 <= -1.02e-8) {
tmp = y * (x * 2.0);
} else if (x <= 8.5e-48) {
tmp = y * 5.0;
} else if ((x <= 5.2e+211) || !(x <= 2.55e+238)) {
tmp = x * t;
} else {
tmp = z * (x * 2.0);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if x <= -1.02e-8: tmp = y * (x * 2.0) elif x <= 8.5e-48: tmp = y * 5.0 elif (x <= 5.2e+211) or not (x <= 2.55e+238): tmp = x * t else: tmp = z * (x * 2.0) return tmp
function code(x, y, z, t) tmp = 0.0 if (x <= -1.02e-8) tmp = Float64(y * Float64(x * 2.0)); elseif (x <= 8.5e-48) tmp = Float64(y * 5.0); elseif ((x <= 5.2e+211) || !(x <= 2.55e+238)) tmp = Float64(x * t); else tmp = Float64(z * Float64(x * 2.0)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (x <= -1.02e-8) tmp = y * (x * 2.0); elseif (x <= 8.5e-48) tmp = y * 5.0; elseif ((x <= 5.2e+211) || ~((x <= 2.55e+238))) tmp = x * t; else tmp = z * (x * 2.0); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[x, -1.02e-8], N[(y * N[(x * 2.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 8.5e-48], N[(y * 5.0), $MachinePrecision], If[Or[LessEqual[x, 5.2e+211], N[Not[LessEqual[x, 2.55e+238]], $MachinePrecision]], N[(x * t), $MachinePrecision], N[(z * N[(x * 2.0), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.02 \cdot 10^{-8}:\\
\;\;\;\;y \cdot \left(x \cdot 2\right)\\
\mathbf{elif}\;x \leq 8.5 \cdot 10^{-48}:\\
\;\;\;\;y \cdot 5\\
\mathbf{elif}\;x \leq 5.2 \cdot 10^{+211} \lor \neg \left(x \leq 2.55 \cdot 10^{+238}\right):\\
\;\;\;\;x \cdot t\\
\mathbf{else}:\\
\;\;\;\;z \cdot \left(x \cdot 2\right)\\
\end{array}
\end{array}
if x < -1.02000000000000003e-8Initial program 100.0%
Taylor expanded in y around inf 48.0%
Simplified48.0%
Taylor expanded in x around inf 48.1%
*-commutative48.1%
*-commutative48.1%
associate-*r*48.1%
Simplified48.1%
if -1.02000000000000003e-8 < x < 8.5000000000000004e-48Initial program 99.8%
Taylor expanded in x around 0 63.3%
if 8.5000000000000004e-48 < x < 5.1999999999999997e211 or 2.5500000000000001e238 < x Initial program 100.0%
Taylor expanded in t around inf 45.1%
Simplified45.1%
if 5.1999999999999997e211 < x < 2.5500000000000001e238Initial program 100.0%
Taylor expanded in z around inf 86.1%
Simplified86.1%
Final simplification55.0%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* 2.0 (+ y z))))
(if (or (<= y -3.1e+168) (not (<= y 9e+77)))
(+ (* y 5.0) (* x t_1))
(* 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 ((y <= -3.1e+168) || !(y <= 9e+77)) {
tmp = (y * 5.0) + (x * t_1);
} 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 ((y <= (-3.1d+168)) .or. (.not. (y <= 9d+77))) then
tmp = (y * 5.0d0) + (x * t_1)
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 ((y <= -3.1e+168) || !(y <= 9e+77)) {
tmp = (y * 5.0) + (x * t_1);
} 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 (y <= -3.1e+168) or not (y <= 9e+77): tmp = (y * 5.0) + (x * t_1) 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 ((y <= -3.1e+168) || !(y <= 9e+77)) tmp = Float64(Float64(y * 5.0) + Float64(x * t_1)); 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 ((y <= -3.1e+168) || ~((y <= 9e+77))) tmp = (y * 5.0) + (x * t_1); 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[Or[LessEqual[y, -3.1e+168], N[Not[LessEqual[y, 9e+77]], $MachinePrecision]], N[(N[(y * 5.0), $MachinePrecision] + N[(x * t$95$1), $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}\;y \leq -3.1 \cdot 10^{+168} \lor \neg \left(y \leq 9 \cdot 10^{+77}\right):\\
\;\;\;\;y \cdot 5 + x \cdot t\_1\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(t + \left(t\_1 + 5 \cdot \frac{y}{x}\right)\right)\\
\end{array}
\end{array}
if y < -3.09999999999999996e168 or 9.00000000000000049e77 < y Initial program 99.9%
Taylor expanded in t around 0 96.5%
Simplified96.5%
if -3.09999999999999996e168 < y < 9.00000000000000049e77Initial program 99.9%
fma-define100.0%
associate-+l+100.0%
+-commutative100.0%
count-2100.0%
Simplified100.0%
Taylor expanded in x around inf 99.3%
Final simplification98.4%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* 2.0 (+ y z))))
(if (<= z -9.6e+27)
(+ (* y 5.0) (* x t_1))
(if (<= z 3.1e+27)
(+ (* y 5.0) (* x (+ t (+ y y))))
(if (<= z 3.1e+159) (* x (+ t_1 t)) (+ (* y 5.0) (* x (* 2.0 z))))))))
double code(double x, double y, double z, double t) {
double t_1 = 2.0 * (y + z);
double tmp;
if (z <= -9.6e+27) {
tmp = (y * 5.0) + (x * t_1);
} else if (z <= 3.1e+27) {
tmp = (y * 5.0) + (x * (t + (y + y)));
} else if (z <= 3.1e+159) {
tmp = x * (t_1 + t);
} else {
tmp = (y * 5.0) + (x * (2.0 * z));
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: tmp
t_1 = 2.0d0 * (y + z)
if (z <= (-9.6d+27)) then
tmp = (y * 5.0d0) + (x * t_1)
else if (z <= 3.1d+27) then
tmp = (y * 5.0d0) + (x * (t + (y + y)))
else if (z <= 3.1d+159) then
tmp = x * (t_1 + t)
else
tmp = (y * 5.0d0) + (x * (2.0d0 * z))
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 (z <= -9.6e+27) {
tmp = (y * 5.0) + (x * t_1);
} else if (z <= 3.1e+27) {
tmp = (y * 5.0) + (x * (t + (y + y)));
} else if (z <= 3.1e+159) {
tmp = x * (t_1 + t);
} else {
tmp = (y * 5.0) + (x * (2.0 * z));
}
return tmp;
}
def code(x, y, z, t): t_1 = 2.0 * (y + z) tmp = 0 if z <= -9.6e+27: tmp = (y * 5.0) + (x * t_1) elif z <= 3.1e+27: tmp = (y * 5.0) + (x * (t + (y + y))) elif z <= 3.1e+159: tmp = x * (t_1 + t) else: tmp = (y * 5.0) + (x * (2.0 * z)) return tmp
function code(x, y, z, t) t_1 = Float64(2.0 * Float64(y + z)) tmp = 0.0 if (z <= -9.6e+27) tmp = Float64(Float64(y * 5.0) + Float64(x * t_1)); elseif (z <= 3.1e+27) tmp = Float64(Float64(y * 5.0) + Float64(x * Float64(t + Float64(y + y)))); elseif (z <= 3.1e+159) tmp = Float64(x * Float64(t_1 + t)); else tmp = Float64(Float64(y * 5.0) + Float64(x * Float64(2.0 * z))); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = 2.0 * (y + z); tmp = 0.0; if (z <= -9.6e+27) tmp = (y * 5.0) + (x * t_1); elseif (z <= 3.1e+27) tmp = (y * 5.0) + (x * (t + (y + y))); elseif (z <= 3.1e+159) tmp = x * (t_1 + t); else tmp = (y * 5.0) + (x * (2.0 * z)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(2.0 * N[(y + z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -9.6e+27], N[(N[(y * 5.0), $MachinePrecision] + N[(x * t$95$1), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 3.1e+27], N[(N[(y * 5.0), $MachinePrecision] + N[(x * N[(t + N[(y + y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 3.1e+159], N[(x * N[(t$95$1 + t), $MachinePrecision]), $MachinePrecision], N[(N[(y * 5.0), $MachinePrecision] + N[(x * N[(2.0 * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := 2 \cdot \left(y + z\right)\\
\mathbf{if}\;z \leq -9.6 \cdot 10^{+27}:\\
\;\;\;\;y \cdot 5 + x \cdot t\_1\\
\mathbf{elif}\;z \leq 3.1 \cdot 10^{+27}:\\
\;\;\;\;y \cdot 5 + x \cdot \left(t + \left(y + y\right)\right)\\
\mathbf{elif}\;z \leq 3.1 \cdot 10^{+159}:\\
\;\;\;\;x \cdot \left(t\_1 + t\right)\\
\mathbf{else}:\\
\;\;\;\;y \cdot 5 + x \cdot \left(2 \cdot z\right)\\
\end{array}
\end{array}
if z < -9.59999999999999991e27Initial program 99.9%
Taylor expanded in t around 0 89.7%
Simplified89.7%
if -9.59999999999999991e27 < z < 3.09999999999999996e27Initial program 99.9%
Taylor expanded in y around inf 95.6%
if 3.09999999999999996e27 < z < 3.0999999999999998e159Initial program 100.0%
fma-define100.0%
associate-+l+100.0%
+-commutative100.0%
count-2100.0%
Simplified100.0%
Taylor expanded in x around inf 87.0%
if 3.0999999999999998e159 < z Initial program 100.0%
Taylor expanded in t around 0 93.6%
Simplified93.6%
Taylor expanded in y around 0 93.6%
Final simplification92.9%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* 2.0 (+ y z))) (t_2 (* x (+ t_1 t))))
(if (<= x -4.6e-12)
t_2
(if (<= x -4.5e-194)
(+ (* y 5.0) (* x t_1))
(if (<= x 7.8e-48) (+ (* y 5.0) (* x t)) t_2)))))
double code(double x, double y, double z, double t) {
double t_1 = 2.0 * (y + z);
double t_2 = x * (t_1 + t);
double tmp;
if (x <= -4.6e-12) {
tmp = t_2;
} else if (x <= -4.5e-194) {
tmp = (y * 5.0) + (x * t_1);
} else if (x <= 7.8e-48) {
tmp = (y * 5.0) + (x * t);
} else {
tmp = t_2;
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = 2.0d0 * (y + z)
t_2 = x * (t_1 + t)
if (x <= (-4.6d-12)) then
tmp = t_2
else if (x <= (-4.5d-194)) then
tmp = (y * 5.0d0) + (x * t_1)
else if (x <= 7.8d-48) then
tmp = (y * 5.0d0) + (x * t)
else
tmp = t_2
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = 2.0 * (y + z);
double t_2 = x * (t_1 + t);
double tmp;
if (x <= -4.6e-12) {
tmp = t_2;
} else if (x <= -4.5e-194) {
tmp = (y * 5.0) + (x * t_1);
} else if (x <= 7.8e-48) {
tmp = (y * 5.0) + (x * t);
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t): t_1 = 2.0 * (y + z) t_2 = x * (t_1 + t) tmp = 0 if x <= -4.6e-12: tmp = t_2 elif x <= -4.5e-194: tmp = (y * 5.0) + (x * t_1) elif x <= 7.8e-48: tmp = (y * 5.0) + (x * t) else: tmp = t_2 return tmp
function code(x, y, z, t) t_1 = Float64(2.0 * Float64(y + z)) t_2 = Float64(x * Float64(t_1 + t)) tmp = 0.0 if (x <= -4.6e-12) tmp = t_2; elseif (x <= -4.5e-194) tmp = Float64(Float64(y * 5.0) + Float64(x * t_1)); elseif (x <= 7.8e-48) tmp = Float64(Float64(y * 5.0) + Float64(x * t)); else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = 2.0 * (y + z); t_2 = x * (t_1 + t); tmp = 0.0; if (x <= -4.6e-12) tmp = t_2; elseif (x <= -4.5e-194) tmp = (y * 5.0) + (x * t_1); elseif (x <= 7.8e-48) tmp = (y * 5.0) + (x * t); else tmp = t_2; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(2.0 * N[(y + z), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(x * N[(t$95$1 + t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -4.6e-12], t$95$2, If[LessEqual[x, -4.5e-194], N[(N[(y * 5.0), $MachinePrecision] + N[(x * t$95$1), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 7.8e-48], N[(N[(y * 5.0), $MachinePrecision] + N[(x * t), $MachinePrecision]), $MachinePrecision], t$95$2]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := 2 \cdot \left(y + z\right)\\
t_2 := x \cdot \left(t\_1 + t\right)\\
\mathbf{if}\;x \leq -4.6 \cdot 10^{-12}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;x \leq -4.5 \cdot 10^{-194}:\\
\;\;\;\;y \cdot 5 + x \cdot t\_1\\
\mathbf{elif}\;x \leq 7.8 \cdot 10^{-48}:\\
\;\;\;\;y \cdot 5 + x \cdot t\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if x < -4.59999999999999979e-12 or 7.800000000000001e-48 < 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.6%
if -4.59999999999999979e-12 < x < -4.4999999999999999e-194Initial program 99.8%
Taylor expanded in t around 0 88.6%
Simplified88.6%
if -4.4999999999999999e-194 < x < 7.800000000000001e-48Initial program 99.8%
fma-define99.8%
associate-+l+99.8%
+-commutative99.8%
count-299.8%
Simplified99.8%
Taylor expanded in x around inf 65.5%
Taylor expanded in t around inf 62.8%
Taylor expanded in x around 0 71.2%
associate-*r/71.4%
*-commutative71.4%
associate-/l*71.3%
Simplified71.3%
Taylor expanded in t around 0 89.1%
Final simplification95.1%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* x (+ (* 2.0 (+ y z)) t))))
(if (<= x -1.65e-12)
t_1
(if (<= x -1.2e-194)
(+ (* y 5.0) (* x (* 2.0 z)))
(if (<= x 9e-48) (+ (* y 5.0) (* x t)) t_1)))))
double code(double x, double y, double z, double t) {
double t_1 = x * ((2.0 * (y + z)) + t);
double tmp;
if (x <= -1.65e-12) {
tmp = t_1;
} else if (x <= -1.2e-194) {
tmp = (y * 5.0) + (x * (2.0 * z));
} else if (x <= 9e-48) {
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 = x * ((2.0d0 * (y + z)) + t)
if (x <= (-1.65d-12)) then
tmp = t_1
else if (x <= (-1.2d-194)) then
tmp = (y * 5.0d0) + (x * (2.0d0 * z))
else if (x <= 9d-48) 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 = x * ((2.0 * (y + z)) + t);
double tmp;
if (x <= -1.65e-12) {
tmp = t_1;
} else if (x <= -1.2e-194) {
tmp = (y * 5.0) + (x * (2.0 * z));
} else if (x <= 9e-48) {
tmp = (y * 5.0) + (x * t);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = x * ((2.0 * (y + z)) + t) tmp = 0 if x <= -1.65e-12: tmp = t_1 elif x <= -1.2e-194: tmp = (y * 5.0) + (x * (2.0 * z)) elif x <= 9e-48: tmp = (y * 5.0) + (x * t) else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(x * Float64(Float64(2.0 * Float64(y + z)) + t)) tmp = 0.0 if (x <= -1.65e-12) tmp = t_1; elseif (x <= -1.2e-194) tmp = Float64(Float64(y * 5.0) + Float64(x * Float64(2.0 * z))); elseif (x <= 9e-48) 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 = x * ((2.0 * (y + z)) + t); tmp = 0.0; if (x <= -1.65e-12) tmp = t_1; elseif (x <= -1.2e-194) tmp = (y * 5.0) + (x * (2.0 * z)); elseif (x <= 9e-48) 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[(x * N[(N[(2.0 * N[(y + z), $MachinePrecision]), $MachinePrecision] + t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -1.65e-12], t$95$1, If[LessEqual[x, -1.2e-194], N[(N[(y * 5.0), $MachinePrecision] + N[(x * N[(2.0 * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 9e-48], N[(N[(y * 5.0), $MachinePrecision] + N[(x * t), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot \left(2 \cdot \left(y + z\right) + t\right)\\
\mathbf{if}\;x \leq -1.65 \cdot 10^{-12}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \leq -1.2 \cdot 10^{-194}:\\
\;\;\;\;y \cdot 5 + x \cdot \left(2 \cdot z\right)\\
\mathbf{elif}\;x \leq 9 \cdot 10^{-48}:\\
\;\;\;\;y \cdot 5 + x \cdot t\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if x < -1.65e-12 or 8.99999999999999977e-48 < 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.6%
if -1.65e-12 < x < -1.2e-194Initial program 99.8%
Taylor expanded in t around 0 88.6%
Simplified88.6%
Taylor expanded in y around 0 88.5%
if -1.2e-194 < x < 8.99999999999999977e-48Initial program 99.8%
fma-define99.8%
associate-+l+99.8%
+-commutative99.8%
count-299.8%
Simplified99.8%
Taylor expanded in x around inf 65.5%
Taylor expanded in t around inf 62.8%
Taylor expanded in x around 0 71.2%
associate-*r/71.4%
*-commutative71.4%
associate-/l*71.3%
Simplified71.3%
Taylor expanded in t around 0 89.1%
Final simplification95.0%
(FPCore (x y z t) :precision binary64 (if (or (<= y -6.6e+37) (not (<= y 6.6e+77))) (+ (* y 5.0) (* x (* 2.0 (+ y z)))) (* x (+ t (+ (* 5.0 (/ y x)) (* 2.0 z))))))
double code(double x, double y, double z, double t) {
double tmp;
if ((y <= -6.6e+37) || !(y <= 6.6e+77)) {
tmp = (y * 5.0) + (x * (2.0 * (y + z)));
} else {
tmp = x * (t + ((5.0 * (y / x)) + (2.0 * z)));
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if ((y <= (-6.6d+37)) .or. (.not. (y <= 6.6d+77))) then
tmp = (y * 5.0d0) + (x * (2.0d0 * (y + z)))
else
tmp = x * (t + ((5.0d0 * (y / x)) + (2.0d0 * z)))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((y <= -6.6e+37) || !(y <= 6.6e+77)) {
tmp = (y * 5.0) + (x * (2.0 * (y + z)));
} else {
tmp = x * (t + ((5.0 * (y / x)) + (2.0 * z)));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (y <= -6.6e+37) or not (y <= 6.6e+77): tmp = (y * 5.0) + (x * (2.0 * (y + z))) else: tmp = x * (t + ((5.0 * (y / x)) + (2.0 * z))) return tmp
function code(x, y, z, t) tmp = 0.0 if ((y <= -6.6e+37) || !(y <= 6.6e+77)) tmp = Float64(Float64(y * 5.0) + Float64(x * Float64(2.0 * Float64(y + z)))); else tmp = Float64(x * Float64(t + Float64(Float64(5.0 * Float64(y / x)) + Float64(2.0 * z)))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((y <= -6.6e+37) || ~((y <= 6.6e+77))) tmp = (y * 5.0) + (x * (2.0 * (y + z))); else tmp = x * (t + ((5.0 * (y / x)) + (2.0 * z))); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[y, -6.6e+37], N[Not[LessEqual[y, 6.6e+77]], $MachinePrecision]], N[(N[(y * 5.0), $MachinePrecision] + N[(x * N[(2.0 * N[(y + z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x * N[(t + N[(N[(5.0 * N[(y / x), $MachinePrecision]), $MachinePrecision] + N[(2.0 * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -6.6 \cdot 10^{+37} \lor \neg \left(y \leq 6.6 \cdot 10^{+77}\right):\\
\;\;\;\;y \cdot 5 + x \cdot \left(2 \cdot \left(y + z\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(t + \left(5 \cdot \frac{y}{x} + 2 \cdot z\right)\right)\\
\end{array}
\end{array}
if y < -6.6000000000000002e37 or 6.5999999999999996e77 < y Initial program 99.9%
Taylor expanded in t around 0 94.9%
Simplified94.9%
if -6.6000000000000002e37 < y < 6.5999999999999996e77Initial program 99.9%
fma-define100.0%
associate-+l+100.0%
+-commutative100.0%
count-2100.0%
Simplified100.0%
Taylor expanded in x around inf 99.9%
Taylor expanded in y around 0 92.9%
Final simplification93.8%
(FPCore (x y z t) :precision binary64 (if (or (<= x -3.4e-51) (not (<= x 7e-48))) (* x (+ (* 2.0 (+ y z)) t)) (+ (* y 5.0) (* x t))))
double code(double x, double y, double z, double t) {
double tmp;
if ((x <= -3.4e-51) || !(x <= 7e-48)) {
tmp = x * ((2.0 * (y + z)) + t);
} else {
tmp = (y * 5.0) + (x * t);
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if ((x <= (-3.4d-51)) .or. (.not. (x <= 7d-48))) then
tmp = x * ((2.0d0 * (y + z)) + t)
else
tmp = (y * 5.0d0) + (x * t)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((x <= -3.4e-51) || !(x <= 7e-48)) {
tmp = x * ((2.0 * (y + z)) + t);
} else {
tmp = (y * 5.0) + (x * t);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (x <= -3.4e-51) or not (x <= 7e-48): tmp = x * ((2.0 * (y + z)) + t) else: tmp = (y * 5.0) + (x * t) return tmp
function code(x, y, z, t) tmp = 0.0 if ((x <= -3.4e-51) || !(x <= 7e-48)) tmp = Float64(x * Float64(Float64(2.0 * Float64(y + z)) + t)); else tmp = Float64(Float64(y * 5.0) + Float64(x * t)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((x <= -3.4e-51) || ~((x <= 7e-48))) tmp = x * ((2.0 * (y + z)) + t); else tmp = (y * 5.0) + (x * t); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[x, -3.4e-51], N[Not[LessEqual[x, 7e-48]], $MachinePrecision]], N[(x * N[(N[(2.0 * N[(y + z), $MachinePrecision]), $MachinePrecision] + t), $MachinePrecision]), $MachinePrecision], N[(N[(y * 5.0), $MachinePrecision] + N[(x * t), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -3.4 \cdot 10^{-51} \lor \neg \left(x \leq 7 \cdot 10^{-48}\right):\\
\;\;\;\;x \cdot \left(2 \cdot \left(y + z\right) + t\right)\\
\mathbf{else}:\\
\;\;\;\;y \cdot 5 + x \cdot t\\
\end{array}
\end{array}
if x < -3.40000000000000003e-51 or 6.99999999999999982e-48 < 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.40000000000000003e-51 < x < 6.99999999999999982e-48Initial program 99.8%
fma-define99.8%
associate-+l+99.8%
+-commutative99.8%
count-299.8%
Simplified99.8%
Taylor expanded in x around inf 72.5%
Taylor expanded in t around inf 63.9%
Taylor expanded in x around 0 66.7%
associate-*r/66.8%
*-commutative66.8%
associate-/l*66.7%
Simplified66.7%
Taylor expanded in t around 0 82.8%
Final simplification91.6%
(FPCore (x y z t) :precision binary64 (if (or (<= y -1.55e+21) (not (<= y 7.8e+77))) (* y (+ 5.0 (* x 2.0))) (* x (+ t (* 2.0 z)))))
double code(double x, double y, double z, double t) {
double tmp;
if ((y <= -1.55e+21) || !(y <= 7.8e+77)) {
tmp = y * (5.0 + (x * 2.0));
} else {
tmp = x * (t + (2.0 * z));
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if ((y <= (-1.55d+21)) .or. (.not. (y <= 7.8d+77))) then
tmp = y * (5.0d0 + (x * 2.0d0))
else
tmp = x * (t + (2.0d0 * z))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((y <= -1.55e+21) || !(y <= 7.8e+77)) {
tmp = y * (5.0 + (x * 2.0));
} else {
tmp = x * (t + (2.0 * z));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (y <= -1.55e+21) or not (y <= 7.8e+77): tmp = y * (5.0 + (x * 2.0)) else: tmp = x * (t + (2.0 * z)) return tmp
function code(x, y, z, t) tmp = 0.0 if ((y <= -1.55e+21) || !(y <= 7.8e+77)) tmp = Float64(y * Float64(5.0 + Float64(x * 2.0))); else tmp = Float64(x * Float64(t + Float64(2.0 * z))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((y <= -1.55e+21) || ~((y <= 7.8e+77))) tmp = y * (5.0 + (x * 2.0)); else tmp = x * (t + (2.0 * z)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[y, -1.55e+21], N[Not[LessEqual[y, 7.8e+77]], $MachinePrecision]], N[(y * N[(5.0 + N[(x * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x * N[(t + N[(2.0 * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.55 \cdot 10^{+21} \lor \neg \left(y \leq 7.8 \cdot 10^{+77}\right):\\
\;\;\;\;y \cdot \left(5 + x \cdot 2\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(t + 2 \cdot z\right)\\
\end{array}
\end{array}
if y < -1.55e21 or 7.7999999999999995e77 < y Initial program 99.9%
Taylor expanded in y around inf 83.1%
Simplified83.1%
if -1.55e21 < y < 7.7999999999999995e77Initial program 99.9%
Taylor expanded in y around 0 78.6%
Final simplification80.6%
(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.9%
Final simplification99.9%
(FPCore (x y z t) :precision binary64 (if (or (<= x -7.6e-12) (not (<= x 6.5e-48))) (* x t) (* y 5.0)))
double code(double x, double y, double z, double t) {
double tmp;
if ((x <= -7.6e-12) || !(x <= 6.5e-48)) {
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 <= (-7.6d-12)) .or. (.not. (x <= 6.5d-48))) 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 <= -7.6e-12) || !(x <= 6.5e-48)) {
tmp = x * t;
} else {
tmp = y * 5.0;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (x <= -7.6e-12) or not (x <= 6.5e-48): tmp = x * t else: tmp = y * 5.0 return tmp
function code(x, y, z, t) tmp = 0.0 if ((x <= -7.6e-12) || !(x <= 6.5e-48)) 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 <= -7.6e-12) || ~((x <= 6.5e-48))) tmp = x * t; else tmp = y * 5.0; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[x, -7.6e-12], N[Not[LessEqual[x, 6.5e-48]], $MachinePrecision]], N[(x * t), $MachinePrecision], N[(y * 5.0), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -7.6 \cdot 10^{-12} \lor \neg \left(x \leq 6.5 \cdot 10^{-48}\right):\\
\;\;\;\;x \cdot t\\
\mathbf{else}:\\
\;\;\;\;y \cdot 5\\
\end{array}
\end{array}
if x < -7.59999999999999993e-12 or 6.5e-48 < x Initial program 100.0%
Taylor expanded in t around inf 39.0%
Simplified39.0%
if -7.59999999999999993e-12 < x < 6.5e-48Initial program 99.8%
Taylor expanded in x around 0 63.8%
Final simplification49.6%
(FPCore (x y z t) :precision binary64 (if (<= x -1.02e-8) (* y (* x 2.0)) (if (<= x 4.8e-48) (* y 5.0) (* x t))))
double code(double x, double y, double z, double t) {
double tmp;
if (x <= -1.02e-8) {
tmp = y * (x * 2.0);
} else if (x <= 4.8e-48) {
tmp = y * 5.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) :: tmp
if (x <= (-1.02d-8)) then
tmp = y * (x * 2.0d0)
else if (x <= 4.8d-48) then
tmp = y * 5.0d0
else
tmp = 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.02e-8) {
tmp = y * (x * 2.0);
} else if (x <= 4.8e-48) {
tmp = y * 5.0;
} else {
tmp = x * t;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if x <= -1.02e-8: tmp = y * (x * 2.0) elif x <= 4.8e-48: tmp = y * 5.0 else: tmp = x * t return tmp
function code(x, y, z, t) tmp = 0.0 if (x <= -1.02e-8) tmp = Float64(y * Float64(x * 2.0)); elseif (x <= 4.8e-48) tmp = Float64(y * 5.0); else tmp = Float64(x * t); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (x <= -1.02e-8) tmp = y * (x * 2.0); elseif (x <= 4.8e-48) tmp = y * 5.0; else tmp = x * t; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[x, -1.02e-8], N[(y * N[(x * 2.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 4.8e-48], N[(y * 5.0), $MachinePrecision], N[(x * t), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.02 \cdot 10^{-8}:\\
\;\;\;\;y \cdot \left(x \cdot 2\right)\\
\mathbf{elif}\;x \leq 4.8 \cdot 10^{-48}:\\
\;\;\;\;y \cdot 5\\
\mathbf{else}:\\
\;\;\;\;x \cdot t\\
\end{array}
\end{array}
if x < -1.02000000000000003e-8Initial program 100.0%
Taylor expanded in y around inf 48.0%
Simplified48.0%
Taylor expanded in x around inf 48.1%
*-commutative48.1%
*-commutative48.1%
associate-*r*48.1%
Simplified48.1%
if -1.02000000000000003e-8 < x < 4.8e-48Initial program 99.8%
Taylor expanded in x around 0 63.3%
if 4.8e-48 < x Initial program 100.0%
Taylor expanded in t around inf 42.0%
Simplified42.0%
Final simplification52.4%
(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 28.9%
Final simplification28.9%
herbie shell --seed 2024110
(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)))