
(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 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-define99.6%
flip-+61.7%
associate-*r/57.7%
fmm-def59.8%
associate-+l+59.8%
+-commutative59.8%
count-259.8%
associate-+l+59.8%
+-commutative59.8%
count-259.8%
fmm-def57.7%
associate-+l+57.7%
+-commutative57.7%
count-257.7%
Applied egg-rr99.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-define99.5%
associate-+l+99.5%
+-commutative99.5%
count-299.5%
Simplified99.5%
Final simplification99.5%
(FPCore (x y z t) :precision binary64 (if (or (<= x -34000000.0) (not (<= x 1e-24))) (* x (+ t (+ (* (+ y z) 2.0) (* 5.0 (/ y x))))) (+ (* y 5.0) (+ (* x t) (* x (* z 2.0))))))
double code(double x, double y, double z, double t) {
double tmp;
if ((x <= -34000000.0) || !(x <= 1e-24)) {
tmp = x * (t + (((y + z) * 2.0) + (5.0 * (y / x))));
} else {
tmp = (y * 5.0) + ((x * t) + (x * (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 ((x <= (-34000000.0d0)) .or. (.not. (x <= 1d-24))) then
tmp = x * (t + (((y + z) * 2.0d0) + (5.0d0 * (y / x))))
else
tmp = (y * 5.0d0) + ((x * t) + (x * (z * 2.0d0)))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((x <= -34000000.0) || !(x <= 1e-24)) {
tmp = x * (t + (((y + z) * 2.0) + (5.0 * (y / x))));
} else {
tmp = (y * 5.0) + ((x * t) + (x * (z * 2.0)));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (x <= -34000000.0) or not (x <= 1e-24): tmp = x * (t + (((y + z) * 2.0) + (5.0 * (y / x)))) else: tmp = (y * 5.0) + ((x * t) + (x * (z * 2.0))) return tmp
function code(x, y, z, t) tmp = 0.0 if ((x <= -34000000.0) || !(x <= 1e-24)) tmp = Float64(x * Float64(t + Float64(Float64(Float64(y + z) * 2.0) + Float64(5.0 * Float64(y / x))))); else tmp = Float64(Float64(y * 5.0) + Float64(Float64(x * t) + Float64(x * Float64(z * 2.0)))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((x <= -34000000.0) || ~((x <= 1e-24))) tmp = x * (t + (((y + z) * 2.0) + (5.0 * (y / x)))); else tmp = (y * 5.0) + ((x * t) + (x * (z * 2.0))); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[x, -34000000.0], N[Not[LessEqual[x, 1e-24]], $MachinePrecision]], N[(x * N[(t + N[(N[(N[(y + z), $MachinePrecision] * 2.0), $MachinePrecision] + N[(5.0 * N[(y / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(y * 5.0), $MachinePrecision] + N[(N[(x * t), $MachinePrecision] + N[(x * N[(z * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -34000000 \lor \neg \left(x \leq 10^{-24}\right):\\
\;\;\;\;x \cdot \left(t + \left(\left(y + z\right) \cdot 2 + 5 \cdot \frac{y}{x}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;y \cdot 5 + \left(x \cdot t + x \cdot \left(z \cdot 2\right)\right)\\
\end{array}
\end{array}
if x < -3.4e7 or 9.99999999999999924e-25 < x Initial program 99.9%
fma-define99.9%
associate-+l+99.9%
+-commutative99.9%
count-299.9%
Simplified99.9%
Taylor expanded in x around inf 99.9%
if -3.4e7 < x < 9.99999999999999924e-25Initial program 99.1%
distribute-lft-in99.1%
*-commutative99.1%
associate-+l+99.1%
+-commutative99.1%
count-299.1%
*-commutative99.1%
Applied egg-rr99.1%
Taylor expanded in y around 0 99.1%
Final simplification99.5%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* x (+ t (* (+ y z) 2.0)))))
(if (<= x -0.002)
t_1
(if (<= x -7.6e-150)
(+ (* y 5.0) (* 2.0 (* x z)))
(if (<= x 0.017) (+ (* y 5.0) (* x t)) t_1)))))
double code(double x, double y, double z, double t) {
double t_1 = x * (t + ((y + z) * 2.0));
double tmp;
if (x <= -0.002) {
tmp = t_1;
} else if (x <= -7.6e-150) {
tmp = (y * 5.0) + (2.0 * (x * z));
} else if (x <= 0.017) {
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 + ((y + z) * 2.0d0))
if (x <= (-0.002d0)) then
tmp = t_1
else if (x <= (-7.6d-150)) then
tmp = (y * 5.0d0) + (2.0d0 * (x * z))
else if (x <= 0.017d0) 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 + ((y + z) * 2.0));
double tmp;
if (x <= -0.002) {
tmp = t_1;
} else if (x <= -7.6e-150) {
tmp = (y * 5.0) + (2.0 * (x * z));
} else if (x <= 0.017) {
tmp = (y * 5.0) + (x * t);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = x * (t + ((y + z) * 2.0)) tmp = 0 if x <= -0.002: tmp = t_1 elif x <= -7.6e-150: tmp = (y * 5.0) + (2.0 * (x * z)) elif x <= 0.017: 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(Float64(y + z) * 2.0))) tmp = 0.0 if (x <= -0.002) tmp = t_1; elseif (x <= -7.6e-150) tmp = Float64(Float64(y * 5.0) + Float64(2.0 * Float64(x * z))); elseif (x <= 0.017) 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 + ((y + z) * 2.0)); tmp = 0.0; if (x <= -0.002) tmp = t_1; elseif (x <= -7.6e-150) tmp = (y * 5.0) + (2.0 * (x * z)); elseif (x <= 0.017) 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[(N[(y + z), $MachinePrecision] * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -0.002], t$95$1, If[LessEqual[x, -7.6e-150], N[(N[(y * 5.0), $MachinePrecision] + N[(2.0 * N[(x * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 0.017], 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 + \left(y + z\right) \cdot 2\right)\\
\mathbf{if}\;x \leq -0.002:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \leq -7.6 \cdot 10^{-150}:\\
\;\;\;\;y \cdot 5 + 2 \cdot \left(x \cdot z\right)\\
\mathbf{elif}\;x \leq 0.017:\\
\;\;\;\;y \cdot 5 + x \cdot t\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if x < -2e-3 or 0.017000000000000001 < x Initial program 100.0%
fma-define100.0%
associate-+l+100.0%
+-commutative100.0%
count-2100.0%
Simplified100.0%
Taylor expanded in x around inf 99.1%
if -2e-3 < x < -7.5999999999999997e-150Initial program 99.9%
Taylor expanded in z around inf 87.6%
if -7.5999999999999997e-150 < x < 0.017000000000000001Initial program 98.8%
Taylor expanded in t around inf 81.9%
Final simplification91.0%
(FPCore (x y z t) :precision binary64 (if (or (<= x -34000000.0) (not (<= x 2.5))) (* x (+ t (* (+ y z) 2.0))) (+ (* y 5.0) (+ (* x t) (* x (* z 2.0))))))
double code(double x, double y, double z, double t) {
double tmp;
if ((x <= -34000000.0) || !(x <= 2.5)) {
tmp = x * (t + ((y + z) * 2.0));
} else {
tmp = (y * 5.0) + ((x * t) + (x * (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 ((x <= (-34000000.0d0)) .or. (.not. (x <= 2.5d0))) then
tmp = x * (t + ((y + z) * 2.0d0))
else
tmp = (y * 5.0d0) + ((x * t) + (x * (z * 2.0d0)))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((x <= -34000000.0) || !(x <= 2.5)) {
tmp = x * (t + ((y + z) * 2.0));
} else {
tmp = (y * 5.0) + ((x * t) + (x * (z * 2.0)));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (x <= -34000000.0) or not (x <= 2.5): tmp = x * (t + ((y + z) * 2.0)) else: tmp = (y * 5.0) + ((x * t) + (x * (z * 2.0))) return tmp
function code(x, y, z, t) tmp = 0.0 if ((x <= -34000000.0) || !(x <= 2.5)) tmp = Float64(x * Float64(t + Float64(Float64(y + z) * 2.0))); else tmp = Float64(Float64(y * 5.0) + Float64(Float64(x * t) + Float64(x * Float64(z * 2.0)))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((x <= -34000000.0) || ~((x <= 2.5))) tmp = x * (t + ((y + z) * 2.0)); else tmp = (y * 5.0) + ((x * t) + (x * (z * 2.0))); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[x, -34000000.0], N[Not[LessEqual[x, 2.5]], $MachinePrecision]], N[(x * N[(t + N[(N[(y + z), $MachinePrecision] * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(y * 5.0), $MachinePrecision] + N[(N[(x * t), $MachinePrecision] + N[(x * N[(z * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -34000000 \lor \neg \left(x \leq 2.5\right):\\
\;\;\;\;x \cdot \left(t + \left(y + z\right) \cdot 2\right)\\
\mathbf{else}:\\
\;\;\;\;y \cdot 5 + \left(x \cdot t + x \cdot \left(z \cdot 2\right)\right)\\
\end{array}
\end{array}
if x < -3.4e7 or 2.5 < x Initial program 100.0%
fma-define100.0%
associate-+l+100.0%
+-commutative100.0%
count-2100.0%
Simplified100.0%
Taylor expanded in x around inf 99.1%
if -3.4e7 < x < 2.5Initial program 99.1%
distribute-lft-in99.1%
*-commutative99.1%
associate-+l+99.1%
+-commutative99.1%
count-299.1%
*-commutative99.1%
Applied egg-rr99.1%
Taylor expanded in y around 0 98.5%
Final simplification98.8%
(FPCore (x y z t) :precision binary64 (if (or (<= x -1.25e-17) (not (<= x 0.017))) (* x (+ t (* (+ y z) 2.0))) (* y (+ 5.0 (/ (* x (+ t (* z 2.0))) y)))))
double code(double x, double y, double z, double t) {
double tmp;
if ((x <= -1.25e-17) || !(x <= 0.017)) {
tmp = x * (t + ((y + z) * 2.0));
} else {
tmp = y * (5.0 + ((x * (t + (z * 2.0))) / y));
}
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.25d-17)) .or. (.not. (x <= 0.017d0))) then
tmp = x * (t + ((y + z) * 2.0d0))
else
tmp = y * (5.0d0 + ((x * (t + (z * 2.0d0))) / y))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((x <= -1.25e-17) || !(x <= 0.017)) {
tmp = x * (t + ((y + z) * 2.0));
} else {
tmp = y * (5.0 + ((x * (t + (z * 2.0))) / y));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (x <= -1.25e-17) or not (x <= 0.017): tmp = x * (t + ((y + z) * 2.0)) else: tmp = y * (5.0 + ((x * (t + (z * 2.0))) / y)) return tmp
function code(x, y, z, t) tmp = 0.0 if ((x <= -1.25e-17) || !(x <= 0.017)) tmp = Float64(x * Float64(t + Float64(Float64(y + z) * 2.0))); else tmp = Float64(y * Float64(5.0 + Float64(Float64(x * Float64(t + Float64(z * 2.0))) / y))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((x <= -1.25e-17) || ~((x <= 0.017))) tmp = x * (t + ((y + z) * 2.0)); else tmp = y * (5.0 + ((x * (t + (z * 2.0))) / y)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[x, -1.25e-17], N[Not[LessEqual[x, 0.017]], $MachinePrecision]], N[(x * N[(t + N[(N[(y + z), $MachinePrecision] * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(y * N[(5.0 + N[(N[(x * N[(t + N[(z * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.25 \cdot 10^{-17} \lor \neg \left(x \leq 0.017\right):\\
\;\;\;\;x \cdot \left(t + \left(y + z\right) \cdot 2\right)\\
\mathbf{else}:\\
\;\;\;\;y \cdot \left(5 + \frac{x \cdot \left(t + z \cdot 2\right)}{y}\right)\\
\end{array}
\end{array}
if x < -1.25e-17 or 0.017000000000000001 < 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.2%
if -1.25e-17 < x < 0.017000000000000001Initial program 99.1%
fma-define99.1%
associate-+l+99.1%
+-commutative99.1%
count-299.1%
Simplified99.1%
Taylor expanded in y around 0 98.4%
Taylor expanded in y around inf 89.5%
Final simplification94.3%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* x (+ t (* y 2.0)))))
(if (<= x -5.8e-21)
t_1
(if (<= x 3e-157)
(* y 5.0)
(if (<= x 1.6e+16) (* x (+ t (* z 2.0))) t_1)))))
double code(double x, double y, double z, double t) {
double t_1 = x * (t + (y * 2.0));
double tmp;
if (x <= -5.8e-21) {
tmp = t_1;
} else if (x <= 3e-157) {
tmp = y * 5.0;
} else if (x <= 1.6e+16) {
tmp = x * (t + (z * 2.0));
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: tmp
t_1 = x * (t + (y * 2.0d0))
if (x <= (-5.8d-21)) then
tmp = t_1
else if (x <= 3d-157) then
tmp = y * 5.0d0
else if (x <= 1.6d+16) then
tmp = x * (t + (z * 2.0d0))
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = x * (t + (y * 2.0));
double tmp;
if (x <= -5.8e-21) {
tmp = t_1;
} else if (x <= 3e-157) {
tmp = y * 5.0;
} else if (x <= 1.6e+16) {
tmp = x * (t + (z * 2.0));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = x * (t + (y * 2.0)) tmp = 0 if x <= -5.8e-21: tmp = t_1 elif x <= 3e-157: tmp = y * 5.0 elif x <= 1.6e+16: tmp = x * (t + (z * 2.0)) 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 <= -5.8e-21) tmp = t_1; elseif (x <= 3e-157) tmp = Float64(y * 5.0); elseif (x <= 1.6e+16) tmp = Float64(x * Float64(t + Float64(z * 2.0))); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = x * (t + (y * 2.0)); tmp = 0.0; if (x <= -5.8e-21) tmp = t_1; elseif (x <= 3e-157) tmp = y * 5.0; elseif (x <= 1.6e+16) tmp = x * (t + (z * 2.0)); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(x * N[(t + N[(y * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -5.8e-21], t$95$1, If[LessEqual[x, 3e-157], N[(y * 5.0), $MachinePrecision], If[LessEqual[x, 1.6e+16], N[(x * N[(t + N[(z * 2.0), $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 -5.8 \cdot 10^{-21}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \leq 3 \cdot 10^{-157}:\\
\;\;\;\;y \cdot 5\\
\mathbf{elif}\;x \leq 1.6 \cdot 10^{+16}:\\
\;\;\;\;x \cdot \left(t + z \cdot 2\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if x < -5.8e-21 or 1.6e16 < 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.8%
Taylor expanded in y around inf 79.0%
if -5.8e-21 < x < 3e-157Initial program 98.9%
+-commutative98.9%
fma-define99.0%
flip-+45.4%
associate-*r/45.3%
fmm-def45.4%
associate-+l+45.4%
+-commutative45.4%
count-245.4%
associate-+l+45.4%
+-commutative45.4%
count-245.4%
fmm-def45.3%
associate-+l+45.3%
+-commutative45.3%
count-245.3%
Applied egg-rr99.0%
Taylor expanded in x around 0 63.7%
*-commutative63.7%
Simplified63.7%
if 3e-157 < x < 1.6e16Initial program 99.8%
+-commutative99.8%
fma-define100.0%
flip-+50.6%
associate-*r/48.0%
fmm-def48.4%
associate-+l+48.4%
+-commutative48.4%
count-248.4%
associate-+l+48.4%
+-commutative48.4%
count-248.4%
fmm-def48.0%
associate-+l+48.0%
+-commutative48.0%
count-248.0%
Applied egg-rr100.0%
Taylor expanded in y around 0 63.4%
Final simplification70.9%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* x (* z 2.0))))
(if (<= z -2.2e+40)
t_1
(if (<= z -5.2e-254) (* y 5.0) (if (<= z 5.8e+51) (* x t) t_1)))))
double code(double x, double y, double z, double t) {
double t_1 = x * (z * 2.0);
double tmp;
if (z <= -2.2e+40) {
tmp = t_1;
} else if (z <= -5.2e-254) {
tmp = y * 5.0;
} else if (z <= 5.8e+51) {
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 = x * (z * 2.0d0)
if (z <= (-2.2d+40)) then
tmp = t_1
else if (z <= (-5.2d-254)) then
tmp = y * 5.0d0
else if (z <= 5.8d+51) 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 = x * (z * 2.0);
double tmp;
if (z <= -2.2e+40) {
tmp = t_1;
} else if (z <= -5.2e-254) {
tmp = y * 5.0;
} else if (z <= 5.8e+51) {
tmp = x * t;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = x * (z * 2.0) tmp = 0 if z <= -2.2e+40: tmp = t_1 elif z <= -5.2e-254: tmp = y * 5.0 elif z <= 5.8e+51: tmp = x * t else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(x * Float64(z * 2.0)) tmp = 0.0 if (z <= -2.2e+40) tmp = t_1; elseif (z <= -5.2e-254) tmp = Float64(y * 5.0); elseif (z <= 5.8e+51) tmp = Float64(x * t); 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 (z <= -2.2e+40) tmp = t_1; elseif (z <= -5.2e-254) tmp = y * 5.0; elseif (z <= 5.8e+51) tmp = x * t; 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[z, -2.2e+40], t$95$1, If[LessEqual[z, -5.2e-254], N[(y * 5.0), $MachinePrecision], If[LessEqual[z, 5.8e+51], N[(x * t), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot \left(z \cdot 2\right)\\
\mathbf{if}\;z \leq -2.2 \cdot 10^{+40}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq -5.2 \cdot 10^{-254}:\\
\;\;\;\;y \cdot 5\\
\mathbf{elif}\;z \leq 5.8 \cdot 10^{+51}:\\
\;\;\;\;x \cdot t\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -2.1999999999999999e40 or 5.7999999999999997e51 < z Initial program 98.9%
+-commutative98.9%
fma-define99.0%
flip-+40.8%
associate-*r/38.0%
fmm-def43.3%
associate-+l+43.3%
+-commutative43.3%
count-243.3%
associate-+l+43.3%
+-commutative43.3%
count-243.3%
fmm-def38.0%
associate-+l+38.0%
+-commutative38.0%
count-238.0%
Applied egg-rr99.0%
Taylor expanded in z around inf 64.7%
*-commutative64.7%
associate-*r*64.7%
*-commutative64.7%
Simplified64.7%
if -2.1999999999999999e40 < z < -5.2e-254Initial program 99.9%
+-commutative99.9%
fma-define100.0%
flip-+71.3%
associate-*r/66.3%
fmm-def66.3%
associate-+l+66.3%
+-commutative66.3%
count-266.3%
associate-+l+66.3%
+-commutative66.3%
count-266.3%
fmm-def66.3%
associate-+l+66.3%
+-commutative66.3%
count-266.3%
Applied egg-rr100.0%
Taylor expanded in x around 0 52.4%
*-commutative52.4%
Simplified52.4%
if -5.2e-254 < z < 5.7999999999999997e51Initial program 99.9%
+-commutative99.9%
fma-define100.0%
flip-+76.3%
associate-*r/71.7%
fmm-def71.9%
associate-+l+71.9%
+-commutative71.9%
count-271.9%
associate-+l+71.9%
+-commutative71.9%
count-271.9%
fmm-def71.7%
associate-+l+71.7%
+-commutative71.7%
count-271.7%
Applied egg-rr100.0%
Taylor expanded in t around inf 41.0%
*-commutative41.0%
Simplified41.0%
Final simplification52.5%
(FPCore (x y z t) :precision binary64 (if (<= x -5e+85) (* x (+ t (* 2.0 (* y (+ 1.0 (/ z y)))))) (+ (* x (+ t (* z 2.0))) (* y (+ 5.0 (* x 2.0))))))
double code(double x, double y, double z, double t) {
double tmp;
if (x <= -5e+85) {
tmp = x * (t + (2.0 * (y * (1.0 + (z / y)))));
} else {
tmp = (x * (t + (z * 2.0))) + (y * (5.0 + (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 <= (-5d+85)) then
tmp = x * (t + (2.0d0 * (y * (1.0d0 + (z / y)))))
else
tmp = (x * (t + (z * 2.0d0))) + (y * (5.0d0 + (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 <= -5e+85) {
tmp = x * (t + (2.0 * (y * (1.0 + (z / y)))));
} else {
tmp = (x * (t + (z * 2.0))) + (y * (5.0 + (x * 2.0)));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if x <= -5e+85: tmp = x * (t + (2.0 * (y * (1.0 + (z / y))))) else: tmp = (x * (t + (z * 2.0))) + (y * (5.0 + (x * 2.0))) return tmp
function code(x, y, z, t) tmp = 0.0 if (x <= -5e+85) tmp = Float64(x * Float64(t + Float64(2.0 * Float64(y * Float64(1.0 + Float64(z / y)))))); else tmp = Float64(Float64(x * Float64(t + Float64(z * 2.0))) + Float64(y * Float64(5.0 + Float64(x * 2.0)))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (x <= -5e+85) tmp = x * (t + (2.0 * (y * (1.0 + (z / y))))); else tmp = (x * (t + (z * 2.0))) + (y * (5.0 + (x * 2.0))); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[x, -5e+85], N[(x * N[(t + N[(2.0 * N[(y * N[(1.0 + N[(z / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 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}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -5 \cdot 10^{+85}:\\
\;\;\;\;x \cdot \left(t + 2 \cdot \left(y \cdot \left(1 + \frac{z}{y}\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(t + z \cdot 2\right) + y \cdot \left(5 + x \cdot 2\right)\\
\end{array}
\end{array}
if x < -5.0000000000000001e85Initial program 99.9%
fma-define99.9%
associate-+l+99.9%
+-commutative99.9%
count-299.9%
Simplified99.9%
Taylor expanded in x around inf 99.9%
Taylor expanded in y around inf 100.0%
if -5.0000000000000001e85 < x Initial program 99.4%
fma-define99.4%
associate-+l+99.4%
+-commutative99.4%
count-299.4%
Simplified99.4%
Taylor expanded in y around 0 97.9%
Final simplification98.4%
(FPCore (x y z t) :precision binary64 (if (or (<= x -1.25e-17) (not (<= x 0.017))) (* 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.25e-17) || !(x <= 0.017)) {
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.25d-17)) .or. (.not. (x <= 0.017d0))) 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.25e-17) || !(x <= 0.017)) {
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.25e-17) or not (x <= 0.017): 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.25e-17) || !(x <= 0.017)) 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.25e-17) || ~((x <= 0.017))) 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.25e-17], N[Not[LessEqual[x, 0.017]], $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.25 \cdot 10^{-17} \lor \neg \left(x \leq 0.017\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.25e-17 or 0.017000000000000001 < 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.2%
if -1.25e-17 < x < 0.017000000000000001Initial program 99.1%
Taylor expanded in t around inf 78.0%
Final simplification88.4%
(FPCore (x y z t) :precision binary64 (if (or (<= y -1.06e+61) (not (<= y 4e-58))) (* 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 <= -1.06e+61) || !(y <= 4e-58)) {
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 <= (-1.06d+61)) .or. (.not. (y <= 4d-58))) 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 <= -1.06e+61) || !(y <= 4e-58)) {
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 <= -1.06e+61) or not (y <= 4e-58): 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 <= -1.06e+61) || !(y <= 4e-58)) 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 <= -1.06e+61) || ~((y <= 4e-58))) 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, -1.06e+61], N[Not[LessEqual[y, 4e-58]], $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.06 \cdot 10^{+61} \lor \neg \left(y \leq 4 \cdot 10^{-58}\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.0599999999999999e61 or 4.0000000000000001e-58 < y Initial program 99.1%
fma-define99.1%
associate-+l+99.1%
+-commutative99.1%
count-299.1%
Simplified99.1%
Taylor expanded in y around inf 83.2%
if -1.0599999999999999e61 < y < 4.0000000000000001e-58Initial program 99.9%
+-commutative99.9%
fma-define100.0%
flip-+63.8%
associate-*r/58.7%
fmm-def61.9%
associate-+l+61.9%
+-commutative61.9%
count-261.9%
associate-+l+61.9%
+-commutative61.9%
count-261.9%
fmm-def58.7%
associate-+l+58.7%
+-commutative58.7%
count-258.7%
Applied egg-rr100.0%
Taylor expanded in y around 0 80.6%
Final simplification81.9%
(FPCore (x y z t) :precision binary64 (if (or (<= x -1.1e-17) (not (<= x 6.2e-18))) (* x (+ t (* y 2.0))) (* y 5.0)))
double code(double x, double y, double z, double t) {
double tmp;
if ((x <= -1.1e-17) || !(x <= 6.2e-18)) {
tmp = x * (t + (y * 2.0));
} 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.1d-17)) .or. (.not. (x <= 6.2d-18))) then
tmp = x * (t + (y * 2.0d0))
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.1e-17) || !(x <= 6.2e-18)) {
tmp = x * (t + (y * 2.0));
} else {
tmp = y * 5.0;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (x <= -1.1e-17) or not (x <= 6.2e-18): tmp = x * (t + (y * 2.0)) else: tmp = y * 5.0 return tmp
function code(x, y, z, t) tmp = 0.0 if ((x <= -1.1e-17) || !(x <= 6.2e-18)) tmp = Float64(x * Float64(t + Float64(y * 2.0))); else tmp = Float64(y * 5.0); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((x <= -1.1e-17) || ~((x <= 6.2e-18))) tmp = x * (t + (y * 2.0)); else tmp = y * 5.0; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[x, -1.1e-17], N[Not[LessEqual[x, 6.2e-18]], $MachinePrecision]], N[(x * N[(t + N[(y * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(y * 5.0), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.1 \cdot 10^{-17} \lor \neg \left(x \leq 6.2 \cdot 10^{-18}\right):\\
\;\;\;\;x \cdot \left(t + y \cdot 2\right)\\
\mathbf{else}:\\
\;\;\;\;y \cdot 5\\
\end{array}
\end{array}
if x < -1.1e-17 or 6.20000000000000014e-18 < 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.8%
Taylor expanded in y around inf 77.2%
if -1.1e-17 < x < 6.20000000000000014e-18Initial program 99.1%
+-commutative99.1%
fma-define99.2%
flip-+47.1%
associate-*r/46.3%
fmm-def46.5%
associate-+l+46.5%
+-commutative46.5%
count-246.5%
associate-+l+46.5%
+-commutative46.5%
count-246.5%
fmm-def46.3%
associate-+l+46.3%
+-commutative46.3%
count-246.3%
Applied egg-rr99.2%
Taylor expanded in x around 0 59.1%
*-commutative59.1%
Simplified59.1%
Final simplification68.4%
(FPCore (x y z t) :precision binary64 (if (or (<= x -1.25e-17) (not (<= x 2.5))) (* y (* x 2.0)) (* y 5.0)))
double code(double x, double y, double z, double t) {
double tmp;
if ((x <= -1.25e-17) || !(x <= 2.5)) {
tmp = y * (x * 2.0);
} 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.25d-17)) .or. (.not. (x <= 2.5d0))) then
tmp = y * (x * 2.0d0)
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.25e-17) || !(x <= 2.5)) {
tmp = y * (x * 2.0);
} else {
tmp = y * 5.0;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (x <= -1.25e-17) or not (x <= 2.5): tmp = y * (x * 2.0) else: tmp = y * 5.0 return tmp
function code(x, y, z, t) tmp = 0.0 if ((x <= -1.25e-17) || !(x <= 2.5)) tmp = Float64(y * Float64(x * 2.0)); else tmp = Float64(y * 5.0); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((x <= -1.25e-17) || ~((x <= 2.5))) tmp = y * (x * 2.0); else tmp = y * 5.0; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[x, -1.25e-17], N[Not[LessEqual[x, 2.5]], $MachinePrecision]], N[(y * N[(x * 2.0), $MachinePrecision]), $MachinePrecision], N[(y * 5.0), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.25 \cdot 10^{-17} \lor \neg \left(x \leq 2.5\right):\\
\;\;\;\;y \cdot \left(x \cdot 2\right)\\
\mathbf{else}:\\
\;\;\;\;y \cdot 5\\
\end{array}
\end{array}
if x < -1.25e-17 or 2.5 < x Initial program 100.0%
fma-define100.0%
associate-+l+100.0%
+-commutative100.0%
count-2100.0%
Simplified100.0%
Taylor expanded in y around inf 47.0%
Taylor expanded in x around inf 46.2%
*-commutative46.2%
Simplified46.2%
if -1.25e-17 < x < 2.5Initial program 99.1%
+-commutative99.1%
fma-define99.2%
flip-+47.0%
associate-*r/46.2%
fmm-def46.4%
associate-+l+46.4%
+-commutative46.4%
count-246.4%
associate-+l+46.4%
+-commutative46.4%
count-246.4%
fmm-def46.2%
associate-+l+46.2%
+-commutative46.2%
count-246.2%
Applied egg-rr99.2%
Taylor expanded in x around 0 57.8%
*-commutative57.8%
Simplified57.8%
Final simplification52.1%
(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.05e-17) (not (<= x 4.5e-19))) (* x t) (* y 5.0)))
double code(double x, double y, double z, double t) {
double tmp;
if ((x <= -1.05e-17) || !(x <= 4.5e-19)) {
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.05d-17)) .or. (.not. (x <= 4.5d-19))) 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.05e-17) || !(x <= 4.5e-19)) {
tmp = x * t;
} else {
tmp = y * 5.0;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (x <= -1.05e-17) or not (x <= 4.5e-19): tmp = x * t else: tmp = y * 5.0 return tmp
function code(x, y, z, t) tmp = 0.0 if ((x <= -1.05e-17) || !(x <= 4.5e-19)) 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.05e-17) || ~((x <= 4.5e-19))) tmp = x * t; else tmp = y * 5.0; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[x, -1.05e-17], N[Not[LessEqual[x, 4.5e-19]], $MachinePrecision]], N[(x * t), $MachinePrecision], N[(y * 5.0), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.05 \cdot 10^{-17} \lor \neg \left(x \leq 4.5 \cdot 10^{-19}\right):\\
\;\;\;\;x \cdot t\\
\mathbf{else}:\\
\;\;\;\;y \cdot 5\\
\end{array}
\end{array}
if x < -1.04999999999999996e-17 or 4.50000000000000013e-19 < x Initial program 100.0%
+-commutative100.0%
fma-define100.0%
flip-+75.7%
associate-*r/68.6%
fmm-def72.5%
associate-+l+72.5%
+-commutative72.5%
count-272.5%
associate-+l+72.5%
+-commutative72.5%
count-272.5%
fmm-def68.6%
associate-+l+68.6%
+-commutative68.6%
count-268.6%
Applied egg-rr100.0%
Taylor expanded in t around inf 39.5%
*-commutative39.5%
Simplified39.5%
if -1.04999999999999996e-17 < x < 4.50000000000000013e-19Initial program 99.1%
+-commutative99.1%
fma-define99.2%
flip-+47.1%
associate-*r/46.3%
fmm-def46.5%
associate-+l+46.5%
+-commutative46.5%
count-246.5%
associate-+l+46.5%
+-commutative46.5%
count-246.5%
fmm-def46.3%
associate-+l+46.3%
+-commutative46.3%
count-246.3%
Applied egg-rr99.2%
Taylor expanded in x around 0 59.1%
*-commutative59.1%
Simplified59.1%
Final simplification49.1%
(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%
+-commutative99.5%
fma-define99.6%
flip-+61.7%
associate-*r/57.7%
fmm-def59.8%
associate-+l+59.8%
+-commutative59.8%
count-259.8%
associate-+l+59.8%
+-commutative59.8%
count-259.8%
fmm-def57.7%
associate-+l+57.7%
+-commutative57.7%
count-257.7%
Applied egg-rr99.6%
Taylor expanded in t around inf 30.5%
*-commutative30.5%
Simplified30.5%
herbie shell --seed 2024185
(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)))