
(FPCore (x y z t) :precision binary64 (+ (* x (+ (+ (+ (+ y z) z) y) t)) (* y 5.0)))
double code(double x, double y, double z, double t) {
return (x * ((((y + z) + z) + y) + t)) + (y * 5.0);
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = (x * ((((y + z) + z) + y) + t)) + (y * 5.0d0)
end function
public static double code(double x, double y, double z, double t) {
return (x * ((((y + z) + z) + y) + t)) + (y * 5.0);
}
def code(x, y, z, t): return (x * ((((y + z) + z) + y) + t)) + (y * 5.0)
function code(x, y, z, t) return Float64(Float64(x * Float64(Float64(Float64(Float64(y + z) + z) + y) + t)) + Float64(y * 5.0)) end
function tmp = code(x, y, z, t) tmp = (x * ((((y + z) + z) + y) + t)) + (y * 5.0); end
code[x_, y_, z_, t_] := N[(N[(x * N[(N[(N[(N[(y + z), $MachinePrecision] + z), $MachinePrecision] + y), $MachinePrecision] + t), $MachinePrecision]), $MachinePrecision] + N[(y * 5.0), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x \cdot \left(\left(\left(\left(y + z\right) + z\right) + y\right) + t\right) + y \cdot 5
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 16 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t) :precision binary64 (+ (* x (+ (+ (+ (+ y z) z) y) t)) (* y 5.0)))
double code(double x, double y, double z, double t) {
return (x * ((((y + z) + z) + y) + t)) + (y * 5.0);
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = (x * ((((y + z) + z) + y) + t)) + (y * 5.0d0)
end function
public static double code(double x, double y, double z, double t) {
return (x * ((((y + z) + z) + y) + t)) + (y * 5.0);
}
def code(x, y, z, t): return (x * ((((y + z) + z) + y) + t)) + (y * 5.0)
function code(x, y, z, t) return Float64(Float64(x * Float64(Float64(Float64(Float64(y + z) + z) + y) + t)) + Float64(y * 5.0)) end
function tmp = code(x, y, z, t) tmp = (x * ((((y + z) + z) + y) + t)) + (y * 5.0); end
code[x_, y_, z_, t_] := N[(N[(x * N[(N[(N[(N[(y + z), $MachinePrecision] + z), $MachinePrecision] + y), $MachinePrecision] + t), $MachinePrecision]), $MachinePrecision] + N[(y * 5.0), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x \cdot \left(\left(\left(\left(y + z\right) + z\right) + y\right) + t\right) + y \cdot 5
\end{array}
(FPCore (x y z t) :precision binary64 (fma x (+ (+ 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 100.0%
fma-def100.0%
associate-+l+100.0%
associate-+l+100.0%
Simplified100.0%
Final simplification100.0%
(FPCore (x y z t) :precision binary64 (fma x (+ t (* 2.0 (+ y z))) (* y 5.0)))
double code(double x, double y, double z, double t) {
return fma(x, (t + (2.0 * (y + z))), (y * 5.0));
}
function code(x, y, z, t) return fma(x, Float64(t + Float64(2.0 * Float64(y + z))), Float64(y * 5.0)) end
code[x_, y_, z_, t_] := N[(x * N[(t + N[(2.0 * N[(y + z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(y * 5.0), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\mathsf{fma}\left(x, t + 2 \cdot \left(y + z\right), y \cdot 5\right)
\end{array}
Initial program 100.0%
fma-def100.0%
associate-+l+100.0%
+-commutative100.0%
count-2100.0%
Simplified100.0%
Final simplification100.0%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* x (+ t (* y 2.0)))))
(if (<= x -240000000000.0)
t_1
(if (<= x -1.4e-163)
(* x (+ t (* z 2.0)))
(if (<= x 8e-24)
(* y 5.0)
(if (or (<= x 2.55e+101) (and (not (<= x 8.5e+186)) (<= x 8.5e+304)))
(* x (* 2.0 (+ y z)))
t_1))))))
double code(double x, double y, double z, double t) {
double t_1 = x * (t + (y * 2.0));
double tmp;
if (x <= -240000000000.0) {
tmp = t_1;
} else if (x <= -1.4e-163) {
tmp = x * (t + (z * 2.0));
} else if (x <= 8e-24) {
tmp = y * 5.0;
} else if ((x <= 2.55e+101) || (!(x <= 8.5e+186) && (x <= 8.5e+304))) {
tmp = x * (2.0 * (y + z));
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: tmp
t_1 = x * (t + (y * 2.0d0))
if (x <= (-240000000000.0d0)) then
tmp = t_1
else if (x <= (-1.4d-163)) then
tmp = x * (t + (z * 2.0d0))
else if (x <= 8d-24) then
tmp = y * 5.0d0
else if ((x <= 2.55d+101) .or. (.not. (x <= 8.5d+186)) .and. (x <= 8.5d+304)) then
tmp = x * (2.0d0 * (y + z))
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = x * (t + (y * 2.0));
double tmp;
if (x <= -240000000000.0) {
tmp = t_1;
} else if (x <= -1.4e-163) {
tmp = x * (t + (z * 2.0));
} else if (x <= 8e-24) {
tmp = y * 5.0;
} else if ((x <= 2.55e+101) || (!(x <= 8.5e+186) && (x <= 8.5e+304))) {
tmp = x * (2.0 * (y + z));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = x * (t + (y * 2.0)) tmp = 0 if x <= -240000000000.0: tmp = t_1 elif x <= -1.4e-163: tmp = x * (t + (z * 2.0)) elif x <= 8e-24: tmp = y * 5.0 elif (x <= 2.55e+101) or (not (x <= 8.5e+186) and (x <= 8.5e+304)): tmp = x * (2.0 * (y + z)) else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(x * Float64(t + Float64(y * 2.0))) tmp = 0.0 if (x <= -240000000000.0) tmp = t_1; elseif (x <= -1.4e-163) tmp = Float64(x * Float64(t + Float64(z * 2.0))); elseif (x <= 8e-24) tmp = Float64(y * 5.0); elseif ((x <= 2.55e+101) || (!(x <= 8.5e+186) && (x <= 8.5e+304))) tmp = Float64(x * Float64(2.0 * Float64(y + z))); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = x * (t + (y * 2.0)); tmp = 0.0; if (x <= -240000000000.0) tmp = t_1; elseif (x <= -1.4e-163) tmp = x * (t + (z * 2.0)); elseif (x <= 8e-24) tmp = y * 5.0; elseif ((x <= 2.55e+101) || (~((x <= 8.5e+186)) && (x <= 8.5e+304))) tmp = x * (2.0 * (y + z)); else tmp = t_1; 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, -240000000000.0], t$95$1, If[LessEqual[x, -1.4e-163], N[(x * N[(t + N[(z * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 8e-24], N[(y * 5.0), $MachinePrecision], If[Or[LessEqual[x, 2.55e+101], And[N[Not[LessEqual[x, 8.5e+186]], $MachinePrecision], LessEqual[x, 8.5e+304]]], N[(x * N[(2.0 * N[(y + z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot \left(t + y \cdot 2\right)\\
\mathbf{if}\;x \leq -240000000000:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \leq -1.4 \cdot 10^{-163}:\\
\;\;\;\;x \cdot \left(t + z \cdot 2\right)\\
\mathbf{elif}\;x \leq 8 \cdot 10^{-24}:\\
\;\;\;\;y \cdot 5\\
\mathbf{elif}\;x \leq 2.55 \cdot 10^{+101} \lor \neg \left(x \leq 8.5 \cdot 10^{+186}\right) \land x \leq 8.5 \cdot 10^{+304}:\\
\;\;\;\;x \cdot \left(2 \cdot \left(y + z\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if x < -2.4e11 or 2.54999999999999997e101 < x < 8.4999999999999999e186 or 8.5000000000000005e304 < x Initial program 100.0%
Taylor expanded in y around 0 96.3%
Taylor expanded in z around 0 84.4%
Taylor expanded in x around inf 86.7%
if -2.4e11 < x < -1.4e-163Initial program 100.0%
Taylor expanded in y around 0 62.1%
if -1.4e-163 < x < 7.99999999999999939e-24Initial program 99.9%
Taylor expanded in x around 0 66.6%
if 7.99999999999999939e-24 < x < 2.54999999999999997e101 or 8.4999999999999999e186 < x < 8.5000000000000005e304Initial program 100.0%
Taylor expanded in t around 0 85.0%
Simplified85.0%
Taylor expanded in x around inf 81.3%
*-commutative81.3%
associate-*r*81.3%
*-commutative81.3%
Simplified81.3%
Final simplification75.5%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* x (+ t (* y 2.0)))))
(if (<= x -200.0)
t_1
(if (<= x 5.6e-27)
(* y 5.0)
(if (or (<= x 1.15e+101) (and (not (<= x 1.2e+184)) (<= x 1.75e+305)))
(* x (* 2.0 (+ y z)))
t_1)))))
double code(double x, double y, double z, double t) {
double t_1 = x * (t + (y * 2.0));
double tmp;
if (x <= -200.0) {
tmp = t_1;
} else if (x <= 5.6e-27) {
tmp = y * 5.0;
} else if ((x <= 1.15e+101) || (!(x <= 1.2e+184) && (x <= 1.75e+305))) {
tmp = x * (2.0 * (y + z));
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: tmp
t_1 = x * (t + (y * 2.0d0))
if (x <= (-200.0d0)) then
tmp = t_1
else if (x <= 5.6d-27) then
tmp = y * 5.0d0
else if ((x <= 1.15d+101) .or. (.not. (x <= 1.2d+184)) .and. (x <= 1.75d+305)) then
tmp = x * (2.0d0 * (y + z))
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = x * (t + (y * 2.0));
double tmp;
if (x <= -200.0) {
tmp = t_1;
} else if (x <= 5.6e-27) {
tmp = y * 5.0;
} else if ((x <= 1.15e+101) || (!(x <= 1.2e+184) && (x <= 1.75e+305))) {
tmp = x * (2.0 * (y + z));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = x * (t + (y * 2.0)) tmp = 0 if x <= -200.0: tmp = t_1 elif x <= 5.6e-27: tmp = y * 5.0 elif (x <= 1.15e+101) or (not (x <= 1.2e+184) and (x <= 1.75e+305)): tmp = x * (2.0 * (y + z)) else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(x * Float64(t + Float64(y * 2.0))) tmp = 0.0 if (x <= -200.0) tmp = t_1; elseif (x <= 5.6e-27) tmp = Float64(y * 5.0); elseif ((x <= 1.15e+101) || (!(x <= 1.2e+184) && (x <= 1.75e+305))) tmp = Float64(x * Float64(2.0 * Float64(y + z))); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = x * (t + (y * 2.0)); tmp = 0.0; if (x <= -200.0) tmp = t_1; elseif (x <= 5.6e-27) tmp = y * 5.0; elseif ((x <= 1.15e+101) || (~((x <= 1.2e+184)) && (x <= 1.75e+305))) tmp = x * (2.0 * (y + z)); else tmp = t_1; 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, -200.0], t$95$1, If[LessEqual[x, 5.6e-27], N[(y * 5.0), $MachinePrecision], If[Or[LessEqual[x, 1.15e+101], And[N[Not[LessEqual[x, 1.2e+184]], $MachinePrecision], LessEqual[x, 1.75e+305]]], N[(x * N[(2.0 * N[(y + z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot \left(t + y \cdot 2\right)\\
\mathbf{if}\;x \leq -200:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \leq 5.6 \cdot 10^{-27}:\\
\;\;\;\;y \cdot 5\\
\mathbf{elif}\;x \leq 1.15 \cdot 10^{+101} \lor \neg \left(x \leq 1.2 \cdot 10^{+184}\right) \land x \leq 1.75 \cdot 10^{+305}:\\
\;\;\;\;x \cdot \left(2 \cdot \left(y + z\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if x < -200 or 1.1500000000000001e101 < x < 1.19999999999999998e184 or 1.75e305 < x Initial program 100.0%
Taylor expanded in y around 0 96.3%
Taylor expanded in z around 0 84.4%
Taylor expanded in x around inf 86.7%
if -200 < x < 5.5999999999999999e-27Initial program 99.9%
Taylor expanded in x around 0 58.5%
if 5.5999999999999999e-27 < x < 1.1500000000000001e101 or 1.19999999999999998e184 < x < 1.75e305Initial program 100.0%
Taylor expanded in t around 0 85.0%
Simplified85.0%
Taylor expanded in x around inf 81.3%
*-commutative81.3%
associate-*r*81.3%
*-commutative81.3%
Simplified81.3%
Final simplification72.3%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* x (* 2.0 (+ y z)))))
(if (<= x -5.5e+221)
t_1
(if (<= x -5.4e+101)
(* x t)
(if (or (<= x -1.8e-79) (not (<= x 2.7e-25))) t_1 (* y 5.0))))))
double code(double x, double y, double z, double t) {
double t_1 = x * (2.0 * (y + z));
double tmp;
if (x <= -5.5e+221) {
tmp = t_1;
} else if (x <= -5.4e+101) {
tmp = x * t;
} else if ((x <= -1.8e-79) || !(x <= 2.7e-25)) {
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 * (2.0d0 * (y + z))
if (x <= (-5.5d+221)) then
tmp = t_1
else if (x <= (-5.4d+101)) then
tmp = x * t
else if ((x <= (-1.8d-79)) .or. (.not. (x <= 2.7d-25))) 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 * (2.0 * (y + z));
double tmp;
if (x <= -5.5e+221) {
tmp = t_1;
} else if (x <= -5.4e+101) {
tmp = x * t;
} else if ((x <= -1.8e-79) || !(x <= 2.7e-25)) {
tmp = t_1;
} else {
tmp = y * 5.0;
}
return tmp;
}
def code(x, y, z, t): t_1 = x * (2.0 * (y + z)) tmp = 0 if x <= -5.5e+221: tmp = t_1 elif x <= -5.4e+101: tmp = x * t elif (x <= -1.8e-79) or not (x <= 2.7e-25): tmp = t_1 else: tmp = y * 5.0 return tmp
function code(x, y, z, t) t_1 = Float64(x * Float64(2.0 * Float64(y + z))) tmp = 0.0 if (x <= -5.5e+221) tmp = t_1; elseif (x <= -5.4e+101) tmp = Float64(x * t); elseif ((x <= -1.8e-79) || !(x <= 2.7e-25)) tmp = t_1; else tmp = Float64(y * 5.0); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = x * (2.0 * (y + z)); tmp = 0.0; if (x <= -5.5e+221) tmp = t_1; elseif (x <= -5.4e+101) tmp = x * t; elseif ((x <= -1.8e-79) || ~((x <= 2.7e-25))) 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[(2.0 * N[(y + z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -5.5e+221], t$95$1, If[LessEqual[x, -5.4e+101], N[(x * t), $MachinePrecision], If[Or[LessEqual[x, -1.8e-79], N[Not[LessEqual[x, 2.7e-25]], $MachinePrecision]], t$95$1, N[(y * 5.0), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot \left(2 \cdot \left(y + z\right)\right)\\
\mathbf{if}\;x \leq -5.5 \cdot 10^{+221}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \leq -5.4 \cdot 10^{+101}:\\
\;\;\;\;x \cdot t\\
\mathbf{elif}\;x \leq -1.8 \cdot 10^{-79} \lor \neg \left(x \leq 2.7 \cdot 10^{-25}\right):\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;y \cdot 5\\
\end{array}
\end{array}
if x < -5.5000000000000003e221 or -5.40000000000000012e101 < x < -1.8000000000000001e-79 or 2.70000000000000016e-25 < x Initial program 100.0%
Taylor expanded in t around 0 79.0%
Simplified79.0%
Taylor expanded in x around inf 72.3%
*-commutative72.3%
associate-*r*72.3%
*-commutative72.3%
Simplified72.3%
if -5.5000000000000003e221 < x < -5.40000000000000012e101Initial program 99.9%
Taylor expanded in t around inf 73.2%
Simplified73.2%
if -1.8000000000000001e-79 < x < 2.70000000000000016e-25Initial program 99.9%
Taylor expanded in x around 0 61.5%
Final simplification68.0%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (+ (* y 5.0) (* x t))) (t_2 (* y (+ 5.0 (* x 2.0)))))
(if (<= y -4.3e+114)
t_2
(if (<= y -1.12e-7)
t_1
(if (<= y 2.2e-14)
(* x (+ t (* z 2.0)))
(if (<= y 7.6e+62) t_1 t_2))))))
double code(double x, double y, double z, double t) {
double t_1 = (y * 5.0) + (x * t);
double t_2 = y * (5.0 + (x * 2.0));
double tmp;
if (y <= -4.3e+114) {
tmp = t_2;
} else if (y <= -1.12e-7) {
tmp = t_1;
} else if (y <= 2.2e-14) {
tmp = x * (t + (z * 2.0));
} else if (y <= 7.6e+62) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = (y * 5.0d0) + (x * t)
t_2 = y * (5.0d0 + (x * 2.0d0))
if (y <= (-4.3d+114)) then
tmp = t_2
else if (y <= (-1.12d-7)) then
tmp = t_1
else if (y <= 2.2d-14) then
tmp = x * (t + (z * 2.0d0))
else if (y <= 7.6d+62) then
tmp = t_1
else
tmp = t_2
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = (y * 5.0) + (x * t);
double t_2 = y * (5.0 + (x * 2.0));
double tmp;
if (y <= -4.3e+114) {
tmp = t_2;
} else if (y <= -1.12e-7) {
tmp = t_1;
} else if (y <= 2.2e-14) {
tmp = x * (t + (z * 2.0));
} else if (y <= 7.6e+62) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t): t_1 = (y * 5.0) + (x * t) t_2 = y * (5.0 + (x * 2.0)) tmp = 0 if y <= -4.3e+114: tmp = t_2 elif y <= -1.12e-7: tmp = t_1 elif y <= 2.2e-14: tmp = x * (t + (z * 2.0)) elif y <= 7.6e+62: tmp = t_1 else: tmp = t_2 return tmp
function code(x, y, z, t) t_1 = Float64(Float64(y * 5.0) + Float64(x * t)) t_2 = Float64(y * Float64(5.0 + Float64(x * 2.0))) tmp = 0.0 if (y <= -4.3e+114) tmp = t_2; elseif (y <= -1.12e-7) tmp = t_1; elseif (y <= 2.2e-14) tmp = Float64(x * Float64(t + Float64(z * 2.0))); elseif (y <= 7.6e+62) tmp = t_1; else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = (y * 5.0) + (x * t); t_2 = y * (5.0 + (x * 2.0)); tmp = 0.0; if (y <= -4.3e+114) tmp = t_2; elseif (y <= -1.12e-7) tmp = t_1; elseif (y <= 2.2e-14) tmp = x * (t + (z * 2.0)); elseif (y <= 7.6e+62) tmp = t_1; else tmp = t_2; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(y * 5.0), $MachinePrecision] + N[(x * t), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(y * N[(5.0 + N[(x * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -4.3e+114], t$95$2, If[LessEqual[y, -1.12e-7], t$95$1, If[LessEqual[y, 2.2e-14], N[(x * N[(t + N[(z * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 7.6e+62], t$95$1, t$95$2]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := y \cdot 5 + x \cdot t\\
t_2 := y \cdot \left(5 + x \cdot 2\right)\\
\mathbf{if}\;y \leq -4.3 \cdot 10^{+114}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;y \leq -1.12 \cdot 10^{-7}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq 2.2 \cdot 10^{-14}:\\
\;\;\;\;x \cdot \left(t + z \cdot 2\right)\\
\mathbf{elif}\;y \leq 7.6 \cdot 10^{+62}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if y < -4.3000000000000001e114 or 7.59999999999999967e62 < y Initial program 99.9%
Taylor expanded in y around inf 93.7%
Simplified93.7%
if -4.3000000000000001e114 < y < -1.12e-7 or 2.2000000000000001e-14 < y < 7.59999999999999967e62Initial program 100.0%
associate-+l+100.0%
+-commutative100.0%
flip-+0.0%
pow20.0%
pow20.0%
Applied egg-rr0.0%
Simplified70.5%
Taylor expanded in x around 0 70.5%
if -1.12e-7 < y < 2.2000000000000001e-14Initial program 100.0%
Taylor expanded in y around 0 82.2%
Final simplification83.6%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* y (* x 2.0))))
(if (<= x -5.2e+101)
(* x t)
(if (<= x -200.0)
t_1
(if (<= x 9.6e-23)
(* y 5.0)
(if (<= x 1.95e+101) (* 2.0 (* x z)) t_1))))))
double code(double x, double y, double z, double t) {
double t_1 = y * (x * 2.0);
double tmp;
if (x <= -5.2e+101) {
tmp = x * t;
} else if (x <= -200.0) {
tmp = t_1;
} else if (x <= 9.6e-23) {
tmp = y * 5.0;
} else if (x <= 1.95e+101) {
tmp = 2.0 * (x * z);
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: tmp
t_1 = y * (x * 2.0d0)
if (x <= (-5.2d+101)) then
tmp = x * t
else if (x <= (-200.0d0)) then
tmp = t_1
else if (x <= 9.6d-23) then
tmp = y * 5.0d0
else if (x <= 1.95d+101) then
tmp = 2.0d0 * (x * z)
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = y * (x * 2.0);
double tmp;
if (x <= -5.2e+101) {
tmp = x * t;
} else if (x <= -200.0) {
tmp = t_1;
} else if (x <= 9.6e-23) {
tmp = y * 5.0;
} else if (x <= 1.95e+101) {
tmp = 2.0 * (x * z);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = y * (x * 2.0) tmp = 0 if x <= -5.2e+101: tmp = x * t elif x <= -200.0: tmp = t_1 elif x <= 9.6e-23: tmp = y * 5.0 elif x <= 1.95e+101: tmp = 2.0 * (x * z) else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(y * Float64(x * 2.0)) tmp = 0.0 if (x <= -5.2e+101) tmp = Float64(x * t); elseif (x <= -200.0) tmp = t_1; elseif (x <= 9.6e-23) tmp = Float64(y * 5.0); elseif (x <= 1.95e+101) tmp = Float64(2.0 * Float64(x * z)); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = y * (x * 2.0); tmp = 0.0; if (x <= -5.2e+101) tmp = x * t; elseif (x <= -200.0) tmp = t_1; elseif (x <= 9.6e-23) tmp = y * 5.0; elseif (x <= 1.95e+101) tmp = 2.0 * (x * z); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(y * N[(x * 2.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -5.2e+101], N[(x * t), $MachinePrecision], If[LessEqual[x, -200.0], t$95$1, If[LessEqual[x, 9.6e-23], N[(y * 5.0), $MachinePrecision], If[LessEqual[x, 1.95e+101], N[(2.0 * N[(x * z), $MachinePrecision]), $MachinePrecision], t$95$1]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := y \cdot \left(x \cdot 2\right)\\
\mathbf{if}\;x \leq -5.2 \cdot 10^{+101}:\\
\;\;\;\;x \cdot t\\
\mathbf{elif}\;x \leq -200:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \leq 9.6 \cdot 10^{-23}:\\
\;\;\;\;y \cdot 5\\
\mathbf{elif}\;x \leq 1.95 \cdot 10^{+101}:\\
\;\;\;\;2 \cdot \left(x \cdot z\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if x < -5.2e101Initial program 100.0%
Taylor expanded in t around inf 61.4%
Simplified61.4%
if -5.2e101 < x < -200 or 1.95e101 < x Initial program 100.0%
Taylor expanded in y around 0 100.0%
Taylor expanded in z around 0 80.0%
Taylor expanded in x around inf 79.9%
Taylor expanded in t around 0 51.5%
*-commutative51.5%
*-commutative51.5%
associate-*r*51.5%
Simplified51.5%
if -200 < x < 9.59999999999999986e-23Initial program 99.9%
Taylor expanded in x around 0 58.5%
if 9.59999999999999986e-23 < x < 1.95e101Initial program 100.0%
Taylor expanded in z around inf 50.0%
Final simplification56.3%
(FPCore (x y z t) :precision binary64 (if (or (<= y -9e-56) (not (<= y 5.5e-17))) (+ (* y (+ 5.0 (* x 2.0))) (* x t)) (* x (+ t (* 2.0 (+ y z))))))
double code(double x, double y, double z, double t) {
double tmp;
if ((y <= -9e-56) || !(y <= 5.5e-17)) {
tmp = (y * (5.0 + (x * 2.0))) + (x * t);
} else {
tmp = x * (t + (2.0 * (y + 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 <= (-9d-56)) .or. (.not. (y <= 5.5d-17))) then
tmp = (y * (5.0d0 + (x * 2.0d0))) + (x * t)
else
tmp = x * (t + (2.0d0 * (y + z)))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((y <= -9e-56) || !(y <= 5.5e-17)) {
tmp = (y * (5.0 + (x * 2.0))) + (x * t);
} else {
tmp = x * (t + (2.0 * (y + z)));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (y <= -9e-56) or not (y <= 5.5e-17): tmp = (y * (5.0 + (x * 2.0))) + (x * t) else: tmp = x * (t + (2.0 * (y + z))) return tmp
function code(x, y, z, t) tmp = 0.0 if ((y <= -9e-56) || !(y <= 5.5e-17)) tmp = Float64(Float64(y * Float64(5.0 + Float64(x * 2.0))) + Float64(x * t)); else tmp = Float64(x * Float64(t + Float64(2.0 * Float64(y + z)))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((y <= -9e-56) || ~((y <= 5.5e-17))) tmp = (y * (5.0 + (x * 2.0))) + (x * t); else tmp = x * (t + (2.0 * (y + z))); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[y, -9e-56], N[Not[LessEqual[y, 5.5e-17]], $MachinePrecision]], N[(N[(y * N[(5.0 + N[(x * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(x * t), $MachinePrecision]), $MachinePrecision], N[(x * N[(t + N[(2.0 * N[(y + z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -9 \cdot 10^{-56} \lor \neg \left(y \leq 5.5 \cdot 10^{-17}\right):\\
\;\;\;\;y \cdot \left(5 + x \cdot 2\right) + x \cdot t\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(t + 2 \cdot \left(y + z\right)\right)\\
\end{array}
\end{array}
if y < -9.0000000000000001e-56 or 5.50000000000000001e-17 < y Initial program 99.9%
Taylor expanded in y around 0 97.9%
Taylor expanded in z around 0 87.7%
if -9.0000000000000001e-56 < y < 5.50000000000000001e-17Initial program 100.0%
fma-def100.0%
associate-+l+100.0%
+-commutative100.0%
count-2100.0%
Simplified100.0%
Taylor expanded in x around inf 88.6%
Final simplification88.1%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* 2.0 (+ y z))))
(if (or (<= x -1.1e+32) (not (<= x 65000000000000.0)))
(* x (+ t t_1))
(+ (* x t_1) (* y 5.0)))))
double code(double x, double y, double z, double t) {
double t_1 = 2.0 * (y + z);
double tmp;
if ((x <= -1.1e+32) || !(x <= 65000000000000.0)) {
tmp = x * (t + t_1);
} else {
tmp = (x * t_1) + (y * 5.0);
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: tmp
t_1 = 2.0d0 * (y + z)
if ((x <= (-1.1d+32)) .or. (.not. (x <= 65000000000000.0d0))) then
tmp = x * (t + t_1)
else
tmp = (x * t_1) + (y * 5.0d0)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = 2.0 * (y + z);
double tmp;
if ((x <= -1.1e+32) || !(x <= 65000000000000.0)) {
tmp = x * (t + t_1);
} else {
tmp = (x * t_1) + (y * 5.0);
}
return tmp;
}
def code(x, y, z, t): t_1 = 2.0 * (y + z) tmp = 0 if (x <= -1.1e+32) or not (x <= 65000000000000.0): tmp = x * (t + t_1) else: tmp = (x * t_1) + (y * 5.0) return tmp
function code(x, y, z, t) t_1 = Float64(2.0 * Float64(y + z)) tmp = 0.0 if ((x <= -1.1e+32) || !(x <= 65000000000000.0)) tmp = Float64(x * Float64(t + t_1)); else tmp = Float64(Float64(x * t_1) + Float64(y * 5.0)); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = 2.0 * (y + z); tmp = 0.0; if ((x <= -1.1e+32) || ~((x <= 65000000000000.0))) tmp = x * (t + t_1); else tmp = (x * t_1) + (y * 5.0); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(2.0 * N[(y + z), $MachinePrecision]), $MachinePrecision]}, If[Or[LessEqual[x, -1.1e+32], N[Not[LessEqual[x, 65000000000000.0]], $MachinePrecision]], N[(x * N[(t + t$95$1), $MachinePrecision]), $MachinePrecision], N[(N[(x * t$95$1), $MachinePrecision] + N[(y * 5.0), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := 2 \cdot \left(y + z\right)\\
\mathbf{if}\;x \leq -1.1 \cdot 10^{+32} \lor \neg \left(x \leq 65000000000000\right):\\
\;\;\;\;x \cdot \left(t + t\_1\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot t\_1 + y \cdot 5\\
\end{array}
\end{array}
if x < -1.1e32 or 6.5e13 < x Initial program 100.0%
fma-def100.0%
associate-+l+100.0%
+-commutative100.0%
count-2100.0%
Simplified100.0%
Taylor expanded in x around inf 100.0%
if -1.1e32 < x < 6.5e13Initial program 99.9%
Taylor expanded in t around 0 85.3%
Simplified85.3%
Final simplification92.5%
(FPCore (x y z t)
:precision binary64
(if (<= x -200.0)
(* x t)
(if (<= x 1.18e-24)
(* y 5.0)
(if (<= x 1.55e+101) (* 2.0 (* x z)) (* x t)))))
double code(double x, double y, double z, double t) {
double tmp;
if (x <= -200.0) {
tmp = x * t;
} else if (x <= 1.18e-24) {
tmp = y * 5.0;
} else if (x <= 1.55e+101) {
tmp = 2.0 * (x * z);
} 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 <= (-200.0d0)) then
tmp = x * t
else if (x <= 1.18d-24) then
tmp = y * 5.0d0
else if (x <= 1.55d+101) then
tmp = 2.0d0 * (x * z)
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 <= -200.0) {
tmp = x * t;
} else if (x <= 1.18e-24) {
tmp = y * 5.0;
} else if (x <= 1.55e+101) {
tmp = 2.0 * (x * z);
} else {
tmp = x * t;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if x <= -200.0: tmp = x * t elif x <= 1.18e-24: tmp = y * 5.0 elif x <= 1.55e+101: tmp = 2.0 * (x * z) else: tmp = x * t return tmp
function code(x, y, z, t) tmp = 0.0 if (x <= -200.0) tmp = Float64(x * t); elseif (x <= 1.18e-24) tmp = Float64(y * 5.0); elseif (x <= 1.55e+101) tmp = Float64(2.0 * Float64(x * z)); else tmp = Float64(x * t); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (x <= -200.0) tmp = x * t; elseif (x <= 1.18e-24) tmp = y * 5.0; elseif (x <= 1.55e+101) tmp = 2.0 * (x * z); else tmp = x * t; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[x, -200.0], N[(x * t), $MachinePrecision], If[LessEqual[x, 1.18e-24], N[(y * 5.0), $MachinePrecision], If[LessEqual[x, 1.55e+101], N[(2.0 * N[(x * z), $MachinePrecision]), $MachinePrecision], N[(x * t), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -200:\\
\;\;\;\;x \cdot t\\
\mathbf{elif}\;x \leq 1.18 \cdot 10^{-24}:\\
\;\;\;\;y \cdot 5\\
\mathbf{elif}\;x \leq 1.55 \cdot 10^{+101}:\\
\;\;\;\;2 \cdot \left(x \cdot z\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot t\\
\end{array}
\end{array}
if x < -200 or 1.55e101 < x Initial program 100.0%
Taylor expanded in t around inf 46.6%
Simplified46.6%
if -200 < x < 1.18e-24Initial program 99.9%
Taylor expanded in x around 0 58.5%
if 1.18e-24 < x < 1.55e101Initial program 100.0%
Taylor expanded in z around inf 50.0%
Final simplification52.5%
(FPCore (x y z t) :precision binary64 (if (or (<= x -2.45e-79) (not (<= x 4.5e-28))) (* 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.45e-79) || !(x <= 4.5e-28)) {
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.45d-79)) .or. (.not. (x <= 4.5d-28))) 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.45e-79) || !(x <= 4.5e-28)) {
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.45e-79) or not (x <= 4.5e-28): 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.45e-79) || !(x <= 4.5e-28)) 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.45e-79) || ~((x <= 4.5e-28))) 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.45e-79], N[Not[LessEqual[x, 4.5e-28]], $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.45 \cdot 10^{-79} \lor \neg \left(x \leq 4.5 \cdot 10^{-28}\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.45e-79 or 4.4999999999999998e-28 < x Initial program 100.0%
fma-def100.0%
associate-+l+100.0%
+-commutative100.0%
count-2100.0%
Simplified100.0%
Taylor expanded in x around inf 94.4%
if -2.45e-79 < x < 4.4999999999999998e-28Initial program 99.9%
associate-+l+99.9%
+-commutative99.9%
flip-+0.0%
pow20.0%
pow20.0%
Applied egg-rr0.0%
Simplified77.7%
Taylor expanded in x around 0 77.7%
Final simplification87.7%
(FPCore (x y z t) :precision binary64 (if (or (<= y -1e+116) (not (<= y 260000000.0))) (* y (+ 5.0 (* x 2.0))) (* x (+ t (* z 2.0)))))
double code(double x, double y, double z, double t) {
double tmp;
if ((y <= -1e+116) || !(y <= 260000000.0)) {
tmp = y * (5.0 + (x * 2.0));
} else {
tmp = x * (t + (z * 2.0));
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if ((y <= (-1d+116)) .or. (.not. (y <= 260000000.0d0))) then
tmp = y * (5.0d0 + (x * 2.0d0))
else
tmp = x * (t + (z * 2.0d0))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((y <= -1e+116) || !(y <= 260000000.0)) {
tmp = y * (5.0 + (x * 2.0));
} else {
tmp = x * (t + (z * 2.0));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (y <= -1e+116) or not (y <= 260000000.0): tmp = y * (5.0 + (x * 2.0)) else: tmp = x * (t + (z * 2.0)) return tmp
function code(x, y, z, t) tmp = 0.0 if ((y <= -1e+116) || !(y <= 260000000.0)) tmp = Float64(y * Float64(5.0 + Float64(x * 2.0))); else tmp = Float64(x * Float64(t + Float64(z * 2.0))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((y <= -1e+116) || ~((y <= 260000000.0))) tmp = y * (5.0 + (x * 2.0)); else tmp = x * (t + (z * 2.0)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[y, -1e+116], N[Not[LessEqual[y, 260000000.0]], $MachinePrecision]], N[(y * N[(5.0 + N[(x * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x * N[(t + N[(z * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1 \cdot 10^{+116} \lor \neg \left(y \leq 260000000\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 < -1.00000000000000002e116 or 2.6e8 < y Initial program 100.0%
Taylor expanded in y around inf 87.2%
Simplified87.2%
if -1.00000000000000002e116 < y < 2.6e8Initial program 100.0%
Taylor expanded in y around 0 75.8%
Final simplification80.2%
(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 100.0%
Taylor expanded in y around 0 98.8%
Final simplification98.8%
(FPCore (x y z t) :precision binary64 (+ (* x (+ t (+ y (+ z (+ y z))))) (* y 5.0)))
double code(double x, double y, double z, double t) {
return (x * (t + (y + (z + (y + z))))) + (y * 5.0);
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = (x * (t + (y + (z + (y + z))))) + (y * 5.0d0)
end function
public static double code(double x, double y, double z, double t) {
return (x * (t + (y + (z + (y + z))))) + (y * 5.0);
}
def code(x, y, z, t): return (x * (t + (y + (z + (y + z))))) + (y * 5.0)
function code(x, y, z, t) return Float64(Float64(x * Float64(t + Float64(y + Float64(z + Float64(y + z))))) + Float64(y * 5.0)) end
function tmp = code(x, y, z, t) tmp = (x * (t + (y + (z + (y + z))))) + (y * 5.0); end
code[x_, y_, z_, t_] := N[(N[(x * N[(t + N[(y + N[(z + N[(y + z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(y * 5.0), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x \cdot \left(t + \left(y + \left(z + \left(y + z\right)\right)\right)\right) + y \cdot 5
\end{array}
Initial program 100.0%
Final simplification100.0%
(FPCore (x y z t) :precision binary64 (if (or (<= x -200.0) (not (<= x 50000000000000.0))) (* x t) (* y 5.0)))
double code(double x, double y, double z, double t) {
double tmp;
if ((x <= -200.0) || !(x <= 50000000000000.0)) {
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 <= (-200.0d0)) .or. (.not. (x <= 50000000000000.0d0))) 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 <= -200.0) || !(x <= 50000000000000.0)) {
tmp = x * t;
} else {
tmp = y * 5.0;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (x <= -200.0) or not (x <= 50000000000000.0): tmp = x * t else: tmp = y * 5.0 return tmp
function code(x, y, z, t) tmp = 0.0 if ((x <= -200.0) || !(x <= 50000000000000.0)) 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 <= -200.0) || ~((x <= 50000000000000.0))) tmp = x * t; else tmp = y * 5.0; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[x, -200.0], N[Not[LessEqual[x, 50000000000000.0]], $MachinePrecision]], N[(x * t), $MachinePrecision], N[(y * 5.0), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -200 \lor \neg \left(x \leq 50000000000000\right):\\
\;\;\;\;x \cdot t\\
\mathbf{else}:\\
\;\;\;\;y \cdot 5\\
\end{array}
\end{array}
if x < -200 or 5e13 < x Initial program 100.0%
Taylor expanded in t around inf 42.5%
Simplified42.5%
if -200 < x < 5e13Initial program 99.9%
Taylor expanded in x around 0 56.1%
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 100.0%
Taylor expanded in x around 0 29.1%
Final simplification29.1%
herbie shell --seed 2024029
(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)))