
(FPCore (x y z t a b) :precision binary64 (+ (- (+ (+ x y) z) (* z (log t))) (* (- a 0.5) b)))
double code(double x, double y, double z, double t, double a, double b) {
return (((x + y) + z) - (z * log(t))) + ((a - 0.5) * b);
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
code = (((x + y) + z) - (z * log(t))) + ((a - 0.5d0) * b)
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return (((x + y) + z) - (z * Math.log(t))) + ((a - 0.5) * b);
}
def code(x, y, z, t, a, b): return (((x + y) + z) - (z * math.log(t))) + ((a - 0.5) * b)
function code(x, y, z, t, a, b) return Float64(Float64(Float64(Float64(x + y) + z) - Float64(z * log(t))) + Float64(Float64(a - 0.5) * b)) end
function tmp = code(x, y, z, t, a, b) tmp = (((x + y) + z) - (z * log(t))) + ((a - 0.5) * b); end
code[x_, y_, z_, t_, a_, b_] := N[(N[(N[(N[(x + y), $MachinePrecision] + z), $MachinePrecision] - N[(z * N[Log[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(a - 0.5), $MachinePrecision] * b), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(\left(\left(x + y\right) + z\right) - z \cdot \log t\right) + \left(a - 0.5\right) \cdot b
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 20 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t a b) :precision binary64 (+ (- (+ (+ x y) z) (* z (log t))) (* (- a 0.5) b)))
double code(double x, double y, double z, double t, double a, double b) {
return (((x + y) + z) - (z * log(t))) + ((a - 0.5) * b);
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
code = (((x + y) + z) - (z * log(t))) + ((a - 0.5d0) * b)
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return (((x + y) + z) - (z * Math.log(t))) + ((a - 0.5) * b);
}
def code(x, y, z, t, a, b): return (((x + y) + z) - (z * math.log(t))) + ((a - 0.5) * b)
function code(x, y, z, t, a, b) return Float64(Float64(Float64(Float64(x + y) + z) - Float64(z * log(t))) + Float64(Float64(a - 0.5) * b)) end
function tmp = code(x, y, z, t, a, b) tmp = (((x + y) + z) - (z * log(t))) + ((a - 0.5) * b); end
code[x_, y_, z_, t_, a_, b_] := N[(N[(N[(N[(x + y), $MachinePrecision] + z), $MachinePrecision] - N[(z * N[Log[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(a - 0.5), $MachinePrecision] * b), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(\left(\left(x + y\right) + z\right) - z \cdot \log t\right) + \left(a - 0.5\right) \cdot b
\end{array}
(FPCore (x y z t a b) :precision binary64 (fma (+ a -0.5) b (+ x (+ y (- z (* z (log t)))))))
double code(double x, double y, double z, double t, double a, double b) {
return fma((a + -0.5), b, (x + (y + (z - (z * log(t))))));
}
function code(x, y, z, t, a, b) return fma(Float64(a + -0.5), b, Float64(x + Float64(y + Float64(z - Float64(z * log(t)))))) end
code[x_, y_, z_, t_, a_, b_] := N[(N[(a + -0.5), $MachinePrecision] * b + N[(x + N[(y + N[(z - N[(z * N[Log[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\mathsf{fma}\left(a + -0.5, b, x + \left(y + \left(z - z \cdot \log t\right)\right)\right)
\end{array}
Initial program 99.9%
+-commutative99.9%
fma-def99.9%
sub-neg99.9%
metadata-eval99.9%
associate--l+99.9%
associate-+l+99.9%
Simplified99.9%
Final simplification99.9%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (+ x (+ y z))) (t_2 (* b (- a 0.5))))
(if (or (<= t_2 -4.7e+78) (not (<= t_2 1e+76)))
(+ t_2 t_1)
(- t_1 (* z (log t))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = x + (y + z);
double t_2 = b * (a - 0.5);
double tmp;
if ((t_2 <= -4.7e+78) || !(t_2 <= 1e+76)) {
tmp = t_2 + t_1;
} else {
tmp = t_1 - (z * log(t));
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = x + (y + z)
t_2 = b * (a - 0.5d0)
if ((t_2 <= (-4.7d+78)) .or. (.not. (t_2 <= 1d+76))) then
tmp = t_2 + t_1
else
tmp = t_1 - (z * log(t))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = x + (y + z);
double t_2 = b * (a - 0.5);
double tmp;
if ((t_2 <= -4.7e+78) || !(t_2 <= 1e+76)) {
tmp = t_2 + t_1;
} else {
tmp = t_1 - (z * Math.log(t));
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = x + (y + z) t_2 = b * (a - 0.5) tmp = 0 if (t_2 <= -4.7e+78) or not (t_2 <= 1e+76): tmp = t_2 + t_1 else: tmp = t_1 - (z * math.log(t)) return tmp
function code(x, y, z, t, a, b) t_1 = Float64(x + Float64(y + z)) t_2 = Float64(b * Float64(a - 0.5)) tmp = 0.0 if ((t_2 <= -4.7e+78) || !(t_2 <= 1e+76)) tmp = Float64(t_2 + t_1); else tmp = Float64(t_1 - Float64(z * log(t))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = x + (y + z); t_2 = b * (a - 0.5); tmp = 0.0; if ((t_2 <= -4.7e+78) || ~((t_2 <= 1e+76))) tmp = t_2 + t_1; else tmp = t_1 - (z * log(t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(x + N[(y + z), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(b * N[(a - 0.5), $MachinePrecision]), $MachinePrecision]}, If[Or[LessEqual[t$95$2, -4.7e+78], N[Not[LessEqual[t$95$2, 1e+76]], $MachinePrecision]], N[(t$95$2 + t$95$1), $MachinePrecision], N[(t$95$1 - N[(z * N[Log[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x + \left(y + z\right)\\
t_2 := b \cdot \left(a - 0.5\right)\\
\mathbf{if}\;t_2 \leq -4.7 \cdot 10^{+78} \lor \neg \left(t_2 \leq 10^{+76}\right):\\
\;\;\;\;t_2 + t_1\\
\mathbf{else}:\\
\;\;\;\;t_1 - z \cdot \log t\\
\end{array}
\end{array}
if (*.f64 (-.f64 a 1/2) b) < -4.70000000000000006e78 or 1e76 < (*.f64 (-.f64 a 1/2) b) Initial program 99.9%
add-cube-cbrt99.9%
pow399.9%
Applied egg-rr99.9%
Taylor expanded in z around 0 91.0%
+-commutative91.0%
+-commutative91.0%
Simplified91.0%
if -4.70000000000000006e78 < (*.f64 (-.f64 a 1/2) b) < 1e76Initial program 99.8%
Taylor expanded in a around 0 97.0%
associate-+r+97.0%
+-commutative97.0%
*-commutative97.0%
Simplified97.0%
Taylor expanded in b around 0 94.6%
Final simplification92.7%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* b (- a 0.5))) (t_2 (* z (- 1.0 (log t)))))
(if (<= z -7.7e+241)
t_2
(if (<= z -2.4e+225)
(+ (+ x y) t_1)
(if (or (<= z -1.6e+182) (not (<= z 1e+169)))
(+ t_2 (* -0.5 b))
(+ t_1 (+ x (+ y z))))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = b * (a - 0.5);
double t_2 = z * (1.0 - log(t));
double tmp;
if (z <= -7.7e+241) {
tmp = t_2;
} else if (z <= -2.4e+225) {
tmp = (x + y) + t_1;
} else if ((z <= -1.6e+182) || !(z <= 1e+169)) {
tmp = t_2 + (-0.5 * b);
} else {
tmp = t_1 + (x + (y + z));
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = b * (a - 0.5d0)
t_2 = z * (1.0d0 - log(t))
if (z <= (-7.7d+241)) then
tmp = t_2
else if (z <= (-2.4d+225)) then
tmp = (x + y) + t_1
else if ((z <= (-1.6d+182)) .or. (.not. (z <= 1d+169))) then
tmp = t_2 + ((-0.5d0) * b)
else
tmp = t_1 + (x + (y + z))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = b * (a - 0.5);
double t_2 = z * (1.0 - Math.log(t));
double tmp;
if (z <= -7.7e+241) {
tmp = t_2;
} else if (z <= -2.4e+225) {
tmp = (x + y) + t_1;
} else if ((z <= -1.6e+182) || !(z <= 1e+169)) {
tmp = t_2 + (-0.5 * b);
} else {
tmp = t_1 + (x + (y + z));
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = b * (a - 0.5) t_2 = z * (1.0 - math.log(t)) tmp = 0 if z <= -7.7e+241: tmp = t_2 elif z <= -2.4e+225: tmp = (x + y) + t_1 elif (z <= -1.6e+182) or not (z <= 1e+169): tmp = t_2 + (-0.5 * b) else: tmp = t_1 + (x + (y + z)) return tmp
function code(x, y, z, t, a, b) t_1 = Float64(b * Float64(a - 0.5)) t_2 = Float64(z * Float64(1.0 - log(t))) tmp = 0.0 if (z <= -7.7e+241) tmp = t_2; elseif (z <= -2.4e+225) tmp = Float64(Float64(x + y) + t_1); elseif ((z <= -1.6e+182) || !(z <= 1e+169)) tmp = Float64(t_2 + Float64(-0.5 * b)); else tmp = Float64(t_1 + Float64(x + Float64(y + z))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = b * (a - 0.5); t_2 = z * (1.0 - log(t)); tmp = 0.0; if (z <= -7.7e+241) tmp = t_2; elseif (z <= -2.4e+225) tmp = (x + y) + t_1; elseif ((z <= -1.6e+182) || ~((z <= 1e+169))) tmp = t_2 + (-0.5 * b); else tmp = t_1 + (x + (y + z)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(b * N[(a - 0.5), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(z * N[(1.0 - N[Log[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -7.7e+241], t$95$2, If[LessEqual[z, -2.4e+225], N[(N[(x + y), $MachinePrecision] + t$95$1), $MachinePrecision], If[Or[LessEqual[z, -1.6e+182], N[Not[LessEqual[z, 1e+169]], $MachinePrecision]], N[(t$95$2 + N[(-0.5 * b), $MachinePrecision]), $MachinePrecision], N[(t$95$1 + N[(x + N[(y + z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := b \cdot \left(a - 0.5\right)\\
t_2 := z \cdot \left(1 - \log t\right)\\
\mathbf{if}\;z \leq -7.7 \cdot 10^{+241}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;z \leq -2.4 \cdot 10^{+225}:\\
\;\;\;\;\left(x + y\right) + t_1\\
\mathbf{elif}\;z \leq -1.6 \cdot 10^{+182} \lor \neg \left(z \leq 10^{+169}\right):\\
\;\;\;\;t_2 + -0.5 \cdot b\\
\mathbf{else}:\\
\;\;\;\;t_1 + \left(x + \left(y + z\right)\right)\\
\end{array}
\end{array}
if z < -7.69999999999999998e241Initial program 99.5%
Taylor expanded in z around inf 84.9%
Taylor expanded in z around inf 70.8%
if -7.69999999999999998e241 < z < -2.4000000000000001e225Initial program 100.0%
Taylor expanded in z around 0 100.0%
+-commutative100.0%
Simplified100.0%
if -2.4000000000000001e225 < z < -1.5999999999999999e182 or 9.99999999999999934e168 < z Initial program 99.7%
Taylor expanded in z around inf 89.8%
Taylor expanded in a around 0 79.8%
*-commutative79.8%
Simplified79.8%
if -1.5999999999999999e182 < z < 9.99999999999999934e168Initial program 99.9%
add-cube-cbrt99.8%
pow399.8%
Applied egg-rr99.8%
Taylor expanded in z around 0 92.7%
+-commutative92.7%
+-commutative92.7%
Simplified92.7%
Final simplification90.3%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* b (- a 0.5))))
(if (<= y 2.4e+51)
(- (+ x (+ z t_1)) (* z (log t)))
(+ t_1 (+ x (+ y z))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = b * (a - 0.5);
double tmp;
if (y <= 2.4e+51) {
tmp = (x + (z + t_1)) - (z * log(t));
} else {
tmp = t_1 + (x + (y + z));
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: t_1
real(8) :: tmp
t_1 = b * (a - 0.5d0)
if (y <= 2.4d+51) then
tmp = (x + (z + t_1)) - (z * log(t))
else
tmp = t_1 + (x + (y + z))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = b * (a - 0.5);
double tmp;
if (y <= 2.4e+51) {
tmp = (x + (z + t_1)) - (z * Math.log(t));
} else {
tmp = t_1 + (x + (y + z));
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = b * (a - 0.5) tmp = 0 if y <= 2.4e+51: tmp = (x + (z + t_1)) - (z * math.log(t)) else: tmp = t_1 + (x + (y + z)) return tmp
function code(x, y, z, t, a, b) t_1 = Float64(b * Float64(a - 0.5)) tmp = 0.0 if (y <= 2.4e+51) tmp = Float64(Float64(x + Float64(z + t_1)) - Float64(z * log(t))); else tmp = Float64(t_1 + Float64(x + Float64(y + z))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = b * (a - 0.5); tmp = 0.0; if (y <= 2.4e+51) tmp = (x + (z + t_1)) - (z * log(t)); else tmp = t_1 + (x + (y + z)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(b * N[(a - 0.5), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, 2.4e+51], N[(N[(x + N[(z + t$95$1), $MachinePrecision]), $MachinePrecision] - N[(z * N[Log[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t$95$1 + N[(x + N[(y + z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := b \cdot \left(a - 0.5\right)\\
\mathbf{if}\;y \leq 2.4 \cdot 10^{+51}:\\
\;\;\;\;\left(x + \left(z + t_1\right)\right) - z \cdot \log t\\
\mathbf{else}:\\
\;\;\;\;t_1 + \left(x + \left(y + z\right)\right)\\
\end{array}
\end{array}
if y < 2.3999999999999999e51Initial program 99.9%
Taylor expanded in y around 0 87.0%
if 2.3999999999999999e51 < y Initial program 99.9%
add-cube-cbrt99.8%
pow399.8%
Applied egg-rr99.8%
Taylor expanded in z around 0 89.4%
+-commutative89.4%
+-commutative89.4%
Simplified89.4%
Final simplification87.5%
(FPCore (x y z t a b) :precision binary64 (+ (- (+ z (+ x y)) (* z (log t))) (* b (- a 0.5))))
double code(double x, double y, double z, double t, double a, double b) {
return ((z + (x + y)) - (z * log(t))) + (b * (a - 0.5));
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
code = ((z + (x + y)) - (z * log(t))) + (b * (a - 0.5d0))
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return ((z + (x + y)) - (z * Math.log(t))) + (b * (a - 0.5));
}
def code(x, y, z, t, a, b): return ((z + (x + y)) - (z * math.log(t))) + (b * (a - 0.5))
function code(x, y, z, t, a, b) return Float64(Float64(Float64(z + Float64(x + y)) - Float64(z * log(t))) + Float64(b * Float64(a - 0.5))) end
function tmp = code(x, y, z, t, a, b) tmp = ((z + (x + y)) - (z * log(t))) + (b * (a - 0.5)); end
code[x_, y_, z_, t_, a_, b_] := N[(N[(N[(z + N[(x + y), $MachinePrecision]), $MachinePrecision] - N[(z * N[Log[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(b * N[(a - 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(\left(z + \left(x + y\right)\right) - z \cdot \log t\right) + b \cdot \left(a - 0.5\right)
\end{array}
Initial program 99.9%
Final simplification99.9%
(FPCore (x y z t a b) :precision binary64 (if (or (<= z -9.2e+241) (not (<= z 2.75e+169))) (* z (- 1.0 (log t))) (+ (* b (- a 0.5)) (+ x (+ y z)))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((z <= -9.2e+241) || !(z <= 2.75e+169)) {
tmp = z * (1.0 - log(t));
} else {
tmp = (b * (a - 0.5)) + (x + (y + z));
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if ((z <= (-9.2d+241)) .or. (.not. (z <= 2.75d+169))) then
tmp = z * (1.0d0 - log(t))
else
tmp = (b * (a - 0.5d0)) + (x + (y + z))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((z <= -9.2e+241) || !(z <= 2.75e+169)) {
tmp = z * (1.0 - Math.log(t));
} else {
tmp = (b * (a - 0.5)) + (x + (y + z));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (z <= -9.2e+241) or not (z <= 2.75e+169): tmp = z * (1.0 - math.log(t)) else: tmp = (b * (a - 0.5)) + (x + (y + z)) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((z <= -9.2e+241) || !(z <= 2.75e+169)) tmp = Float64(z * Float64(1.0 - log(t))); else tmp = Float64(Float64(b * Float64(a - 0.5)) + Float64(x + Float64(y + z))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((z <= -9.2e+241) || ~((z <= 2.75e+169))) tmp = z * (1.0 - log(t)); else tmp = (b * (a - 0.5)) + (x + (y + z)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[z, -9.2e+241], N[Not[LessEqual[z, 2.75e+169]], $MachinePrecision]], N[(z * N[(1.0 - N[Log[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(b * N[(a - 0.5), $MachinePrecision]), $MachinePrecision] + N[(x + N[(y + z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -9.2 \cdot 10^{+241} \lor \neg \left(z \leq 2.75 \cdot 10^{+169}\right):\\
\;\;\;\;z \cdot \left(1 - \log t\right)\\
\mathbf{else}:\\
\;\;\;\;b \cdot \left(a - 0.5\right) + \left(x + \left(y + z\right)\right)\\
\end{array}
\end{array}
if z < -9.1999999999999998e241 or 2.74999999999999986e169 < z Initial program 99.7%
Taylor expanded in z around inf 85.9%
Taylor expanded in z around inf 72.6%
if -9.1999999999999998e241 < z < 2.74999999999999986e169Initial program 99.9%
add-cube-cbrt99.8%
pow399.8%
Applied egg-rr99.8%
Taylor expanded in z around 0 90.7%
+-commutative90.7%
+-commutative90.7%
Simplified90.7%
Final simplification88.2%
(FPCore (x y z t a b)
:precision binary64
(if (<= (+ x y) -1e+122)
(+ x y)
(if (<= (+ x y) -1e-287)
(* a b)
(if (<= (+ x y) 4e-125)
(* -0.5 b)
(if (<= (+ x y) 4e+127) (* a b) (+ x y))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((x + y) <= -1e+122) {
tmp = x + y;
} else if ((x + y) <= -1e-287) {
tmp = a * b;
} else if ((x + y) <= 4e-125) {
tmp = -0.5 * b;
} else if ((x + y) <= 4e+127) {
tmp = a * b;
} else {
tmp = x + y;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if ((x + y) <= (-1d+122)) then
tmp = x + y
else if ((x + y) <= (-1d-287)) then
tmp = a * b
else if ((x + y) <= 4d-125) then
tmp = (-0.5d0) * b
else if ((x + y) <= 4d+127) then
tmp = a * b
else
tmp = x + y
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((x + y) <= -1e+122) {
tmp = x + y;
} else if ((x + y) <= -1e-287) {
tmp = a * b;
} else if ((x + y) <= 4e-125) {
tmp = -0.5 * b;
} else if ((x + y) <= 4e+127) {
tmp = a * b;
} else {
tmp = x + y;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (x + y) <= -1e+122: tmp = x + y elif (x + y) <= -1e-287: tmp = a * b elif (x + y) <= 4e-125: tmp = -0.5 * b elif (x + y) <= 4e+127: tmp = a * b else: tmp = x + y return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (Float64(x + y) <= -1e+122) tmp = Float64(x + y); elseif (Float64(x + y) <= -1e-287) tmp = Float64(a * b); elseif (Float64(x + y) <= 4e-125) tmp = Float64(-0.5 * b); elseif (Float64(x + y) <= 4e+127) tmp = Float64(a * b); else tmp = Float64(x + y); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((x + y) <= -1e+122) tmp = x + y; elseif ((x + y) <= -1e-287) tmp = a * b; elseif ((x + y) <= 4e-125) tmp = -0.5 * b; elseif ((x + y) <= 4e+127) tmp = a * b; else tmp = x + y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[N[(x + y), $MachinePrecision], -1e+122], N[(x + y), $MachinePrecision], If[LessEqual[N[(x + y), $MachinePrecision], -1e-287], N[(a * b), $MachinePrecision], If[LessEqual[N[(x + y), $MachinePrecision], 4e-125], N[(-0.5 * b), $MachinePrecision], If[LessEqual[N[(x + y), $MachinePrecision], 4e+127], N[(a * b), $MachinePrecision], N[(x + y), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x + y \leq -1 \cdot 10^{+122}:\\
\;\;\;\;x + y\\
\mathbf{elif}\;x + y \leq -1 \cdot 10^{-287}:\\
\;\;\;\;a \cdot b\\
\mathbf{elif}\;x + y \leq 4 \cdot 10^{-125}:\\
\;\;\;\;-0.5 \cdot b\\
\mathbf{elif}\;x + y \leq 4 \cdot 10^{+127}:\\
\;\;\;\;a \cdot b\\
\mathbf{else}:\\
\;\;\;\;x + y\\
\end{array}
\end{array}
if (+.f64 x y) < -1.00000000000000001e122 or 3.99999999999999982e127 < (+.f64 x y) Initial program 100.0%
add-cube-cbrt99.9%
pow399.9%
Applied egg-rr99.9%
Taylor expanded in z around 0 92.4%
+-commutative92.4%
+-commutative92.4%
Simplified92.4%
Taylor expanded in z around 0 92.1%
+-commutative92.1%
sub-neg92.1%
metadata-eval92.1%
*-commutative92.1%
associate-+l+92.1%
*-commutative92.1%
fma-def92.2%
Simplified92.2%
Taylor expanded in b around 0 71.5%
if -1.00000000000000001e122 < (+.f64 x y) < -1.00000000000000002e-287 or 4.00000000000000005e-125 < (+.f64 x y) < 3.99999999999999982e127Initial program 99.8%
Taylor expanded in a around inf 43.1%
*-commutative43.1%
Simplified43.1%
if -1.00000000000000002e-287 < (+.f64 x y) < 4.00000000000000005e-125Initial program 100.0%
Taylor expanded in a around 0 83.1%
associate-+r+83.1%
+-commutative83.1%
*-commutative83.1%
Simplified83.1%
Taylor expanded in b around inf 83.1%
*-commutative83.1%
Simplified83.1%
Final simplification59.8%
(FPCore (x y z t a b) :precision binary64 (let* ((t_1 (* b (- a 0.5)))) (if (or (<= t_1 -1e+98) (not (<= t_1 3e+85))) (+ x t_1) (+ z (+ x y)))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = b * (a - 0.5);
double tmp;
if ((t_1 <= -1e+98) || !(t_1 <= 3e+85)) {
tmp = x + t_1;
} else {
tmp = z + (x + y);
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: t_1
real(8) :: tmp
t_1 = b * (a - 0.5d0)
if ((t_1 <= (-1d+98)) .or. (.not. (t_1 <= 3d+85))) then
tmp = x + t_1
else
tmp = z + (x + y)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = b * (a - 0.5);
double tmp;
if ((t_1 <= -1e+98) || !(t_1 <= 3e+85)) {
tmp = x + t_1;
} else {
tmp = z + (x + y);
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = b * (a - 0.5) tmp = 0 if (t_1 <= -1e+98) or not (t_1 <= 3e+85): tmp = x + t_1 else: tmp = z + (x + y) return tmp
function code(x, y, z, t, a, b) t_1 = Float64(b * Float64(a - 0.5)) tmp = 0.0 if ((t_1 <= -1e+98) || !(t_1 <= 3e+85)) tmp = Float64(x + t_1); else tmp = Float64(z + Float64(x + y)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = b * (a - 0.5); tmp = 0.0; if ((t_1 <= -1e+98) || ~((t_1 <= 3e+85))) tmp = x + t_1; else tmp = z + (x + y); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(b * N[(a - 0.5), $MachinePrecision]), $MachinePrecision]}, If[Or[LessEqual[t$95$1, -1e+98], N[Not[LessEqual[t$95$1, 3e+85]], $MachinePrecision]], N[(x + t$95$1), $MachinePrecision], N[(z + N[(x + y), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := b \cdot \left(a - 0.5\right)\\
\mathbf{if}\;t_1 \leq -1 \cdot 10^{+98} \lor \neg \left(t_1 \leq 3 \cdot 10^{+85}\right):\\
\;\;\;\;x + t_1\\
\mathbf{else}:\\
\;\;\;\;z + \left(x + y\right)\\
\end{array}
\end{array}
if (*.f64 (-.f64 a 1/2) b) < -9.99999999999999998e97 or 3e85 < (*.f64 (-.f64 a 1/2) b) Initial program 99.9%
Taylor expanded in x around inf 79.1%
if -9.99999999999999998e97 < (*.f64 (-.f64 a 1/2) b) < 3e85Initial program 99.9%
add-cube-cbrt99.5%
pow399.5%
Applied egg-rr99.5%
Taylor expanded in z around 0 75.7%
+-commutative75.7%
+-commutative75.7%
Simplified75.7%
Taylor expanded in b around 0 69.5%
associate-+r+69.5%
+-commutative69.5%
+-commutative69.5%
+-commutative69.5%
Simplified69.5%
Final simplification74.0%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* b (- a 0.5))))
(if (or (<= t_1 -1e+98) (not (<= t_1 2e+125)))
(+ x t_1)
(+ x (+ y (* -0.5 b))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = b * (a - 0.5);
double tmp;
if ((t_1 <= -1e+98) || !(t_1 <= 2e+125)) {
tmp = x + t_1;
} else {
tmp = x + (y + (-0.5 * b));
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: t_1
real(8) :: tmp
t_1 = b * (a - 0.5d0)
if ((t_1 <= (-1d+98)) .or. (.not. (t_1 <= 2d+125))) then
tmp = x + t_1
else
tmp = x + (y + ((-0.5d0) * b))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = b * (a - 0.5);
double tmp;
if ((t_1 <= -1e+98) || !(t_1 <= 2e+125)) {
tmp = x + t_1;
} else {
tmp = x + (y + (-0.5 * b));
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = b * (a - 0.5) tmp = 0 if (t_1 <= -1e+98) or not (t_1 <= 2e+125): tmp = x + t_1 else: tmp = x + (y + (-0.5 * b)) return tmp
function code(x, y, z, t, a, b) t_1 = Float64(b * Float64(a - 0.5)) tmp = 0.0 if ((t_1 <= -1e+98) || !(t_1 <= 2e+125)) tmp = Float64(x + t_1); else tmp = Float64(x + Float64(y + Float64(-0.5 * b))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = b * (a - 0.5); tmp = 0.0; if ((t_1 <= -1e+98) || ~((t_1 <= 2e+125))) tmp = x + t_1; else tmp = x + (y + (-0.5 * b)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(b * N[(a - 0.5), $MachinePrecision]), $MachinePrecision]}, If[Or[LessEqual[t$95$1, -1e+98], N[Not[LessEqual[t$95$1, 2e+125]], $MachinePrecision]], N[(x + t$95$1), $MachinePrecision], N[(x + N[(y + N[(-0.5 * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := b \cdot \left(a - 0.5\right)\\
\mathbf{if}\;t_1 \leq -1 \cdot 10^{+98} \lor \neg \left(t_1 \leq 2 \cdot 10^{+125}\right):\\
\;\;\;\;x + t_1\\
\mathbf{else}:\\
\;\;\;\;x + \left(y + -0.5 \cdot b\right)\\
\end{array}
\end{array}
if (*.f64 (-.f64 a 1/2) b) < -9.99999999999999998e97 or 1.9999999999999998e125 < (*.f64 (-.f64 a 1/2) b) Initial program 99.9%
Taylor expanded in x around inf 81.4%
if -9.99999999999999998e97 < (*.f64 (-.f64 a 1/2) b) < 1.9999999999999998e125Initial program 99.9%
Taylor expanded in a around 0 95.1%
associate-+r+95.1%
+-commutative95.1%
*-commutative95.1%
Simplified95.1%
Taylor expanded in z around 0 70.1%
*-commutative70.1%
Simplified70.1%
Final simplification75.0%
(FPCore (x y z t a b) :precision binary64 (if (<= (+ x y) -1e+122) (+ x y) (if (<= (+ x y) 4e+127) (* b (- a 0.5)) (+ x y))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((x + y) <= -1e+122) {
tmp = x + y;
} else if ((x + y) <= 4e+127) {
tmp = b * (a - 0.5);
} else {
tmp = x + y;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if ((x + y) <= (-1d+122)) then
tmp = x + y
else if ((x + y) <= 4d+127) then
tmp = b * (a - 0.5d0)
else
tmp = x + y
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((x + y) <= -1e+122) {
tmp = x + y;
} else if ((x + y) <= 4e+127) {
tmp = b * (a - 0.5);
} else {
tmp = x + y;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (x + y) <= -1e+122: tmp = x + y elif (x + y) <= 4e+127: tmp = b * (a - 0.5) else: tmp = x + y return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (Float64(x + y) <= -1e+122) tmp = Float64(x + y); elseif (Float64(x + y) <= 4e+127) tmp = Float64(b * Float64(a - 0.5)); else tmp = Float64(x + y); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((x + y) <= -1e+122) tmp = x + y; elseif ((x + y) <= 4e+127) tmp = b * (a - 0.5); else tmp = x + y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[N[(x + y), $MachinePrecision], -1e+122], N[(x + y), $MachinePrecision], If[LessEqual[N[(x + y), $MachinePrecision], 4e+127], N[(b * N[(a - 0.5), $MachinePrecision]), $MachinePrecision], N[(x + y), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x + y \leq -1 \cdot 10^{+122}:\\
\;\;\;\;x + y\\
\mathbf{elif}\;x + y \leq 4 \cdot 10^{+127}:\\
\;\;\;\;b \cdot \left(a - 0.5\right)\\
\mathbf{else}:\\
\;\;\;\;x + y\\
\end{array}
\end{array}
if (+.f64 x y) < -1.00000000000000001e122 or 3.99999999999999982e127 < (+.f64 x y) Initial program 100.0%
add-cube-cbrt99.9%
pow399.9%
Applied egg-rr99.9%
Taylor expanded in z around 0 92.4%
+-commutative92.4%
+-commutative92.4%
Simplified92.4%
Taylor expanded in z around 0 92.1%
+-commutative92.1%
sub-neg92.1%
metadata-eval92.1%
*-commutative92.1%
associate-+l+92.1%
*-commutative92.1%
fma-def92.2%
Simplified92.2%
Taylor expanded in b around 0 71.5%
if -1.00000000000000001e122 < (+.f64 x y) < 3.99999999999999982e127Initial program 99.8%
Taylor expanded in b around inf 57.8%
Final simplification65.3%
(FPCore (x y z t a b) :precision binary64 (if (<= (+ x y) -1e+122) (+ x y) (if (<= (+ x y) 4e+127) (* b (- a 0.5)) (+ y (* -0.5 b)))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((x + y) <= -1e+122) {
tmp = x + y;
} else if ((x + y) <= 4e+127) {
tmp = b * (a - 0.5);
} else {
tmp = y + (-0.5 * b);
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if ((x + y) <= (-1d+122)) then
tmp = x + y
else if ((x + y) <= 4d+127) then
tmp = b * (a - 0.5d0)
else
tmp = y + ((-0.5d0) * b)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((x + y) <= -1e+122) {
tmp = x + y;
} else if ((x + y) <= 4e+127) {
tmp = b * (a - 0.5);
} else {
tmp = y + (-0.5 * b);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (x + y) <= -1e+122: tmp = x + y elif (x + y) <= 4e+127: tmp = b * (a - 0.5) else: tmp = y + (-0.5 * b) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (Float64(x + y) <= -1e+122) tmp = Float64(x + y); elseif (Float64(x + y) <= 4e+127) tmp = Float64(b * Float64(a - 0.5)); else tmp = Float64(y + Float64(-0.5 * b)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((x + y) <= -1e+122) tmp = x + y; elseif ((x + y) <= 4e+127) tmp = b * (a - 0.5); else tmp = y + (-0.5 * b); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[N[(x + y), $MachinePrecision], -1e+122], N[(x + y), $MachinePrecision], If[LessEqual[N[(x + y), $MachinePrecision], 4e+127], N[(b * N[(a - 0.5), $MachinePrecision]), $MachinePrecision], N[(y + N[(-0.5 * b), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x + y \leq -1 \cdot 10^{+122}:\\
\;\;\;\;x + y\\
\mathbf{elif}\;x + y \leq 4 \cdot 10^{+127}:\\
\;\;\;\;b \cdot \left(a - 0.5\right)\\
\mathbf{else}:\\
\;\;\;\;y + -0.5 \cdot b\\
\end{array}
\end{array}
if (+.f64 x y) < -1.00000000000000001e122Initial program 100.0%
add-cube-cbrt99.9%
pow399.9%
Applied egg-rr99.9%
Taylor expanded in z around 0 94.1%
+-commutative94.1%
+-commutative94.1%
Simplified94.1%
Taylor expanded in z around 0 93.7%
+-commutative93.7%
sub-neg93.7%
metadata-eval93.7%
*-commutative93.7%
associate-+l+93.7%
*-commutative93.7%
fma-def93.7%
Simplified93.7%
Taylor expanded in b around 0 78.3%
if -1.00000000000000001e122 < (+.f64 x y) < 3.99999999999999982e127Initial program 99.8%
Taylor expanded in b around inf 57.8%
if 3.99999999999999982e127 < (+.f64 x y) Initial program 100.0%
Taylor expanded in y around inf 59.7%
Taylor expanded in a around 0 35.9%
*-commutative35.9%
Simplified35.9%
Final simplification57.2%
(FPCore (x y z t a b) :precision binary64 (if (<= (+ x y) -1e+122) (+ z (+ x y)) (if (<= (+ x y) 4e+127) (* b (- a 0.5)) (+ y (* -0.5 b)))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((x + y) <= -1e+122) {
tmp = z + (x + y);
} else if ((x + y) <= 4e+127) {
tmp = b * (a - 0.5);
} else {
tmp = y + (-0.5 * b);
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if ((x + y) <= (-1d+122)) then
tmp = z + (x + y)
else if ((x + y) <= 4d+127) then
tmp = b * (a - 0.5d0)
else
tmp = y + ((-0.5d0) * b)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((x + y) <= -1e+122) {
tmp = z + (x + y);
} else if ((x + y) <= 4e+127) {
tmp = b * (a - 0.5);
} else {
tmp = y + (-0.5 * b);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (x + y) <= -1e+122: tmp = z + (x + y) elif (x + y) <= 4e+127: tmp = b * (a - 0.5) else: tmp = y + (-0.5 * b) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (Float64(x + y) <= -1e+122) tmp = Float64(z + Float64(x + y)); elseif (Float64(x + y) <= 4e+127) tmp = Float64(b * Float64(a - 0.5)); else tmp = Float64(y + Float64(-0.5 * b)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((x + y) <= -1e+122) tmp = z + (x + y); elseif ((x + y) <= 4e+127) tmp = b * (a - 0.5); else tmp = y + (-0.5 * b); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[N[(x + y), $MachinePrecision], -1e+122], N[(z + N[(x + y), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(x + y), $MachinePrecision], 4e+127], N[(b * N[(a - 0.5), $MachinePrecision]), $MachinePrecision], N[(y + N[(-0.5 * b), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x + y \leq -1 \cdot 10^{+122}:\\
\;\;\;\;z + \left(x + y\right)\\
\mathbf{elif}\;x + y \leq 4 \cdot 10^{+127}:\\
\;\;\;\;b \cdot \left(a - 0.5\right)\\
\mathbf{else}:\\
\;\;\;\;y + -0.5 \cdot b\\
\end{array}
\end{array}
if (+.f64 x y) < -1.00000000000000001e122Initial program 100.0%
add-cube-cbrt99.9%
pow399.9%
Applied egg-rr99.9%
Taylor expanded in z around 0 94.1%
+-commutative94.1%
+-commutative94.1%
Simplified94.1%
Taylor expanded in b around 0 78.7%
associate-+r+78.7%
+-commutative78.7%
+-commutative78.7%
+-commutative78.7%
Simplified78.7%
if -1.00000000000000001e122 < (+.f64 x y) < 3.99999999999999982e127Initial program 99.8%
Taylor expanded in b around inf 57.8%
if 3.99999999999999982e127 < (+.f64 x y) Initial program 100.0%
Taylor expanded in y around inf 59.7%
Taylor expanded in a around 0 35.9%
*-commutative35.9%
Simplified35.9%
Final simplification57.3%
(FPCore (x y z t a b) :precision binary64 (if (<= (+ x y) 2e-65) (+ (+ x z) (* (+ a -0.5) b)) (+ y (* b (- a 0.5)))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((x + y) <= 2e-65) {
tmp = (x + z) + ((a + -0.5) * b);
} else {
tmp = y + (b * (a - 0.5));
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if ((x + y) <= 2d-65) then
tmp = (x + z) + ((a + (-0.5d0)) * b)
else
tmp = y + (b * (a - 0.5d0))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((x + y) <= 2e-65) {
tmp = (x + z) + ((a + -0.5) * b);
} else {
tmp = y + (b * (a - 0.5));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (x + y) <= 2e-65: tmp = (x + z) + ((a + -0.5) * b) else: tmp = y + (b * (a - 0.5)) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (Float64(x + y) <= 2e-65) tmp = Float64(Float64(x + z) + Float64(Float64(a + -0.5) * b)); else tmp = Float64(y + Float64(b * Float64(a - 0.5))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((x + y) <= 2e-65) tmp = (x + z) + ((a + -0.5) * b); else tmp = y + (b * (a - 0.5)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[N[(x + y), $MachinePrecision], 2e-65], N[(N[(x + z), $MachinePrecision] + N[(N[(a + -0.5), $MachinePrecision] * b), $MachinePrecision]), $MachinePrecision], N[(y + N[(b * N[(a - 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x + y \leq 2 \cdot 10^{-65}:\\
\;\;\;\;\left(x + z\right) + \left(a + -0.5\right) \cdot b\\
\mathbf{else}:\\
\;\;\;\;y + b \cdot \left(a - 0.5\right)\\
\end{array}
\end{array}
if (+.f64 x y) < 1.99999999999999985e-65Initial program 99.9%
add-cube-cbrt99.6%
pow399.6%
Applied egg-rr99.6%
Taylor expanded in z around 0 82.5%
+-commutative82.5%
+-commutative82.5%
Simplified82.5%
Taylor expanded in y around 0 67.2%
associate-+r+67.2%
sub-neg67.2%
metadata-eval67.2%
Simplified67.2%
if 1.99999999999999985e-65 < (+.f64 x y) Initial program 99.9%
Taylor expanded in y around inf 61.4%
Final simplification64.7%
(FPCore (x y z t a b) :precision binary64 (let* ((t_1 (* b (- a 0.5)))) (if (<= (+ x y) -4e-30) (+ x t_1) (+ y t_1))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = b * (a - 0.5);
double tmp;
if ((x + y) <= -4e-30) {
tmp = x + t_1;
} else {
tmp = y + t_1;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: t_1
real(8) :: tmp
t_1 = b * (a - 0.5d0)
if ((x + y) <= (-4d-30)) then
tmp = x + t_1
else
tmp = y + t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = b * (a - 0.5);
double tmp;
if ((x + y) <= -4e-30) {
tmp = x + t_1;
} else {
tmp = y + t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = b * (a - 0.5) tmp = 0 if (x + y) <= -4e-30: tmp = x + t_1 else: tmp = y + t_1 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(b * Float64(a - 0.5)) tmp = 0.0 if (Float64(x + y) <= -4e-30) tmp = Float64(x + t_1); else tmp = Float64(y + t_1); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = b * (a - 0.5); tmp = 0.0; if ((x + y) <= -4e-30) tmp = x + t_1; else tmp = y + t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(b * N[(a - 0.5), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(x + y), $MachinePrecision], -4e-30], N[(x + t$95$1), $MachinePrecision], N[(y + t$95$1), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := b \cdot \left(a - 0.5\right)\\
\mathbf{if}\;x + y \leq -4 \cdot 10^{-30}:\\
\;\;\;\;x + t_1\\
\mathbf{else}:\\
\;\;\;\;y + t_1\\
\end{array}
\end{array}
if (+.f64 x y) < -4e-30Initial program 99.9%
Taylor expanded in x around inf 66.6%
if -4e-30 < (+.f64 x y) Initial program 99.9%
Taylor expanded in y around inf 62.0%
Final simplification63.9%
(FPCore (x y z t a b) :precision binary64 (+ (* b (- a 0.5)) (+ x (+ y z))))
double code(double x, double y, double z, double t, double a, double b) {
return (b * (a - 0.5)) + (x + (y + z));
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
code = (b * (a - 0.5d0)) + (x + (y + z))
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return (b * (a - 0.5)) + (x + (y + z));
}
def code(x, y, z, t, a, b): return (b * (a - 0.5)) + (x + (y + z))
function code(x, y, z, t, a, b) return Float64(Float64(b * Float64(a - 0.5)) + Float64(x + Float64(y + z))) end
function tmp = code(x, y, z, t, a, b) tmp = (b * (a - 0.5)) + (x + (y + z)); end
code[x_, y_, z_, t_, a_, b_] := N[(N[(b * N[(a - 0.5), $MachinePrecision]), $MachinePrecision] + N[(x + N[(y + z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
b \cdot \left(a - 0.5\right) + \left(x + \left(y + z\right)\right)
\end{array}
Initial program 99.9%
add-cube-cbrt99.7%
pow399.7%
Applied egg-rr99.7%
Taylor expanded in z around 0 82.9%
+-commutative82.9%
+-commutative82.9%
Simplified82.9%
Final simplification82.9%
(FPCore (x y z t a b) :precision binary64 (+ (+ x y) (* b (- a 0.5))))
double code(double x, double y, double z, double t, double a, double b) {
return (x + y) + (b * (a - 0.5));
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
code = (x + y) + (b * (a - 0.5d0))
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return (x + y) + (b * (a - 0.5));
}
def code(x, y, z, t, a, b): return (x + y) + (b * (a - 0.5))
function code(x, y, z, t, a, b) return Float64(Float64(x + y) + Float64(b * Float64(a - 0.5))) end
function tmp = code(x, y, z, t, a, b) tmp = (x + y) + (b * (a - 0.5)); end
code[x_, y_, z_, t_, a_, b_] := N[(N[(x + y), $MachinePrecision] + N[(b * N[(a - 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(x + y\right) + b \cdot \left(a - 0.5\right)
\end{array}
Initial program 99.9%
Taylor expanded in z around 0 81.9%
+-commutative81.9%
Simplified81.9%
Final simplification81.9%
(FPCore (x y z t a b) :precision binary64 (if (<= y -3.7e-287) x (if (<= y 8.5e-239) (* -0.5 b) (if (<= y 1.45e+54) x y))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (y <= -3.7e-287) {
tmp = x;
} else if (y <= 8.5e-239) {
tmp = -0.5 * b;
} else if (y <= 1.45e+54) {
tmp = x;
} else {
tmp = y;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if (y <= (-3.7d-287)) then
tmp = x
else if (y <= 8.5d-239) then
tmp = (-0.5d0) * b
else if (y <= 1.45d+54) then
tmp = x
else
tmp = y
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (y <= -3.7e-287) {
tmp = x;
} else if (y <= 8.5e-239) {
tmp = -0.5 * b;
} else if (y <= 1.45e+54) {
tmp = x;
} else {
tmp = y;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if y <= -3.7e-287: tmp = x elif y <= 8.5e-239: tmp = -0.5 * b elif y <= 1.45e+54: tmp = x else: tmp = y return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (y <= -3.7e-287) tmp = x; elseif (y <= 8.5e-239) tmp = Float64(-0.5 * b); elseif (y <= 1.45e+54) tmp = x; else tmp = y; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (y <= -3.7e-287) tmp = x; elseif (y <= 8.5e-239) tmp = -0.5 * b; elseif (y <= 1.45e+54) tmp = x; else tmp = y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[y, -3.7e-287], x, If[LessEqual[y, 8.5e-239], N[(-0.5 * b), $MachinePrecision], If[LessEqual[y, 1.45e+54], x, y]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -3.7 \cdot 10^{-287}:\\
\;\;\;\;x\\
\mathbf{elif}\;y \leq 8.5 \cdot 10^{-239}:\\
\;\;\;\;-0.5 \cdot b\\
\mathbf{elif}\;y \leq 1.45 \cdot 10^{+54}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;y\\
\end{array}
\end{array}
if y < -3.70000000000000027e-287 or 8.49999999999999958e-239 < y < 1.4499999999999999e54Initial program 99.9%
add-cube-cbrt99.6%
pow399.6%
Applied egg-rr99.6%
Taylor expanded in z around 0 80.2%
+-commutative80.2%
+-commutative80.2%
Simplified80.2%
Taylor expanded in x around inf 27.1%
if -3.70000000000000027e-287 < y < 8.49999999999999958e-239Initial program 99.9%
Taylor expanded in a around 0 62.5%
associate-+r+62.5%
+-commutative62.5%
*-commutative62.5%
Simplified62.5%
Taylor expanded in b around inf 19.9%
*-commutative19.9%
Simplified19.9%
if 1.4499999999999999e54 < y Initial program 99.9%
add-cube-cbrt99.8%
pow399.8%
Applied egg-rr99.8%
Taylor expanded in z around 0 89.0%
+-commutative89.0%
+-commutative89.0%
Simplified89.0%
Taylor expanded in y around inf 45.0%
Final simplification30.7%
(FPCore (x y z t a b) :precision binary64 (if (<= x -1.55e+122) x (if (<= x 4.2e-103) (* a b) y)))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (x <= -1.55e+122) {
tmp = x;
} else if (x <= 4.2e-103) {
tmp = a * b;
} else {
tmp = y;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if (x <= (-1.55d+122)) then
tmp = x
else if (x <= 4.2d-103) then
tmp = a * b
else
tmp = y
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (x <= -1.55e+122) {
tmp = x;
} else if (x <= 4.2e-103) {
tmp = a * b;
} else {
tmp = y;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if x <= -1.55e+122: tmp = x elif x <= 4.2e-103: tmp = a * b else: tmp = y return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (x <= -1.55e+122) tmp = x; elseif (x <= 4.2e-103) tmp = Float64(a * b); else tmp = y; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (x <= -1.55e+122) tmp = x; elseif (x <= 4.2e-103) tmp = a * b; else tmp = y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[x, -1.55e+122], x, If[LessEqual[x, 4.2e-103], N[(a * b), $MachinePrecision], y]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.55 \cdot 10^{+122}:\\
\;\;\;\;x\\
\mathbf{elif}\;x \leq 4.2 \cdot 10^{-103}:\\
\;\;\;\;a \cdot b\\
\mathbf{else}:\\
\;\;\;\;y\\
\end{array}
\end{array}
if x < -1.54999999999999999e122Initial program 99.9%
add-cube-cbrt99.9%
pow399.9%
Applied egg-rr99.9%
Taylor expanded in z around 0 95.1%
+-commutative95.1%
+-commutative95.1%
Simplified95.1%
Taylor expanded in x around inf 69.3%
if -1.54999999999999999e122 < x < 4.20000000000000009e-103Initial program 99.9%
Taylor expanded in a around inf 31.8%
*-commutative31.8%
Simplified31.8%
if 4.20000000000000009e-103 < x Initial program 99.9%
add-cube-cbrt99.7%
pow399.7%
Applied egg-rr99.7%
Taylor expanded in z around 0 80.9%
+-commutative80.9%
+-commutative80.9%
Simplified80.9%
Taylor expanded in y around inf 14.1%
Final simplification33.9%
(FPCore (x y z t a b) :precision binary64 (if (<= y 7.5e+54) x y))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (y <= 7.5e+54) {
tmp = x;
} else {
tmp = y;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if (y <= 7.5d+54) then
tmp = x
else
tmp = y
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (y <= 7.5e+54) {
tmp = x;
} else {
tmp = y;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if y <= 7.5e+54: tmp = x else: tmp = y return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (y <= 7.5e+54) tmp = x; else tmp = y; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (y <= 7.5e+54) tmp = x; else tmp = y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[y, 7.5e+54], x, y]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq 7.5 \cdot 10^{+54}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;y\\
\end{array}
\end{array}
if y < 7.50000000000000042e54Initial program 99.9%
add-cube-cbrt99.6%
pow399.6%
Applied egg-rr99.6%
Taylor expanded in z around 0 81.0%
+-commutative81.0%
+-commutative81.0%
Simplified81.0%
Taylor expanded in x around inf 28.0%
if 7.50000000000000042e54 < y Initial program 99.9%
add-cube-cbrt99.8%
pow399.8%
Applied egg-rr99.8%
Taylor expanded in z around 0 89.0%
+-commutative89.0%
+-commutative89.0%
Simplified89.0%
Taylor expanded in y around inf 45.0%
Final simplification32.0%
(FPCore (x y z t a b) :precision binary64 x)
double code(double x, double y, double z, double t, double a, double b) {
return x;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
code = x
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return x;
}
def code(x, y, z, t, a, b): return x
function code(x, y, z, t, a, b) return x end
function tmp = code(x, y, z, t, a, b) tmp = x; end
code[x_, y_, z_, t_, a_, b_] := x
\begin{array}{l}
\\
x
\end{array}
Initial program 99.9%
add-cube-cbrt99.7%
pow399.7%
Applied egg-rr99.7%
Taylor expanded in z around 0 82.9%
+-commutative82.9%
+-commutative82.9%
Simplified82.9%
Taylor expanded in x around inf 25.7%
Final simplification25.7%
(FPCore (x y z t a b) :precision binary64 (+ (+ (+ x y) (/ (* (- 1.0 (pow (log t) 2.0)) z) (+ 1.0 (log t)))) (* (- a 0.5) b)))
double code(double x, double y, double z, double t, double a, double b) {
return ((x + y) + (((1.0 - pow(log(t), 2.0)) * z) / (1.0 + log(t)))) + ((a - 0.5) * b);
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
code = ((x + y) + (((1.0d0 - (log(t) ** 2.0d0)) * z) / (1.0d0 + log(t)))) + ((a - 0.5d0) * b)
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return ((x + y) + (((1.0 - Math.pow(Math.log(t), 2.0)) * z) / (1.0 + Math.log(t)))) + ((a - 0.5) * b);
}
def code(x, y, z, t, a, b): return ((x + y) + (((1.0 - math.pow(math.log(t), 2.0)) * z) / (1.0 + math.log(t)))) + ((a - 0.5) * b)
function code(x, y, z, t, a, b) return Float64(Float64(Float64(x + y) + Float64(Float64(Float64(1.0 - (log(t) ^ 2.0)) * z) / Float64(1.0 + log(t)))) + Float64(Float64(a - 0.5) * b)) end
function tmp = code(x, y, z, t, a, b) tmp = ((x + y) + (((1.0 - (log(t) ^ 2.0)) * z) / (1.0 + log(t)))) + ((a - 0.5) * b); end
code[x_, y_, z_, t_, a_, b_] := N[(N[(N[(x + y), $MachinePrecision] + N[(N[(N[(1.0 - N[Power[N[Log[t], $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] * z), $MachinePrecision] / N[(1.0 + N[Log[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(a - 0.5), $MachinePrecision] * b), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(\left(x + y\right) + \frac{\left(1 - {\log t}^{2}\right) \cdot z}{1 + \log t}\right) + \left(a - 0.5\right) \cdot b
\end{array}
herbie shell --seed 2023280
(FPCore (x y z t a b)
:name "Numeric.SpecFunctions:logBeta from math-functions-0.1.5.2, A"
:precision binary64
:herbie-target
(+ (+ (+ x y) (/ (* (- 1.0 (pow (log t) 2.0)) z) (+ 1.0 (log t)))) (* (- a 0.5) b))
(+ (- (+ (+ x y) z) (* z (log t))) (* (- a 0.5) b)))