
(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 14 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 y 5.0 (* x (fma (+ y z) 2.0 t))))
double code(double x, double y, double z, double t) {
return fma(y, 5.0, (x * fma((y + z), 2.0, t)));
}
function code(x, y, z, t) return fma(y, 5.0, Float64(x * fma(Float64(y + z), 2.0, t))) end
code[x_, y_, z_, t_] := N[(y * 5.0 + N[(x * N[(N[(y + z), $MachinePrecision] * 2.0 + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\mathsf{fma}\left(y, 5, x \cdot \mathsf{fma}\left(y + z, 2, t\right)\right)
\end{array}
Initial program 99.5%
+-commutative99.5%
fma-def99.6%
distribute-rgt-in96.9%
associate-+l+96.9%
+-commutative96.9%
count-296.9%
distribute-rgt-in99.6%
*-commutative99.6%
fma-def99.6%
Applied egg-rr99.6%
Final simplification99.6%
(FPCore (x y z t) :precision binary64 (fma x (+ t (* (+ y z) 2.0)) (* y 5.0)))
double code(double x, double y, double z, double t) {
return fma(x, (t + ((y + z) * 2.0)), (y * 5.0));
}
function code(x, y, z, t) return fma(x, Float64(t + Float64(Float64(y + z) * 2.0)), Float64(y * 5.0)) end
code[x_, y_, z_, t_] := N[(x * N[(t + N[(N[(y + z), $MachinePrecision] * 2.0), $MachinePrecision]), $MachinePrecision] + N[(y * 5.0), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\mathsf{fma}\left(x, t + \left(y + z\right) \cdot 2, y \cdot 5\right)
\end{array}
Initial program 99.5%
fma-def99.5%
associate-+l+99.5%
+-commutative99.5%
count-299.5%
Simplified99.5%
Final simplification99.5%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* x (+ t (* z 2.0)))) (t_2 (* y (+ 5.0 (* x 2.0)))))
(if (<= y -1.15e+129)
t_2
(if (<= y -2.45e+89)
t_1
(if (<= y -1.22e-17)
t_2
(if (<= y 6e+104)
t_1
(if (<= y 6.5e+178)
t_2
(if (<= y 1.85e+188)
(* 2.0 (* x (+ y z)))
(if (<= y 2.8e+202) (* x (+ t (* y 2.0))) t_2)))))))))
double code(double x, double y, double z, double t) {
double t_1 = x * (t + (z * 2.0));
double t_2 = y * (5.0 + (x * 2.0));
double tmp;
if (y <= -1.15e+129) {
tmp = t_2;
} else if (y <= -2.45e+89) {
tmp = t_1;
} else if (y <= -1.22e-17) {
tmp = t_2;
} else if (y <= 6e+104) {
tmp = t_1;
} else if (y <= 6.5e+178) {
tmp = t_2;
} else if (y <= 1.85e+188) {
tmp = 2.0 * (x * (y + z));
} else if (y <= 2.8e+202) {
tmp = x * (t + (y * 2.0));
} 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 = x * (t + (z * 2.0d0))
t_2 = y * (5.0d0 + (x * 2.0d0))
if (y <= (-1.15d+129)) then
tmp = t_2
else if (y <= (-2.45d+89)) then
tmp = t_1
else if (y <= (-1.22d-17)) then
tmp = t_2
else if (y <= 6d+104) then
tmp = t_1
else if (y <= 6.5d+178) then
tmp = t_2
else if (y <= 1.85d+188) then
tmp = 2.0d0 * (x * (y + z))
else if (y <= 2.8d+202) then
tmp = x * (t + (y * 2.0d0))
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 = x * (t + (z * 2.0));
double t_2 = y * (5.0 + (x * 2.0));
double tmp;
if (y <= -1.15e+129) {
tmp = t_2;
} else if (y <= -2.45e+89) {
tmp = t_1;
} else if (y <= -1.22e-17) {
tmp = t_2;
} else if (y <= 6e+104) {
tmp = t_1;
} else if (y <= 6.5e+178) {
tmp = t_2;
} else if (y <= 1.85e+188) {
tmp = 2.0 * (x * (y + z));
} else if (y <= 2.8e+202) {
tmp = x * (t + (y * 2.0));
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t): t_1 = x * (t + (z * 2.0)) t_2 = y * (5.0 + (x * 2.0)) tmp = 0 if y <= -1.15e+129: tmp = t_2 elif y <= -2.45e+89: tmp = t_1 elif y <= -1.22e-17: tmp = t_2 elif y <= 6e+104: tmp = t_1 elif y <= 6.5e+178: tmp = t_2 elif y <= 1.85e+188: tmp = 2.0 * (x * (y + z)) elif y <= 2.8e+202: tmp = x * (t + (y * 2.0)) else: tmp = t_2 return tmp
function code(x, y, z, t) t_1 = Float64(x * Float64(t + Float64(z * 2.0))) t_2 = Float64(y * Float64(5.0 + Float64(x * 2.0))) tmp = 0.0 if (y <= -1.15e+129) tmp = t_2; elseif (y <= -2.45e+89) tmp = t_1; elseif (y <= -1.22e-17) tmp = t_2; elseif (y <= 6e+104) tmp = t_1; elseif (y <= 6.5e+178) tmp = t_2; elseif (y <= 1.85e+188) tmp = Float64(2.0 * Float64(x * Float64(y + z))); elseif (y <= 2.8e+202) tmp = Float64(x * Float64(t + Float64(y * 2.0))); else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = x * (t + (z * 2.0)); t_2 = y * (5.0 + (x * 2.0)); tmp = 0.0; if (y <= -1.15e+129) tmp = t_2; elseif (y <= -2.45e+89) tmp = t_1; elseif (y <= -1.22e-17) tmp = t_2; elseif (y <= 6e+104) tmp = t_1; elseif (y <= 6.5e+178) tmp = t_2; elseif (y <= 1.85e+188) tmp = 2.0 * (x * (y + z)); elseif (y <= 2.8e+202) tmp = x * (t + (y * 2.0)); else tmp = t_2; 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]}, Block[{t$95$2 = N[(y * N[(5.0 + N[(x * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -1.15e+129], t$95$2, If[LessEqual[y, -2.45e+89], t$95$1, If[LessEqual[y, -1.22e-17], t$95$2, If[LessEqual[y, 6e+104], t$95$1, If[LessEqual[y, 6.5e+178], t$95$2, If[LessEqual[y, 1.85e+188], N[(2.0 * N[(x * N[(y + z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 2.8e+202], N[(x * N[(t + N[(y * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$2]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot \left(t + z \cdot 2\right)\\
t_2 := y \cdot \left(5 + x \cdot 2\right)\\
\mathbf{if}\;y \leq -1.15 \cdot 10^{+129}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;y \leq -2.45 \cdot 10^{+89}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;y \leq -1.22 \cdot 10^{-17}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;y \leq 6 \cdot 10^{+104}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;y \leq 6.5 \cdot 10^{+178}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;y \leq 1.85 \cdot 10^{+188}:\\
\;\;\;\;2 \cdot \left(x \cdot \left(y + z\right)\right)\\
\mathbf{elif}\;y \leq 2.8 \cdot 10^{+202}:\\
\;\;\;\;x \cdot \left(t + y \cdot 2\right)\\
\mathbf{else}:\\
\;\;\;\;t_2\\
\end{array}
\end{array}
if y < -1.14999999999999995e129 or -2.44999999999999998e89 < y < -1.22e-17 or 5.99999999999999937e104 < y < 6.5000000000000005e178 or 2.80000000000000016e202 < y Initial program 98.7%
fma-def98.7%
associate-+l+98.7%
+-commutative98.7%
count-298.7%
Simplified98.7%
Taylor expanded in y around inf 80.5%
if -1.14999999999999995e129 < y < -2.44999999999999998e89 or -1.22e-17 < y < 5.99999999999999937e104Initial program 99.9%
fma-def100.0%
associate-+l+100.0%
+-commutative100.0%
count-2100.0%
Simplified100.0%
Taylor expanded in x around inf 83.5%
Taylor expanded in y around 0 80.0%
if 6.5000000000000005e178 < y < 1.85e188Initial program 99.6%
fma-def99.6%
associate-+l+99.6%
+-commutative99.6%
count-299.6%
Simplified99.6%
Taylor expanded in x around inf 91.6%
Taylor expanded in t around 0 89.1%
if 1.85e188 < y < 2.80000000000000016e202Initial 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%
Taylor expanded in z around 0 100.0%
Final simplification80.5%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* 2.0 (* y x))))
(if (<= x -6.2e+199)
(* x t)
(if (<= x -9e+156)
t_1
(if (<= x -1.12e+46)
(* x t)
(if (<= x -1.9e+14)
t_1
(if (<= x -2.45e-45)
(* x t)
(if (<= x 1.9e-9)
(* y 5.0)
(if (<= x 1.65e+229) (* x t) t_1)))))))))
double code(double x, double y, double z, double t) {
double t_1 = 2.0 * (y * x);
double tmp;
if (x <= -6.2e+199) {
tmp = x * t;
} else if (x <= -9e+156) {
tmp = t_1;
} else if (x <= -1.12e+46) {
tmp = x * t;
} else if (x <= -1.9e+14) {
tmp = t_1;
} else if (x <= -2.45e-45) {
tmp = x * t;
} else if (x <= 1.9e-9) {
tmp = y * 5.0;
} else if (x <= 1.65e+229) {
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 * (y * x)
if (x <= (-6.2d+199)) then
tmp = x * t
else if (x <= (-9d+156)) then
tmp = t_1
else if (x <= (-1.12d+46)) then
tmp = x * t
else if (x <= (-1.9d+14)) then
tmp = t_1
else if (x <= (-2.45d-45)) then
tmp = x * t
else if (x <= 1.9d-9) then
tmp = y * 5.0d0
else if (x <= 1.65d+229) 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 * (y * x);
double tmp;
if (x <= -6.2e+199) {
tmp = x * t;
} else if (x <= -9e+156) {
tmp = t_1;
} else if (x <= -1.12e+46) {
tmp = x * t;
} else if (x <= -1.9e+14) {
tmp = t_1;
} else if (x <= -2.45e-45) {
tmp = x * t;
} else if (x <= 1.9e-9) {
tmp = y * 5.0;
} else if (x <= 1.65e+229) {
tmp = x * t;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = 2.0 * (y * x) tmp = 0 if x <= -6.2e+199: tmp = x * t elif x <= -9e+156: tmp = t_1 elif x <= -1.12e+46: tmp = x * t elif x <= -1.9e+14: tmp = t_1 elif x <= -2.45e-45: tmp = x * t elif x <= 1.9e-9: tmp = y * 5.0 elif x <= 1.65e+229: tmp = x * t else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(2.0 * Float64(y * x)) tmp = 0.0 if (x <= -6.2e+199) tmp = Float64(x * t); elseif (x <= -9e+156) tmp = t_1; elseif (x <= -1.12e+46) tmp = Float64(x * t); elseif (x <= -1.9e+14) tmp = t_1; elseif (x <= -2.45e-45) tmp = Float64(x * t); elseif (x <= 1.9e-9) tmp = Float64(y * 5.0); elseif (x <= 1.65e+229) tmp = Float64(x * t); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = 2.0 * (y * x); tmp = 0.0; if (x <= -6.2e+199) tmp = x * t; elseif (x <= -9e+156) tmp = t_1; elseif (x <= -1.12e+46) tmp = x * t; elseif (x <= -1.9e+14) tmp = t_1; elseif (x <= -2.45e-45) tmp = x * t; elseif (x <= 1.9e-9) tmp = y * 5.0; elseif (x <= 1.65e+229) 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[(y * x), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -6.2e+199], N[(x * t), $MachinePrecision], If[LessEqual[x, -9e+156], t$95$1, If[LessEqual[x, -1.12e+46], N[(x * t), $MachinePrecision], If[LessEqual[x, -1.9e+14], t$95$1, If[LessEqual[x, -2.45e-45], N[(x * t), $MachinePrecision], If[LessEqual[x, 1.9e-9], N[(y * 5.0), $MachinePrecision], If[LessEqual[x, 1.65e+229], N[(x * t), $MachinePrecision], t$95$1]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := 2 \cdot \left(y \cdot x\right)\\
\mathbf{if}\;x \leq -6.2 \cdot 10^{+199}:\\
\;\;\;\;x \cdot t\\
\mathbf{elif}\;x \leq -9 \cdot 10^{+156}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \leq -1.12 \cdot 10^{+46}:\\
\;\;\;\;x \cdot t\\
\mathbf{elif}\;x \leq -1.9 \cdot 10^{+14}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \leq -2.45 \cdot 10^{-45}:\\
\;\;\;\;x \cdot t\\
\mathbf{elif}\;x \leq 1.9 \cdot 10^{-9}:\\
\;\;\;\;y \cdot 5\\
\mathbf{elif}\;x \leq 1.65 \cdot 10^{+229}:\\
\;\;\;\;x \cdot t\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if x < -6.19999999999999971e199 or -9.00000000000000061e156 < x < -1.12e46 or -1.9e14 < x < -2.4499999999999999e-45 or 1.90000000000000006e-9 < x < 1.65e229Initial program 99.1%
fma-def99.1%
associate-+l+99.1%
+-commutative99.1%
count-299.1%
Simplified99.1%
Taylor expanded in x around inf 98.0%
Taylor expanded in t around inf 47.3%
*-commutative47.3%
Simplified47.3%
if -6.19999999999999971e199 < x < -9.00000000000000061e156 or -1.12e46 < x < -1.9e14 or 1.65e229 < 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%
Taylor expanded in y around inf 60.7%
if -2.4499999999999999e-45 < x < 1.90000000000000006e-9Initial program 99.8%
Taylor expanded in x around 0 59.3%
Simplified59.3%
Final simplification54.2%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* x (+ t (* y 2.0)))))
(if (<= x -1.1e+259)
(* x (* z 2.0))
(if (<= x -2.45e-42)
t_1
(if (<= x 4.2e-97)
(* y 5.0)
(if (or (<= x 5.4e+180) (not (<= x 4.3e+256)))
(* 2.0 (* x (+ 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 <= -1.1e+259) {
tmp = x * (z * 2.0);
} else if (x <= -2.45e-42) {
tmp = t_1;
} else if (x <= 4.2e-97) {
tmp = y * 5.0;
} else if ((x <= 5.4e+180) || !(x <= 4.3e+256)) {
tmp = 2.0 * (x * (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 <= (-1.1d+259)) then
tmp = x * (z * 2.0d0)
else if (x <= (-2.45d-42)) then
tmp = t_1
else if (x <= 4.2d-97) then
tmp = y * 5.0d0
else if ((x <= 5.4d+180) .or. (.not. (x <= 4.3d+256))) then
tmp = 2.0d0 * (x * (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 <= -1.1e+259) {
tmp = x * (z * 2.0);
} else if (x <= -2.45e-42) {
tmp = t_1;
} else if (x <= 4.2e-97) {
tmp = y * 5.0;
} else if ((x <= 5.4e+180) || !(x <= 4.3e+256)) {
tmp = 2.0 * (x * (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 <= -1.1e+259: tmp = x * (z * 2.0) elif x <= -2.45e-42: tmp = t_1 elif x <= 4.2e-97: tmp = y * 5.0 elif (x <= 5.4e+180) or not (x <= 4.3e+256): tmp = 2.0 * (x * (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 <= -1.1e+259) tmp = Float64(x * Float64(z * 2.0)); elseif (x <= -2.45e-42) tmp = t_1; elseif (x <= 4.2e-97) tmp = Float64(y * 5.0); elseif ((x <= 5.4e+180) || !(x <= 4.3e+256)) tmp = Float64(2.0 * Float64(x * 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 <= -1.1e+259) tmp = x * (z * 2.0); elseif (x <= -2.45e-42) tmp = t_1; elseif (x <= 4.2e-97) tmp = y * 5.0; elseif ((x <= 5.4e+180) || ~((x <= 4.3e+256))) tmp = 2.0 * (x * (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, -1.1e+259], N[(x * N[(z * 2.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, -2.45e-42], t$95$1, If[LessEqual[x, 4.2e-97], N[(y * 5.0), $MachinePrecision], If[Or[LessEqual[x, 5.4e+180], N[Not[LessEqual[x, 4.3e+256]], $MachinePrecision]], N[(2.0 * N[(x * 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 -1.1 \cdot 10^{+259}:\\
\;\;\;\;x \cdot \left(z \cdot 2\right)\\
\mathbf{elif}\;x \leq -2.45 \cdot 10^{-42}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \leq 4.2 \cdot 10^{-97}:\\
\;\;\;\;y \cdot 5\\
\mathbf{elif}\;x \leq 5.4 \cdot 10^{+180} \lor \neg \left(x \leq 4.3 \cdot 10^{+256}\right):\\
\;\;\;\;2 \cdot \left(x \cdot \left(y + z\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if x < -1.09999999999999996e259Initial 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%
Taylor expanded in z around inf 92.3%
associate-*r*92.3%
Simplified92.3%
if -1.09999999999999996e259 < x < -2.45e-42 or 5.40000000000000033e180 < x < 4.29999999999999993e256Initial program 98.7%
fma-def98.7%
associate-+l+98.7%
+-commutative98.7%
count-298.7%
Simplified98.7%
Taylor expanded in x around inf 97.2%
Taylor expanded in z around 0 75.1%
if -2.45e-42 < x < 4.2000000000000002e-97Initial program 99.8%
Taylor expanded in x around 0 63.5%
Simplified63.5%
if 4.2000000000000002e-97 < x < 5.40000000000000033e180 or 4.29999999999999993e256 < x Initial program 99.9%
fma-def99.9%
associate-+l+99.9%
+-commutative99.9%
count-299.9%
Simplified99.9%
Taylor expanded in x around inf 91.7%
Taylor expanded in t around 0 66.8%
Final simplification69.5%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* x (+ t (* y 2.0)))))
(if (<= x -1.1e+259)
(* x (* z 2.0))
(if (<= x -1.08e-43)
t_1
(if (<= x 3.3e-96)
(* y (+ 5.0 (* x 2.0)))
(if (or (<= x 1.7e+181) (not (<= x 4.5e+259)))
(* 2.0 (* x (+ 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 <= -1.1e+259) {
tmp = x * (z * 2.0);
} else if (x <= -1.08e-43) {
tmp = t_1;
} else if (x <= 3.3e-96) {
tmp = y * (5.0 + (x * 2.0));
} else if ((x <= 1.7e+181) || !(x <= 4.5e+259)) {
tmp = 2.0 * (x * (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 <= (-1.1d+259)) then
tmp = x * (z * 2.0d0)
else if (x <= (-1.08d-43)) then
tmp = t_1
else if (x <= 3.3d-96) then
tmp = y * (5.0d0 + (x * 2.0d0))
else if ((x <= 1.7d+181) .or. (.not. (x <= 4.5d+259))) then
tmp = 2.0d0 * (x * (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 <= -1.1e+259) {
tmp = x * (z * 2.0);
} else if (x <= -1.08e-43) {
tmp = t_1;
} else if (x <= 3.3e-96) {
tmp = y * (5.0 + (x * 2.0));
} else if ((x <= 1.7e+181) || !(x <= 4.5e+259)) {
tmp = 2.0 * (x * (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 <= -1.1e+259: tmp = x * (z * 2.0) elif x <= -1.08e-43: tmp = t_1 elif x <= 3.3e-96: tmp = y * (5.0 + (x * 2.0)) elif (x <= 1.7e+181) or not (x <= 4.5e+259): tmp = 2.0 * (x * (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 <= -1.1e+259) tmp = Float64(x * Float64(z * 2.0)); elseif (x <= -1.08e-43) tmp = t_1; elseif (x <= 3.3e-96) tmp = Float64(y * Float64(5.0 + Float64(x * 2.0))); elseif ((x <= 1.7e+181) || !(x <= 4.5e+259)) tmp = Float64(2.0 * Float64(x * 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 <= -1.1e+259) tmp = x * (z * 2.0); elseif (x <= -1.08e-43) tmp = t_1; elseif (x <= 3.3e-96) tmp = y * (5.0 + (x * 2.0)); elseif ((x <= 1.7e+181) || ~((x <= 4.5e+259))) tmp = 2.0 * (x * (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, -1.1e+259], N[(x * N[(z * 2.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, -1.08e-43], t$95$1, If[LessEqual[x, 3.3e-96], N[(y * N[(5.0 + N[(x * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[x, 1.7e+181], N[Not[LessEqual[x, 4.5e+259]], $MachinePrecision]], N[(2.0 * N[(x * 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 -1.1 \cdot 10^{+259}:\\
\;\;\;\;x \cdot \left(z \cdot 2\right)\\
\mathbf{elif}\;x \leq -1.08 \cdot 10^{-43}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \leq 3.3 \cdot 10^{-96}:\\
\;\;\;\;y \cdot \left(5 + x \cdot 2\right)\\
\mathbf{elif}\;x \leq 1.7 \cdot 10^{+181} \lor \neg \left(x \leq 4.5 \cdot 10^{+259}\right):\\
\;\;\;\;2 \cdot \left(x \cdot \left(y + z\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if x < -1.09999999999999996e259Initial 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%
Taylor expanded in z around inf 92.3%
associate-*r*92.3%
Simplified92.3%
if -1.09999999999999996e259 < x < -1.08e-43 or 1.70000000000000015e181 < x < 4.4999999999999997e259Initial program 98.7%
fma-def98.7%
associate-+l+98.7%
+-commutative98.7%
count-298.7%
Simplified98.7%
Taylor expanded in x around inf 97.2%
Taylor expanded in z around 0 75.1%
if -1.08e-43 < x < 3.2999999999999999e-96Initial program 99.8%
fma-def99.9%
associate-+l+99.9%
+-commutative99.9%
count-299.9%
Simplified99.9%
Taylor expanded in y around inf 63.5%
if 3.2999999999999999e-96 < x < 1.70000000000000015e181 or 4.4999999999999997e259 < x Initial program 99.9%
fma-def99.9%
associate-+l+99.9%
+-commutative99.9%
count-299.9%
Simplified99.9%
Taylor expanded in x around inf 91.7%
Taylor expanded in t around 0 66.8%
Final simplification69.5%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* x (+ t (* z 2.0)))))
(if (<= x -2.6e+207)
t_1
(if (<= x -4e+162)
(* x (+ t (* y 2.0)))
(if (<= x -2.65e+45)
t_1
(if (<= x -3500000000000.0)
(* 2.0 (* x (+ y z)))
(if (<= x 5.8e-95) (+ (* y 5.0) (* x t)) t_1)))))))
double code(double x, double y, double z, double t) {
double t_1 = x * (t + (z * 2.0));
double tmp;
if (x <= -2.6e+207) {
tmp = t_1;
} else if (x <= -4e+162) {
tmp = x * (t + (y * 2.0));
} else if (x <= -2.65e+45) {
tmp = t_1;
} else if (x <= -3500000000000.0) {
tmp = 2.0 * (x * (y + z));
} else if (x <= 5.8e-95) {
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 * (t + (z * 2.0d0))
if (x <= (-2.6d+207)) then
tmp = t_1
else if (x <= (-4d+162)) then
tmp = x * (t + (y * 2.0d0))
else if (x <= (-2.65d+45)) then
tmp = t_1
else if (x <= (-3500000000000.0d0)) then
tmp = 2.0d0 * (x * (y + z))
else if (x <= 5.8d-95) 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 * (t + (z * 2.0));
double tmp;
if (x <= -2.6e+207) {
tmp = t_1;
} else if (x <= -4e+162) {
tmp = x * (t + (y * 2.0));
} else if (x <= -2.65e+45) {
tmp = t_1;
} else if (x <= -3500000000000.0) {
tmp = 2.0 * (x * (y + z));
} else if (x <= 5.8e-95) {
tmp = (y * 5.0) + (x * t);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = x * (t + (z * 2.0)) tmp = 0 if x <= -2.6e+207: tmp = t_1 elif x <= -4e+162: tmp = x * (t + (y * 2.0)) elif x <= -2.65e+45: tmp = t_1 elif x <= -3500000000000.0: tmp = 2.0 * (x * (y + z)) elif x <= 5.8e-95: tmp = (y * 5.0) + (x * t) else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(x * Float64(t + Float64(z * 2.0))) tmp = 0.0 if (x <= -2.6e+207) tmp = t_1; elseif (x <= -4e+162) tmp = Float64(x * Float64(t + Float64(y * 2.0))); elseif (x <= -2.65e+45) tmp = t_1; elseif (x <= -3500000000000.0) tmp = Float64(2.0 * Float64(x * Float64(y + z))); elseif (x <= 5.8e-95) 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 * (t + (z * 2.0)); tmp = 0.0; if (x <= -2.6e+207) tmp = t_1; elseif (x <= -4e+162) tmp = x * (t + (y * 2.0)); elseif (x <= -2.65e+45) tmp = t_1; elseif (x <= -3500000000000.0) tmp = 2.0 * (x * (y + z)); elseif (x <= 5.8e-95) 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[(t + N[(z * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -2.6e+207], t$95$1, If[LessEqual[x, -4e+162], N[(x * N[(t + N[(y * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, -2.65e+45], t$95$1, If[LessEqual[x, -3500000000000.0], N[(2.0 * N[(x * N[(y + z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 5.8e-95], 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(t + z \cdot 2\right)\\
\mathbf{if}\;x \leq -2.6 \cdot 10^{+207}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \leq -4 \cdot 10^{+162}:\\
\;\;\;\;x \cdot \left(t + y \cdot 2\right)\\
\mathbf{elif}\;x \leq -2.65 \cdot 10^{+45}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \leq -3500000000000:\\
\;\;\;\;2 \cdot \left(x \cdot \left(y + z\right)\right)\\
\mathbf{elif}\;x \leq 5.8 \cdot 10^{-95}:\\
\;\;\;\;y \cdot 5 + x \cdot t\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if x < -2.5999999999999998e207 or -3.9999999999999998e162 < x < -2.64999999999999996e45 or 5.80000000000000004e-95 < x Initial program 99.9%
fma-def99.9%
associate-+l+99.9%
+-commutative99.9%
count-299.9%
Simplified99.9%
Taylor expanded in x around inf 95.6%
Taylor expanded in y around 0 80.1%
if -2.5999999999999998e207 < x < -3.9999999999999998e162Initial 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%
Taylor expanded in z around 0 100.0%
if -2.64999999999999996e45 < x < -3.5e12Initial 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%
Taylor expanded in t around 0 98.6%
if -3.5e12 < x < 5.80000000000000004e-95Initial program 98.9%
Taylor expanded in t around inf 79.3%
Final simplification81.0%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* x (* z 2.0))))
(if (<= x -8.6e+257)
t_1
(if (<= x -7.4e+46)
(* x t)
(if (<= x -4.5e+14)
(* 2.0 (* y x))
(if (<= x -7.3e-40) (* x t) (if (<= x 5.8e-95) (* y 5.0) t_1)))))))
double code(double x, double y, double z, double t) {
double t_1 = x * (z * 2.0);
double tmp;
if (x <= -8.6e+257) {
tmp = t_1;
} else if (x <= -7.4e+46) {
tmp = x * t;
} else if (x <= -4.5e+14) {
tmp = 2.0 * (y * x);
} else if (x <= -7.3e-40) {
tmp = x * t;
} else if (x <= 5.8e-95) {
tmp = y * 5.0;
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: tmp
t_1 = x * (z * 2.0d0)
if (x <= (-8.6d+257)) then
tmp = t_1
else if (x <= (-7.4d+46)) then
tmp = x * t
else if (x <= (-4.5d+14)) then
tmp = 2.0d0 * (y * x)
else if (x <= (-7.3d-40)) then
tmp = x * t
else if (x <= 5.8d-95) then
tmp = y * 5.0d0
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = x * (z * 2.0);
double tmp;
if (x <= -8.6e+257) {
tmp = t_1;
} else if (x <= -7.4e+46) {
tmp = x * t;
} else if (x <= -4.5e+14) {
tmp = 2.0 * (y * x);
} else if (x <= -7.3e-40) {
tmp = x * t;
} else if (x <= 5.8e-95) {
tmp = y * 5.0;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = x * (z * 2.0) tmp = 0 if x <= -8.6e+257: tmp = t_1 elif x <= -7.4e+46: tmp = x * t elif x <= -4.5e+14: tmp = 2.0 * (y * x) elif x <= -7.3e-40: tmp = x * t elif x <= 5.8e-95: tmp = y * 5.0 else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(x * Float64(z * 2.0)) tmp = 0.0 if (x <= -8.6e+257) tmp = t_1; elseif (x <= -7.4e+46) tmp = Float64(x * t); elseif (x <= -4.5e+14) tmp = Float64(2.0 * Float64(y * x)); elseif (x <= -7.3e-40) tmp = Float64(x * t); elseif (x <= 5.8e-95) tmp = Float64(y * 5.0); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = x * (z * 2.0); tmp = 0.0; if (x <= -8.6e+257) tmp = t_1; elseif (x <= -7.4e+46) tmp = x * t; elseif (x <= -4.5e+14) tmp = 2.0 * (y * x); elseif (x <= -7.3e-40) tmp = x * t; elseif (x <= 5.8e-95) tmp = y * 5.0; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(x * N[(z * 2.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -8.6e+257], t$95$1, If[LessEqual[x, -7.4e+46], N[(x * t), $MachinePrecision], If[LessEqual[x, -4.5e+14], N[(2.0 * N[(y * x), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, -7.3e-40], N[(x * t), $MachinePrecision], If[LessEqual[x, 5.8e-95], N[(y * 5.0), $MachinePrecision], t$95$1]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot \left(z \cdot 2\right)\\
\mathbf{if}\;x \leq -8.6 \cdot 10^{+257}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \leq -7.4 \cdot 10^{+46}:\\
\;\;\;\;x \cdot t\\
\mathbf{elif}\;x \leq -4.5 \cdot 10^{+14}:\\
\;\;\;\;2 \cdot \left(y \cdot x\right)\\
\mathbf{elif}\;x \leq -7.3 \cdot 10^{-40}:\\
\;\;\;\;x \cdot t\\
\mathbf{elif}\;x \leq 5.8 \cdot 10^{-95}:\\
\;\;\;\;y \cdot 5\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if x < -8.5999999999999996e257 or 5.80000000000000004e-95 < x Initial program 99.9%
fma-def99.9%
associate-+l+99.9%
+-commutative99.9%
count-299.9%
Simplified99.9%
Taylor expanded in x around inf 94.3%
Taylor expanded in z around inf 51.3%
associate-*r*51.3%
Simplified51.3%
if -8.5999999999999996e257 < x < -7.3999999999999998e46 or -4.5e14 < x < -7.30000000000000005e-40Initial program 98.1%
fma-def98.1%
associate-+l+98.1%
+-commutative98.1%
count-298.1%
Simplified98.1%
Taylor expanded in x around inf 95.9%
Taylor expanded in t around inf 53.4%
*-commutative53.4%
Simplified53.4%
if -7.3999999999999998e46 < x < -4.5e14Initial 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%
Taylor expanded in y around inf 63.3%
if -7.30000000000000005e-40 < x < 5.80000000000000004e-95Initial program 99.8%
Taylor expanded in x around 0 63.5%
Simplified63.5%
Final simplification56.7%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* 2.0 (* x (+ y z)))))
(if (<= t -4.8e+141)
(* x t)
(if (<= t -4.1e-22)
t_1
(if (<= t -7.8e-43) (* y 5.0) (if (<= t 6.2e+69) t_1 (* x t)))))))
double code(double x, double y, double z, double t) {
double t_1 = 2.0 * (x * (y + z));
double tmp;
if (t <= -4.8e+141) {
tmp = x * t;
} else if (t <= -4.1e-22) {
tmp = t_1;
} else if (t <= -7.8e-43) {
tmp = y * 5.0;
} else if (t <= 6.2e+69) {
tmp = t_1;
} else {
tmp = x * t;
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: tmp
t_1 = 2.0d0 * (x * (y + z))
if (t <= (-4.8d+141)) then
tmp = x * t
else if (t <= (-4.1d-22)) then
tmp = t_1
else if (t <= (-7.8d-43)) then
tmp = y * 5.0d0
else if (t <= 6.2d+69) then
tmp = t_1
else
tmp = x * t
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = 2.0 * (x * (y + z));
double tmp;
if (t <= -4.8e+141) {
tmp = x * t;
} else if (t <= -4.1e-22) {
tmp = t_1;
} else if (t <= -7.8e-43) {
tmp = y * 5.0;
} else if (t <= 6.2e+69) {
tmp = t_1;
} else {
tmp = x * t;
}
return tmp;
}
def code(x, y, z, t): t_1 = 2.0 * (x * (y + z)) tmp = 0 if t <= -4.8e+141: tmp = x * t elif t <= -4.1e-22: tmp = t_1 elif t <= -7.8e-43: tmp = y * 5.0 elif t <= 6.2e+69: tmp = t_1 else: tmp = x * t return tmp
function code(x, y, z, t) t_1 = Float64(2.0 * Float64(x * Float64(y + z))) tmp = 0.0 if (t <= -4.8e+141) tmp = Float64(x * t); elseif (t <= -4.1e-22) tmp = t_1; elseif (t <= -7.8e-43) tmp = Float64(y * 5.0); elseif (t <= 6.2e+69) tmp = t_1; else tmp = Float64(x * t); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = 2.0 * (x * (y + z)); tmp = 0.0; if (t <= -4.8e+141) tmp = x * t; elseif (t <= -4.1e-22) tmp = t_1; elseif (t <= -7.8e-43) tmp = y * 5.0; elseif (t <= 6.2e+69) tmp = t_1; else tmp = x * t; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(2.0 * N[(x * N[(y + z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -4.8e+141], N[(x * t), $MachinePrecision], If[LessEqual[t, -4.1e-22], t$95$1, If[LessEqual[t, -7.8e-43], N[(y * 5.0), $MachinePrecision], If[LessEqual[t, 6.2e+69], t$95$1, N[(x * t), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := 2 \cdot \left(x \cdot \left(y + z\right)\right)\\
\mathbf{if}\;t \leq -4.8 \cdot 10^{+141}:\\
\;\;\;\;x \cdot t\\
\mathbf{elif}\;t \leq -4.1 \cdot 10^{-22}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;t \leq -7.8 \cdot 10^{-43}:\\
\;\;\;\;y \cdot 5\\
\mathbf{elif}\;t \leq 6.2 \cdot 10^{+69}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;x \cdot t\\
\end{array}
\end{array}
if t < -4.79999999999999995e141 or 6.1999999999999997e69 < t Initial program 99.9%
fma-def99.9%
associate-+l+99.9%
+-commutative99.9%
count-299.9%
Simplified99.9%
Taylor expanded in x around inf 81.9%
Taylor expanded in t around inf 67.1%
*-commutative67.1%
Simplified67.1%
if -4.79999999999999995e141 < t < -4.0999999999999999e-22 or -7.80000000000000001e-43 < t < 6.1999999999999997e69Initial program 99.3%
fma-def99.3%
associate-+l+99.3%
+-commutative99.3%
count-299.3%
Simplified99.3%
Taylor expanded in x around inf 72.2%
Taylor expanded in t around 0 62.8%
if -4.0999999999999999e-22 < t < -7.80000000000000001e-43Initial program 99.6%
Taylor expanded in x around 0 87.1%
Simplified87.1%
Final simplification64.9%
(FPCore (x y z t) :precision binary64 (+ (* y 5.0) (* x (+ t (+ y (+ z (+ y z)))))))
double code(double x, double y, double z, double t) {
return (y * 5.0) + (x * (t + (y + (z + (y + z)))));
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = (y * 5.0d0) + (x * (t + (y + (z + (y + z)))))
end function
public static double code(double x, double y, double z, double t) {
return (y * 5.0) + (x * (t + (y + (z + (y + z)))));
}
def code(x, y, z, t): return (y * 5.0) + (x * (t + (y + (z + (y + z)))))
function code(x, y, z, t) return Float64(Float64(y * 5.0) + Float64(x * Float64(t + Float64(y + Float64(z + Float64(y + z)))))) end
function tmp = code(x, y, z, t) tmp = (y * 5.0) + (x * (t + (y + (z + (y + z))))); end
code[x_, y_, z_, t_] := N[(N[(y * 5.0), $MachinePrecision] + N[(x * N[(t + N[(y + N[(z + N[(y + z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
y \cdot 5 + x \cdot \left(t + \left(y + \left(z + \left(y + z\right)\right)\right)\right)
\end{array}
Initial program 99.5%
Final simplification99.5%
(FPCore (x y z t) :precision binary64 (if (or (<= x -1.52e-31) (not (<= x 3.4e-98))) (* x (+ t (* (+ y z) 2.0))) (+ (* y 5.0) (* x t))))
double code(double x, double y, double z, double t) {
double tmp;
if ((x <= -1.52e-31) || !(x <= 3.4e-98)) {
tmp = x * (t + ((y + z) * 2.0));
} else {
tmp = (y * 5.0) + (x * t);
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if ((x <= (-1.52d-31)) .or. (.not. (x <= 3.4d-98))) then
tmp = x * (t + ((y + z) * 2.0d0))
else
tmp = (y * 5.0d0) + (x * t)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((x <= -1.52e-31) || !(x <= 3.4e-98)) {
tmp = x * (t + ((y + z) * 2.0));
} else {
tmp = (y * 5.0) + (x * t);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (x <= -1.52e-31) or not (x <= 3.4e-98): tmp = x * (t + ((y + z) * 2.0)) else: tmp = (y * 5.0) + (x * t) return tmp
function code(x, y, z, t) tmp = 0.0 if ((x <= -1.52e-31) || !(x <= 3.4e-98)) tmp = Float64(x * Float64(t + Float64(Float64(y + z) * 2.0))); else tmp = Float64(Float64(y * 5.0) + Float64(x * t)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((x <= -1.52e-31) || ~((x <= 3.4e-98))) tmp = x * (t + ((y + z) * 2.0)); else tmp = (y * 5.0) + (x * t); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[x, -1.52e-31], N[Not[LessEqual[x, 3.4e-98]], $MachinePrecision]], N[(x * N[(t + N[(N[(y + z), $MachinePrecision] * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(y * 5.0), $MachinePrecision] + N[(x * t), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.52 \cdot 10^{-31} \lor \neg \left(x \leq 3.4 \cdot 10^{-98}\right):\\
\;\;\;\;x \cdot \left(t + \left(y + z\right) \cdot 2\right)\\
\mathbf{else}:\\
\;\;\;\;y \cdot 5 + x \cdot t\\
\end{array}
\end{array}
if x < -1.52000000000000003e-31 or 3.4000000000000001e-98 < x Initial program 99.3%
fma-def99.3%
associate-+l+99.3%
+-commutative99.3%
count-299.3%
Simplified99.3%
Taylor expanded in x around inf 95.0%
if -1.52000000000000003e-31 < x < 3.4000000000000001e-98Initial program 99.8%
Taylor expanded in t around inf 81.1%
Final simplification89.6%
(FPCore (x y z t) :precision binary64 (if (or (<= x -3.8e-45) (not (<= x 9.5e-12))) (* x (+ t (* (+ y z) 2.0))) (+ (* y 5.0) (* 2.0 (* x z)))))
double code(double x, double y, double z, double t) {
double tmp;
if ((x <= -3.8e-45) || !(x <= 9.5e-12)) {
tmp = x * (t + ((y + z) * 2.0));
} 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 <= (-3.8d-45)) .or. (.not. (x <= 9.5d-12))) then
tmp = x * (t + ((y + z) * 2.0d0))
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 <= -3.8e-45) || !(x <= 9.5e-12)) {
tmp = x * (t + ((y + z) * 2.0));
} else {
tmp = (y * 5.0) + (2.0 * (x * z));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (x <= -3.8e-45) or not (x <= 9.5e-12): tmp = x * (t + ((y + z) * 2.0)) else: tmp = (y * 5.0) + (2.0 * (x * z)) return tmp
function code(x, y, z, t) tmp = 0.0 if ((x <= -3.8e-45) || !(x <= 9.5e-12)) tmp = Float64(x * Float64(t + Float64(Float64(y + z) * 2.0))); 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 <= -3.8e-45) || ~((x <= 9.5e-12))) tmp = x * (t + ((y + z) * 2.0)); else tmp = (y * 5.0) + (2.0 * (x * z)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[x, -3.8e-45], N[Not[LessEqual[x, 9.5e-12]], $MachinePrecision]], N[(x * N[(t + N[(N[(y + z), $MachinePrecision] * 2.0), $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 -3.8 \cdot 10^{-45} \lor \neg \left(x \leq 9.5 \cdot 10^{-12}\right):\\
\;\;\;\;x \cdot \left(t + \left(y + z\right) \cdot 2\right)\\
\mathbf{else}:\\
\;\;\;\;y \cdot 5 + 2 \cdot \left(x \cdot z\right)\\
\end{array}
\end{array}
if x < -3.79999999999999997e-45 or 9.4999999999999995e-12 < x Initial program 99.3%
fma-def99.3%
associate-+l+99.3%
+-commutative99.3%
count-299.3%
Simplified99.3%
Taylor expanded in x around inf 98.4%
if -3.79999999999999997e-45 < x < 9.4999999999999995e-12Initial program 99.8%
Taylor expanded in z around inf 82.2%
Final simplification91.4%
(FPCore (x y z t) :precision binary64 (if (or (<= x -1.36e-43) (not (<= x 5.6e-11))) (* x t) (* y 5.0)))
double code(double x, double y, double z, double t) {
double tmp;
if ((x <= -1.36e-43) || !(x <= 5.6e-11)) {
tmp = x * t;
} else {
tmp = y * 5.0;
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if ((x <= (-1.36d-43)) .or. (.not. (x <= 5.6d-11))) then
tmp = x * t
else
tmp = y * 5.0d0
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((x <= -1.36e-43) || !(x <= 5.6e-11)) {
tmp = x * t;
} else {
tmp = y * 5.0;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (x <= -1.36e-43) or not (x <= 5.6e-11): tmp = x * t else: tmp = y * 5.0 return tmp
function code(x, y, z, t) tmp = 0.0 if ((x <= -1.36e-43) || !(x <= 5.6e-11)) tmp = Float64(x * t); else tmp = Float64(y * 5.0); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((x <= -1.36e-43) || ~((x <= 5.6e-11))) tmp = x * t; else tmp = y * 5.0; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[x, -1.36e-43], N[Not[LessEqual[x, 5.6e-11]], $MachinePrecision]], N[(x * t), $MachinePrecision], N[(y * 5.0), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.36 \cdot 10^{-43} \lor \neg \left(x \leq 5.6 \cdot 10^{-11}\right):\\
\;\;\;\;x \cdot t\\
\mathbf{else}:\\
\;\;\;\;y \cdot 5\\
\end{array}
\end{array}
if x < -1.36000000000000007e-43 or 5.6e-11 < x Initial program 99.3%
fma-def99.3%
associate-+l+99.3%
+-commutative99.3%
count-299.3%
Simplified99.3%
Taylor expanded in x around inf 98.4%
Taylor expanded in t around inf 40.7%
*-commutative40.7%
Simplified40.7%
if -1.36000000000000007e-43 < x < 5.6e-11Initial program 99.8%
Taylor expanded in x around 0 59.3%
Simplified59.3%
Final simplification48.7%
(FPCore (x y z t) :precision binary64 (* x t))
double code(double x, double y, double z, double t) {
return x * t;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = x * t
end function
public static double code(double x, double y, double z, double t) {
return x * t;
}
def code(x, y, z, t): return x * t
function code(x, y, z, t) return Float64(x * t) end
function tmp = code(x, y, z, t) tmp = x * t; end
code[x_, y_, z_, t_] := N[(x * t), $MachinePrecision]
\begin{array}{l}
\\
x \cdot t
\end{array}
Initial program 99.5%
fma-def99.5%
associate-+l+99.5%
+-commutative99.5%
count-299.5%
Simplified99.5%
Taylor expanded in x around inf 73.9%
Taylor expanded in t around inf 31.4%
*-commutative31.4%
Simplified31.4%
Final simplification31.4%
herbie shell --seed 2023230
(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)))