
(FPCore (x y z t) :precision binary64 (+ (* x (+ (+ (+ (+ y z) z) y) t)) (* y 5.0)))
double code(double x, double y, double z, double t) {
return (x * ((((y + z) + z) + y) + t)) + (y * 5.0);
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = (x * ((((y + z) + z) + y) + t)) + (y * 5.0d0)
end function
public static double code(double x, double y, double z, double t) {
return (x * ((((y + z) + z) + y) + t)) + (y * 5.0);
}
def code(x, y, z, t): return (x * ((((y + z) + z) + y) + t)) + (y * 5.0)
function code(x, y, z, t) return Float64(Float64(x * Float64(Float64(Float64(Float64(y + z) + z) + y) + t)) + Float64(y * 5.0)) end
function tmp = code(x, y, z, t) tmp = (x * ((((y + z) + z) + y) + t)) + (y * 5.0); end
code[x_, y_, z_, t_] := N[(N[(x * N[(N[(N[(N[(y + z), $MachinePrecision] + z), $MachinePrecision] + y), $MachinePrecision] + t), $MachinePrecision]), $MachinePrecision] + N[(y * 5.0), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x \cdot \left(\left(\left(\left(y + z\right) + z\right) + y\right) + t\right) + y \cdot 5
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 15 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t) :precision binary64 (+ (* x (+ (+ (+ (+ y z) z) y) t)) (* y 5.0)))
double code(double x, double y, double z, double t) {
return (x * ((((y + z) + z) + y) + t)) + (y * 5.0);
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = (x * ((((y + z) + z) + y) + t)) + (y * 5.0d0)
end function
public static double code(double x, double y, double z, double t) {
return (x * ((((y + z) + z) + y) + t)) + (y * 5.0);
}
def code(x, y, z, t): return (x * ((((y + z) + z) + y) + t)) + (y * 5.0)
function code(x, y, z, t) return Float64(Float64(x * Float64(Float64(Float64(Float64(y + z) + z) + y) + t)) + Float64(y * 5.0)) end
function tmp = code(x, y, z, t) tmp = (x * ((((y + z) + z) + y) + t)) + (y * 5.0); end
code[x_, y_, z_, t_] := N[(N[(x * N[(N[(N[(N[(y + z), $MachinePrecision] + z), $MachinePrecision] + y), $MachinePrecision] + t), $MachinePrecision]), $MachinePrecision] + N[(y * 5.0), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x \cdot \left(\left(\left(\left(y + z\right) + z\right) + y\right) + t\right) + y \cdot 5
\end{array}
(FPCore (x y z t) :precision binary64 (fma 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.9%
+-commutative99.9%
fma-def100.0%
distribute-rgt-in96.0%
associate-+l+96.0%
+-commutative96.0%
count-296.0%
distribute-rgt-in100.0%
*-commutative100.0%
fma-def100.0%
Applied egg-rr100.0%
Final simplification100.0%
(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.9%
fma-def99.9%
associate-+l+99.9%
+-commutative99.9%
count-299.9%
Simplified99.9%
Final simplification99.9%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (+ (* y 5.0) (* x t))) (t_2 (* x (+ t (* (+ y z) 2.0)))))
(if (<= x -3.4e-45)
t_2
(if (<= x 1.2e-204)
t_1
(if (<= x 4.8e-120)
(+ (* y 5.0) (* 2.0 (* x z)))
(if (<= x 4.1e-83) 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 = x * (t + ((y + z) * 2.0));
double tmp;
if (x <= -3.4e-45) {
tmp = t_2;
} else if (x <= 1.2e-204) {
tmp = t_1;
} else if (x <= 4.8e-120) {
tmp = (y * 5.0) + (2.0 * (x * z));
} else if (x <= 4.1e-83) {
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 = x * (t + ((y + z) * 2.0d0))
if (x <= (-3.4d-45)) then
tmp = t_2
else if (x <= 1.2d-204) then
tmp = t_1
else if (x <= 4.8d-120) then
tmp = (y * 5.0d0) + (2.0d0 * (x * z))
else if (x <= 4.1d-83) 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 = x * (t + ((y + z) * 2.0));
double tmp;
if (x <= -3.4e-45) {
tmp = t_2;
} else if (x <= 1.2e-204) {
tmp = t_1;
} else if (x <= 4.8e-120) {
tmp = (y * 5.0) + (2.0 * (x * z));
} else if (x <= 4.1e-83) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t): t_1 = (y * 5.0) + (x * t) t_2 = x * (t + ((y + z) * 2.0)) tmp = 0 if x <= -3.4e-45: tmp = t_2 elif x <= 1.2e-204: tmp = t_1 elif x <= 4.8e-120: tmp = (y * 5.0) + (2.0 * (x * z)) elif x <= 4.1e-83: 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(x * Float64(t + Float64(Float64(y + z) * 2.0))) tmp = 0.0 if (x <= -3.4e-45) tmp = t_2; elseif (x <= 1.2e-204) tmp = t_1; elseif (x <= 4.8e-120) tmp = Float64(Float64(y * 5.0) + Float64(2.0 * Float64(x * z))); elseif (x <= 4.1e-83) 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 = x * (t + ((y + z) * 2.0)); tmp = 0.0; if (x <= -3.4e-45) tmp = t_2; elseif (x <= 1.2e-204) tmp = t_1; elseif (x <= 4.8e-120) tmp = (y * 5.0) + (2.0 * (x * z)); elseif (x <= 4.1e-83) 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[(x * N[(t + N[(N[(y + z), $MachinePrecision] * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -3.4e-45], t$95$2, If[LessEqual[x, 1.2e-204], t$95$1, If[LessEqual[x, 4.8e-120], N[(N[(y * 5.0), $MachinePrecision] + N[(2.0 * N[(x * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 4.1e-83], t$95$1, t$95$2]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := y \cdot 5 + x \cdot t\\
t_2 := x \cdot \left(t + \left(y + z\right) \cdot 2\right)\\
\mathbf{if}\;x \leq -3.4 \cdot 10^{-45}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;x \leq 1.2 \cdot 10^{-204}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \leq 4.8 \cdot 10^{-120}:\\
\;\;\;\;y \cdot 5 + 2 \cdot \left(x \cdot z\right)\\
\mathbf{elif}\;x \leq 4.1 \cdot 10^{-83}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;t_2\\
\end{array}
\end{array}
if x < -3.40000000000000004e-45 or 4.1e-83 < 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.3%
if -3.40000000000000004e-45 < x < 1.2e-204 or 4.7999999999999999e-120 < x < 4.1e-83Initial program 99.8%
+-commutative99.8%
fma-def99.9%
distribute-rgt-in99.9%
associate-+l+99.9%
+-commutative99.9%
count-299.9%
distribute-rgt-in99.9%
*-commutative99.9%
fma-def99.9%
Applied egg-rr99.9%
Taylor expanded in t around inf 91.0%
fma-udef90.9%
*-commutative90.9%
Applied egg-rr90.9%
if 1.2e-204 < x < 4.7999999999999999e-120Initial program 100.0%
fma-def100.0%
associate-+l+100.0%
+-commutative100.0%
count-2100.0%
Simplified100.0%
Taylor expanded in t around 0 95.2%
Taylor expanded in y around 0 95.2%
Final simplification93.3%
(FPCore (x y z t) :precision binary64 (if (or (<= x -220.0) (not (<= x 0.38))) (* x (+ t (* (+ y z) 2.0))) (+ (* x (+ t (+ y (+ z z)))) (* y 5.0))))
double code(double x, double y, double z, double t) {
double tmp;
if ((x <= -220.0) || !(x <= 0.38)) {
tmp = x * (t + ((y + z) * 2.0));
} else {
tmp = (x * (t + (y + (z + z)))) + (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 <= (-220.0d0)) .or. (.not. (x <= 0.38d0))) then
tmp = x * (t + ((y + z) * 2.0d0))
else
tmp = (x * (t + (y + (z + z)))) + (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 <= -220.0) || !(x <= 0.38)) {
tmp = x * (t + ((y + z) * 2.0));
} else {
tmp = (x * (t + (y + (z + z)))) + (y * 5.0);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (x <= -220.0) or not (x <= 0.38): tmp = x * (t + ((y + z) * 2.0)) else: tmp = (x * (t + (y + (z + z)))) + (y * 5.0) return tmp
function code(x, y, z, t) tmp = 0.0 if ((x <= -220.0) || !(x <= 0.38)) tmp = Float64(x * Float64(t + Float64(Float64(y + z) * 2.0))); else tmp = Float64(Float64(x * Float64(t + Float64(y + Float64(z + z)))) + Float64(y * 5.0)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((x <= -220.0) || ~((x <= 0.38))) tmp = x * (t + ((y + z) * 2.0)); else tmp = (x * (t + (y + (z + z)))) + (y * 5.0); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[x, -220.0], N[Not[LessEqual[x, 0.38]], $MachinePrecision]], N[(x * N[(t + N[(N[(y + z), $MachinePrecision] * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x * N[(t + N[(y + N[(z + z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(y * 5.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -220 \lor \neg \left(x \leq 0.38\right):\\
\;\;\;\;x \cdot \left(t + \left(y + z\right) \cdot 2\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(t + \left(y + \left(z + z\right)\right)\right) + y \cdot 5\\
\end{array}
\end{array}
if x < -220 or 0.38 < 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 99.7%
if -220 < x < 0.38Initial program 99.8%
Taylor expanded in y around 0 99.2%
Simplified99.2%
Final simplification99.4%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* x (+ t (* y 2.0)))))
(if (<= x -2.95e-15)
t_1
(if (<= x 8.5e-133)
(* y (+ 5.0 x))
(if (<= x 1.35e-120)
(* 2.0 (* x z))
(if (<= x 7e-107) (* y 5.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 <= -2.95e-15) {
tmp = t_1;
} else if (x <= 8.5e-133) {
tmp = y * (5.0 + x);
} else if (x <= 1.35e-120) {
tmp = 2.0 * (x * z);
} else if (x <= 7e-107) {
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 * (t + (y * 2.0d0))
if (x <= (-2.95d-15)) then
tmp = t_1
else if (x <= 8.5d-133) then
tmp = y * (5.0d0 + x)
else if (x <= 1.35d-120) then
tmp = 2.0d0 * (x * z)
else if (x <= 7d-107) 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 * (t + (y * 2.0));
double tmp;
if (x <= -2.95e-15) {
tmp = t_1;
} else if (x <= 8.5e-133) {
tmp = y * (5.0 + x);
} else if (x <= 1.35e-120) {
tmp = 2.0 * (x * z);
} else if (x <= 7e-107) {
tmp = y * 5.0;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = x * (t + (y * 2.0)) tmp = 0 if x <= -2.95e-15: tmp = t_1 elif x <= 8.5e-133: tmp = y * (5.0 + x) elif x <= 1.35e-120: tmp = 2.0 * (x * z) elif x <= 7e-107: tmp = y * 5.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 <= -2.95e-15) tmp = t_1; elseif (x <= 8.5e-133) tmp = Float64(y * Float64(5.0 + x)); elseif (x <= 1.35e-120) tmp = Float64(2.0 * Float64(x * z)); elseif (x <= 7e-107) tmp = Float64(y * 5.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 <= -2.95e-15) tmp = t_1; elseif (x <= 8.5e-133) tmp = y * (5.0 + x); elseif (x <= 1.35e-120) tmp = 2.0 * (x * z); elseif (x <= 7e-107) 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[(t + N[(y * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -2.95e-15], t$95$1, If[LessEqual[x, 8.5e-133], N[(y * N[(5.0 + x), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 1.35e-120], N[(2.0 * N[(x * z), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 7e-107], N[(y * 5.0), $MachinePrecision], t$95$1]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot \left(t + y \cdot 2\right)\\
\mathbf{if}\;x \leq -2.95 \cdot 10^{-15}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \leq 8.5 \cdot 10^{-133}:\\
\;\;\;\;y \cdot \left(5 + x\right)\\
\mathbf{elif}\;x \leq 1.35 \cdot 10^{-120}:\\
\;\;\;\;2 \cdot \left(x \cdot z\right)\\
\mathbf{elif}\;x \leq 7 \cdot 10^{-107}:\\
\;\;\;\;y \cdot 5\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if x < -2.94999999999999982e-15 or 6.99999999999999971e-107 < 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 95.5%
Taylor expanded in z around 0 67.5%
if -2.94999999999999982e-15 < x < 8.49999999999999957e-133Initial program 99.8%
Taylor expanded in y around 0 99.8%
Simplified99.8%
Taylor expanded in y around inf 67.1%
+-commutative67.1%
Simplified67.1%
if 8.49999999999999957e-133 < x < 1.3499999999999999e-120Initial program 100.0%
Taylor expanded in z around inf 100.0%
if 1.3499999999999999e-120 < x < 6.99999999999999971e-107Initial program 99.7%
Taylor expanded in x around 0 67.3%
Final simplification68.1%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* x (+ t (* y 2.0)))) (t_2 (* y (+ 5.0 (* x 2.0)))))
(if (<= y -106.0)
t_2
(if (<= y -3e-158)
t_1
(if (<= y -8.5e-234) (* 2.0 (* x z)) (if (<= y 2.2e-13) t_1 t_2))))))
double code(double x, double y, double z, double t) {
double t_1 = x * (t + (y * 2.0));
double t_2 = y * (5.0 + (x * 2.0));
double tmp;
if (y <= -106.0) {
tmp = t_2;
} else if (y <= -3e-158) {
tmp = t_1;
} else if (y <= -8.5e-234) {
tmp = 2.0 * (x * z);
} else if (y <= 2.2e-13) {
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 = x * (t + (y * 2.0d0))
t_2 = y * (5.0d0 + (x * 2.0d0))
if (y <= (-106.0d0)) then
tmp = t_2
else if (y <= (-3d-158)) then
tmp = t_1
else if (y <= (-8.5d-234)) then
tmp = 2.0d0 * (x * z)
else if (y <= 2.2d-13) 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 = x * (t + (y * 2.0));
double t_2 = y * (5.0 + (x * 2.0));
double tmp;
if (y <= -106.0) {
tmp = t_2;
} else if (y <= -3e-158) {
tmp = t_1;
} else if (y <= -8.5e-234) {
tmp = 2.0 * (x * z);
} else if (y <= 2.2e-13) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t): t_1 = x * (t + (y * 2.0)) t_2 = y * (5.0 + (x * 2.0)) tmp = 0 if y <= -106.0: tmp = t_2 elif y <= -3e-158: tmp = t_1 elif y <= -8.5e-234: tmp = 2.0 * (x * z) elif y <= 2.2e-13: tmp = t_1 else: tmp = t_2 return tmp
function code(x, y, z, t) t_1 = Float64(x * Float64(t + Float64(y * 2.0))) t_2 = Float64(y * Float64(5.0 + Float64(x * 2.0))) tmp = 0.0 if (y <= -106.0) tmp = t_2; elseif (y <= -3e-158) tmp = t_1; elseif (y <= -8.5e-234) tmp = Float64(2.0 * Float64(x * z)); elseif (y <= 2.2e-13) tmp = t_1; else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = x * (t + (y * 2.0)); t_2 = y * (5.0 + (x * 2.0)); tmp = 0.0; if (y <= -106.0) tmp = t_2; elseif (y <= -3e-158) tmp = t_1; elseif (y <= -8.5e-234) tmp = 2.0 * (x * z); elseif (y <= 2.2e-13) tmp = t_1; else tmp = t_2; 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]}, Block[{t$95$2 = N[(y * N[(5.0 + N[(x * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -106.0], t$95$2, If[LessEqual[y, -3e-158], t$95$1, If[LessEqual[y, -8.5e-234], N[(2.0 * N[(x * z), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 2.2e-13], t$95$1, t$95$2]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot \left(t + y \cdot 2\right)\\
t_2 := y \cdot \left(5 + x \cdot 2\right)\\
\mathbf{if}\;y \leq -106:\\
\;\;\;\;t_2\\
\mathbf{elif}\;y \leq -3 \cdot 10^{-158}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;y \leq -8.5 \cdot 10^{-234}:\\
\;\;\;\;2 \cdot \left(x \cdot z\right)\\
\mathbf{elif}\;y \leq 2.2 \cdot 10^{-13}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;t_2\\
\end{array}
\end{array}
if y < -106 or 2.19999999999999997e-13 < y Initial program 99.9%
fma-def99.9%
associate-+l+99.9%
+-commutative99.9%
count-299.9%
Simplified99.9%
Taylor expanded in y around inf 75.7%
if -106 < y < -3e-158 or -8.5000000000000005e-234 < y < 2.19999999999999997e-13Initial program 99.9%
fma-def99.9%
associate-+l+99.9%
+-commutative99.9%
count-299.9%
Simplified99.9%
Taylor expanded in x around inf 89.7%
Taylor expanded in z around 0 57.4%
if -3e-158 < y < -8.5000000000000005e-234Initial program 100.0%
Taylor expanded in z around inf 85.3%
Final simplification68.8%
(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.85e+82)
t_2
(if (<= y 3.3e-111)
t_1
(if (<= y 1000000000000.0)
(+ (* y 5.0) (* x t))
(if (<= y 6.6e+33) t_1 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.85e+82) {
tmp = t_2;
} else if (y <= 3.3e-111) {
tmp = t_1;
} else if (y <= 1000000000000.0) {
tmp = (y * 5.0) + (x * t);
} else if (y <= 6.6e+33) {
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 = x * (t + (z * 2.0d0))
t_2 = y * (5.0d0 + (x * 2.0d0))
if (y <= (-1.85d+82)) then
tmp = t_2
else if (y <= 3.3d-111) then
tmp = t_1
else if (y <= 1000000000000.0d0) then
tmp = (y * 5.0d0) + (x * t)
else if (y <= 6.6d+33) 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 = x * (t + (z * 2.0));
double t_2 = y * (5.0 + (x * 2.0));
double tmp;
if (y <= -1.85e+82) {
tmp = t_2;
} else if (y <= 3.3e-111) {
tmp = t_1;
} else if (y <= 1000000000000.0) {
tmp = (y * 5.0) + (x * t);
} else if (y <= 6.6e+33) {
tmp = t_1;
} 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.85e+82: tmp = t_2 elif y <= 3.3e-111: tmp = t_1 elif y <= 1000000000000.0: tmp = (y * 5.0) + (x * t) elif y <= 6.6e+33: tmp = t_1 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.85e+82) tmp = t_2; elseif (y <= 3.3e-111) tmp = t_1; elseif (y <= 1000000000000.0) tmp = Float64(Float64(y * 5.0) + Float64(x * t)); elseif (y <= 6.6e+33) tmp = t_1; 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.85e+82) tmp = t_2; elseif (y <= 3.3e-111) tmp = t_1; elseif (y <= 1000000000000.0) tmp = (y * 5.0) + (x * t); elseif (y <= 6.6e+33) tmp = t_1; 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.85e+82], t$95$2, If[LessEqual[y, 3.3e-111], t$95$1, If[LessEqual[y, 1000000000000.0], N[(N[(y * 5.0), $MachinePrecision] + N[(x * t), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 6.6e+33], t$95$1, 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.85 \cdot 10^{+82}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;y \leq 3.3 \cdot 10^{-111}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;y \leq 1000000000000:\\
\;\;\;\;y \cdot 5 + x \cdot t\\
\mathbf{elif}\;y \leq 6.6 \cdot 10^{+33}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;t_2\\
\end{array}
\end{array}
if y < -1.8500000000000001e82 or 6.59999999999999953e33 < y Initial program 99.9%
fma-def99.9%
associate-+l+99.9%
+-commutative99.9%
count-299.9%
Simplified99.9%
Taylor expanded in y around inf 83.1%
if -1.8500000000000001e82 < y < 3.3e-111 or 1e12 < y < 6.59999999999999953e33Initial program 99.9%
Taylor expanded in y around 0 84.8%
if 3.3e-111 < y < 1e12Initial program 99.8%
+-commutative99.8%
fma-def100.0%
distribute-rgt-in99.9%
associate-+l+99.9%
+-commutative99.9%
count-299.9%
distribute-rgt-in100.0%
*-commutative100.0%
fma-def100.0%
Applied egg-rr100.0%
Taylor expanded in t around inf 76.3%
fma-udef76.1%
*-commutative76.1%
Applied egg-rr76.1%
Final simplification83.3%
(FPCore (x y z t) :precision binary64 (if (or (<= z -2.5e+74) (not (<= z 250000.0))) (+ (* 2.0 (* x (+ y z))) (* y 5.0)) (+ (* y 5.0) (* x (+ t (* y 2.0))))))
double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -2.5e+74) || !(z <= 250000.0)) {
tmp = (2.0 * (x * (y + z))) + (y * 5.0);
} else {
tmp = (y * 5.0) + (x * (t + (y * 2.0)));
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if ((z <= (-2.5d+74)) .or. (.not. (z <= 250000.0d0))) then
tmp = (2.0d0 * (x * (y + z))) + (y * 5.0d0)
else
tmp = (y * 5.0d0) + (x * (t + (y * 2.0d0)))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -2.5e+74) || !(z <= 250000.0)) {
tmp = (2.0 * (x * (y + z))) + (y * 5.0);
} else {
tmp = (y * 5.0) + (x * (t + (y * 2.0)));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (z <= -2.5e+74) or not (z <= 250000.0): tmp = (2.0 * (x * (y + z))) + (y * 5.0) else: tmp = (y * 5.0) + (x * (t + (y * 2.0))) return tmp
function code(x, y, z, t) tmp = 0.0 if ((z <= -2.5e+74) || !(z <= 250000.0)) tmp = Float64(Float64(2.0 * Float64(x * Float64(y + z))) + Float64(y * 5.0)); else tmp = Float64(Float64(y * 5.0) + Float64(x * Float64(t + Float64(y * 2.0)))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((z <= -2.5e+74) || ~((z <= 250000.0))) tmp = (2.0 * (x * (y + z))) + (y * 5.0); else tmp = (y * 5.0) + (x * (t + (y * 2.0))); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[z, -2.5e+74], N[Not[LessEqual[z, 250000.0]], $MachinePrecision]], N[(N[(2.0 * N[(x * N[(y + z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(y * 5.0), $MachinePrecision]), $MachinePrecision], N[(N[(y * 5.0), $MachinePrecision] + N[(x * N[(t + N[(y * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.5 \cdot 10^{+74} \lor \neg \left(z \leq 250000\right):\\
\;\;\;\;2 \cdot \left(x \cdot \left(y + z\right)\right) + y \cdot 5\\
\mathbf{else}:\\
\;\;\;\;y \cdot 5 + x \cdot \left(t + y \cdot 2\right)\\
\end{array}
\end{array}
if z < -2.49999999999999982e74 or 2.5e5 < z Initial program 100.0%
fma-def100.0%
associate-+l+100.0%
+-commutative100.0%
count-2100.0%
Simplified100.0%
Taylor expanded in t around 0 86.2%
if -2.49999999999999982e74 < z < 2.5e5Initial program 99.9%
fma-def99.9%
associate-+l+99.9%
+-commutative99.9%
count-299.9%
Simplified99.9%
Taylor expanded in z around 0 93.4%
Final simplification90.6%
(FPCore (x y z t) :precision binary64 (+ (* x (+ t (+ y (+ z (+ y z))))) (* y 5.0)))
double code(double x, double y, double z, double t) {
return (x * (t + (y + (z + (y + z))))) + (y * 5.0);
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = (x * (t + (y + (z + (y + z))))) + (y * 5.0d0)
end function
public static double code(double x, double y, double z, double t) {
return (x * (t + (y + (z + (y + z))))) + (y * 5.0);
}
def code(x, y, z, t): return (x * (t + (y + (z + (y + z))))) + (y * 5.0)
function code(x, y, z, t) return Float64(Float64(x * Float64(t + Float64(y + Float64(z + Float64(y + z))))) + Float64(y * 5.0)) end
function tmp = code(x, y, z, t) tmp = (x * (t + (y + (z + (y + z))))) + (y * 5.0); end
code[x_, y_, z_, t_] := N[(N[(x * N[(t + N[(y + N[(z + N[(y + z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(y * 5.0), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x \cdot \left(t + \left(y + \left(z + \left(y + z\right)\right)\right)\right) + y \cdot 5
\end{array}
Initial program 99.9%
Final simplification99.9%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* y (+ 5.0 x))))
(if (<= y -350000.0)
t_1
(if (<= y -5.5e-160)
(* x t)
(if (<= y -2.1e-238) (* 2.0 (* x z)) (if (<= y 2e-85) (* x t) t_1))))))
double code(double x, double y, double z, double t) {
double t_1 = y * (5.0 + x);
double tmp;
if (y <= -350000.0) {
tmp = t_1;
} else if (y <= -5.5e-160) {
tmp = x * t;
} else if (y <= -2.1e-238) {
tmp = 2.0 * (x * z);
} else if (y <= 2e-85) {
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 = y * (5.0d0 + x)
if (y <= (-350000.0d0)) then
tmp = t_1
else if (y <= (-5.5d-160)) then
tmp = x * t
else if (y <= (-2.1d-238)) then
tmp = 2.0d0 * (x * z)
else if (y <= 2d-85) 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 = y * (5.0 + x);
double tmp;
if (y <= -350000.0) {
tmp = t_1;
} else if (y <= -5.5e-160) {
tmp = x * t;
} else if (y <= -2.1e-238) {
tmp = 2.0 * (x * z);
} else if (y <= 2e-85) {
tmp = x * t;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = y * (5.0 + x) tmp = 0 if y <= -350000.0: tmp = t_1 elif y <= -5.5e-160: tmp = x * t elif y <= -2.1e-238: tmp = 2.0 * (x * z) elif y <= 2e-85: tmp = x * t else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(y * Float64(5.0 + x)) tmp = 0.0 if (y <= -350000.0) tmp = t_1; elseif (y <= -5.5e-160) tmp = Float64(x * t); elseif (y <= -2.1e-238) tmp = Float64(2.0 * Float64(x * z)); elseif (y <= 2e-85) tmp = Float64(x * t); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = y * (5.0 + x); tmp = 0.0; if (y <= -350000.0) tmp = t_1; elseif (y <= -5.5e-160) tmp = x * t; elseif (y <= -2.1e-238) tmp = 2.0 * (x * z); elseif (y <= 2e-85) tmp = x * t; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(y * N[(5.0 + x), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -350000.0], t$95$1, If[LessEqual[y, -5.5e-160], N[(x * t), $MachinePrecision], If[LessEqual[y, -2.1e-238], N[(2.0 * N[(x * z), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 2e-85], N[(x * t), $MachinePrecision], t$95$1]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := y \cdot \left(5 + x\right)\\
\mathbf{if}\;y \leq -350000:\\
\;\;\;\;t_1\\
\mathbf{elif}\;y \leq -5.5 \cdot 10^{-160}:\\
\;\;\;\;x \cdot t\\
\mathbf{elif}\;y \leq -2.1 \cdot 10^{-238}:\\
\;\;\;\;2 \cdot \left(x \cdot z\right)\\
\mathbf{elif}\;y \leq 2 \cdot 10^{-85}:\\
\;\;\;\;x \cdot t\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if y < -3.5e5 or 2e-85 < y Initial program 99.9%
Taylor expanded in y around 0 90.4%
Simplified90.4%
Taylor expanded in y around inf 65.8%
+-commutative65.8%
Simplified65.8%
if -3.5e5 < y < -5.5e-160 or -2.1000000000000001e-238 < y < 2e-85Initial program 99.9%
Taylor expanded in t around inf 56.4%
if -5.5e-160 < y < -2.1000000000000001e-238Initial program 100.0%
Taylor expanded in z around inf 85.3%
Final simplification63.3%
(FPCore (x y z t) :precision binary64 (if (or (<= x -2.9e-46) (not (<= x 1.05e-131))) (* 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 <= -2.9e-46) || !(x <= 1.05e-131)) {
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 <= (-2.9d-46)) .or. (.not. (x <= 1.05d-131))) 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 <= -2.9e-46) || !(x <= 1.05e-131)) {
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 <= -2.9e-46) or not (x <= 1.05e-131): 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 <= -2.9e-46) || !(x <= 1.05e-131)) 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 <= -2.9e-46) || ~((x <= 1.05e-131))) 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, -2.9e-46], N[Not[LessEqual[x, 1.05e-131]], $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 -2.9 \cdot 10^{-46} \lor \neg \left(x \leq 1.05 \cdot 10^{-131}\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 < -2.90000000000000005e-46 or 1.04999999999999999e-131 < 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 92.1%
if -2.90000000000000005e-46 < x < 1.04999999999999999e-131Initial program 99.8%
+-commutative99.8%
fma-def99.9%
distribute-rgt-in99.9%
associate-+l+99.9%
+-commutative99.9%
count-299.9%
distribute-rgt-in99.9%
*-commutative99.9%
fma-def99.9%
Applied egg-rr99.9%
Taylor expanded in t around inf 90.3%
fma-udef90.2%
*-commutative90.2%
Applied egg-rr90.2%
Final simplification91.4%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* 2.0 (* x z))))
(if (<= x -3.4e-45)
t_1
(if (<= x 9e-132)
(* y 5.0)
(if (<= x 1.35e-120) t_1 (if (<= x 9.2e-107) (* y 5.0) (* x t)))))))
double code(double x, double y, double z, double t) {
double t_1 = 2.0 * (x * z);
double tmp;
if (x <= -3.4e-45) {
tmp = t_1;
} else if (x <= 9e-132) {
tmp = y * 5.0;
} else if (x <= 1.35e-120) {
tmp = t_1;
} else if (x <= 9.2e-107) {
tmp = y * 5.0;
} else {
tmp = x * t;
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: tmp
t_1 = 2.0d0 * (x * z)
if (x <= (-3.4d-45)) then
tmp = t_1
else if (x <= 9d-132) then
tmp = y * 5.0d0
else if (x <= 1.35d-120) then
tmp = t_1
else if (x <= 9.2d-107) then
tmp = y * 5.0d0
else
tmp = x * t
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = 2.0 * (x * z);
double tmp;
if (x <= -3.4e-45) {
tmp = t_1;
} else if (x <= 9e-132) {
tmp = y * 5.0;
} else if (x <= 1.35e-120) {
tmp = t_1;
} else if (x <= 9.2e-107) {
tmp = y * 5.0;
} else {
tmp = x * t;
}
return tmp;
}
def code(x, y, z, t): t_1 = 2.0 * (x * z) tmp = 0 if x <= -3.4e-45: tmp = t_1 elif x <= 9e-132: tmp = y * 5.0 elif x <= 1.35e-120: tmp = t_1 elif x <= 9.2e-107: tmp = y * 5.0 else: tmp = x * t return tmp
function code(x, y, z, t) t_1 = Float64(2.0 * Float64(x * z)) tmp = 0.0 if (x <= -3.4e-45) tmp = t_1; elseif (x <= 9e-132) tmp = Float64(y * 5.0); elseif (x <= 1.35e-120) tmp = t_1; elseif (x <= 9.2e-107) tmp = Float64(y * 5.0); else tmp = Float64(x * t); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = 2.0 * (x * z); tmp = 0.0; if (x <= -3.4e-45) tmp = t_1; elseif (x <= 9e-132) tmp = y * 5.0; elseif (x <= 1.35e-120) tmp = t_1; elseif (x <= 9.2e-107) tmp = y * 5.0; else tmp = x * t; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(2.0 * N[(x * z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -3.4e-45], t$95$1, If[LessEqual[x, 9e-132], N[(y * 5.0), $MachinePrecision], If[LessEqual[x, 1.35e-120], t$95$1, If[LessEqual[x, 9.2e-107], N[(y * 5.0), $MachinePrecision], N[(x * t), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := 2 \cdot \left(x \cdot z\right)\\
\mathbf{if}\;x \leq -3.4 \cdot 10^{-45}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \leq 9 \cdot 10^{-132}:\\
\;\;\;\;y \cdot 5\\
\mathbf{elif}\;x \leq 1.35 \cdot 10^{-120}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \leq 9.2 \cdot 10^{-107}:\\
\;\;\;\;y \cdot 5\\
\mathbf{else}:\\
\;\;\;\;x \cdot t\\
\end{array}
\end{array}
if x < -3.40000000000000004e-45 or 8.9999999999999999e-132 < x < 1.3499999999999999e-120Initial program 100.0%
Taylor expanded in z around inf 45.7%
if -3.40000000000000004e-45 < x < 8.9999999999999999e-132 or 1.3499999999999999e-120 < x < 9.20000000000000014e-107Initial program 99.8%
Taylor expanded in x around 0 71.0%
if 9.20000000000000014e-107 < x Initial program 100.0%
Taylor expanded in t around inf 41.6%
Final simplification53.5%
(FPCore (x y z t) :precision binary64 (if (or (<= y -8.8e+82) (not (<= y 5.6e+33))) (* 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 <= -8.8e+82) || !(y <= 5.6e+33)) {
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 <= (-8.8d+82)) .or. (.not. (y <= 5.6d+33))) 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 <= -8.8e+82) || !(y <= 5.6e+33)) {
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 <= -8.8e+82) or not (y <= 5.6e+33): 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 <= -8.8e+82) || !(y <= 5.6e+33)) 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 <= -8.8e+82) || ~((y <= 5.6e+33))) 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, -8.8e+82], N[Not[LessEqual[y, 5.6e+33]], $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 -8.8 \cdot 10^{+82} \lor \neg \left(y \leq 5.6 \cdot 10^{+33}\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 < -8.8000000000000005e82 or 5.6000000000000002e33 < y Initial program 99.9%
fma-def99.9%
associate-+l+99.9%
+-commutative99.9%
count-299.9%
Simplified99.9%
Taylor expanded in y around inf 83.1%
if -8.8000000000000005e82 < y < 5.6000000000000002e33Initial program 99.9%
Taylor expanded in y around 0 80.0%
Final simplification81.4%
(FPCore (x y z t) :precision binary64 (if (<= x -1.46e-15) (* x t) (if (<= x 9e-107) (* y 5.0) (* x t))))
double code(double x, double y, double z, double t) {
double tmp;
if (x <= -1.46e-15) {
tmp = x * t;
} else if (x <= 9e-107) {
tmp = y * 5.0;
} else {
tmp = x * t;
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (x <= (-1.46d-15)) then
tmp = x * t
else if (x <= 9d-107) then
tmp = y * 5.0d0
else
tmp = x * t
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (x <= -1.46e-15) {
tmp = x * t;
} else if (x <= 9e-107) {
tmp = y * 5.0;
} else {
tmp = x * t;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if x <= -1.46e-15: tmp = x * t elif x <= 9e-107: tmp = y * 5.0 else: tmp = x * t return tmp
function code(x, y, z, t) tmp = 0.0 if (x <= -1.46e-15) tmp = Float64(x * t); elseif (x <= 9e-107) tmp = Float64(y * 5.0); else tmp = Float64(x * t); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (x <= -1.46e-15) tmp = x * t; elseif (x <= 9e-107) tmp = y * 5.0; else tmp = x * t; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[x, -1.46e-15], N[(x * t), $MachinePrecision], If[LessEqual[x, 9e-107], N[(y * 5.0), $MachinePrecision], N[(x * t), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.46 \cdot 10^{-15}:\\
\;\;\;\;x \cdot t\\
\mathbf{elif}\;x \leq 9 \cdot 10^{-107}:\\
\;\;\;\;y \cdot 5\\
\mathbf{else}:\\
\;\;\;\;x \cdot t\\
\end{array}
\end{array}
if x < -1.4600000000000001e-15 or 9.00000000000000032e-107 < x Initial program 100.0%
Taylor expanded in t around inf 40.8%
if -1.4600000000000001e-15 < x < 9.00000000000000032e-107Initial program 99.8%
Taylor expanded in x around 0 63.5%
Final simplification50.3%
(FPCore (x y z t) :precision binary64 (* y 5.0))
double code(double x, double y, double z, double t) {
return y * 5.0;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = y * 5.0d0
end function
public static double code(double x, double y, double z, double t) {
return y * 5.0;
}
def code(x, y, z, t): return y * 5.0
function code(x, y, z, t) return Float64(y * 5.0) end
function tmp = code(x, y, z, t) tmp = y * 5.0; end
code[x_, y_, z_, t_] := N[(y * 5.0), $MachinePrecision]
\begin{array}{l}
\\
y \cdot 5
\end{array}
Initial program 99.9%
Taylor expanded in x around 0 30.4%
Final simplification30.4%
herbie shell --seed 2023274
(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)))