
(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 19 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 (+ (* z (- 1.0 (log t))) (fma (+ a -0.5) b (+ x y))))
double code(double x, double y, double z, double t, double a, double b) {
return (z * (1.0 - log(t))) + fma((a + -0.5), b, (x + y));
}
function code(x, y, z, t, a, b) return Float64(Float64(z * Float64(1.0 - log(t))) + fma(Float64(a + -0.5), b, Float64(x + y))) end
code[x_, y_, z_, t_, a_, b_] := N[(N[(z * N[(1.0 - N[Log[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(a + -0.5), $MachinePrecision] * b + N[(x + y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
z \cdot \left(1 - \log t\right) + \mathsf{fma}\left(a + -0.5, b, x + y\right)
\end{array}
Initial program 99.9%
+-commutative99.9%
associate--l+99.9%
associate-+r+99.9%
+-commutative99.9%
*-lft-identity99.9%
metadata-eval99.9%
*-commutative99.9%
distribute-rgt-out--99.9%
metadata-eval99.9%
fma-define99.9%
sub-neg99.9%
metadata-eval99.9%
Simplified99.9%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* b (- a 0.5))))
(if (or (<= t_1 -1e+148) (not (<= t_1 5e+92)))
(+ t_1 (+ x y))
(+ x (+ (* z (- 1.0 (log t))) 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+148) || !(t_1 <= 5e+92)) {
tmp = t_1 + (x + y);
} else {
tmp = x + ((z * (1.0 - log(t))) + 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+148)) .or. (.not. (t_1 <= 5d+92))) then
tmp = t_1 + (x + y)
else
tmp = x + ((z * (1.0d0 - log(t))) + 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+148) || !(t_1 <= 5e+92)) {
tmp = t_1 + (x + y);
} else {
tmp = x + ((z * (1.0 - Math.log(t))) + y);
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = b * (a - 0.5) tmp = 0 if (t_1 <= -1e+148) or not (t_1 <= 5e+92): tmp = t_1 + (x + y) else: tmp = x + ((z * (1.0 - math.log(t))) + 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+148) || !(t_1 <= 5e+92)) tmp = Float64(t_1 + Float64(x + y)); else tmp = Float64(x + Float64(Float64(z * Float64(1.0 - log(t))) + 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+148) || ~((t_1 <= 5e+92))) tmp = t_1 + (x + y); else tmp = x + ((z * (1.0 - log(t))) + 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+148], N[Not[LessEqual[t$95$1, 5e+92]], $MachinePrecision]], N[(t$95$1 + N[(x + y), $MachinePrecision]), $MachinePrecision], N[(x + N[(N[(z * N[(1.0 - N[Log[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + 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^{+148} \lor \neg \left(t\_1 \leq 5 \cdot 10^{+92}\right):\\
\;\;\;\;t\_1 + \left(x + y\right)\\
\mathbf{else}:\\
\;\;\;\;x + \left(z \cdot \left(1 - \log t\right) + y\right)\\
\end{array}
\end{array}
if (*.f64 (-.f64 a #s(literal 1/2 binary64)) b) < -1e148 or 5.00000000000000022e92 < (*.f64 (-.f64 a #s(literal 1/2 binary64)) b) Initial program 100.0%
add-exp-log44.0%
Applied egg-rr44.0%
Taylor expanded in z around 0 94.3%
if -1e148 < (*.f64 (-.f64 a #s(literal 1/2 binary64)) b) < 5.00000000000000022e92Initial program 99.8%
+-commutative99.8%
associate--l+99.8%
associate-+r+99.8%
+-commutative99.8%
*-lft-identity99.8%
metadata-eval99.8%
*-commutative99.8%
distribute-rgt-out--99.9%
metadata-eval99.9%
fma-define99.9%
sub-neg99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in b around 0 89.2%
Final simplification91.4%
(FPCore (x y z t a b) :precision binary64 (if (or (<= z -1.68e+41) (not (<= z 8e-34))) (- (+ x (+ y (+ z (* a b)))) (* z (log t))) (+ x (+ y (+ (* -0.5 b) (* a b))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((z <= -1.68e+41) || !(z <= 8e-34)) {
tmp = (x + (y + (z + (a * b)))) - (z * log(t));
} else {
tmp = x + (y + ((-0.5 * b) + (a * 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 ((z <= (-1.68d+41)) .or. (.not. (z <= 8d-34))) then
tmp = (x + (y + (z + (a * b)))) - (z * log(t))
else
tmp = x + (y + (((-0.5d0) * b) + (a * 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 ((z <= -1.68e+41) || !(z <= 8e-34)) {
tmp = (x + (y + (z + (a * b)))) - (z * Math.log(t));
} else {
tmp = x + (y + ((-0.5 * b) + (a * b)));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (z <= -1.68e+41) or not (z <= 8e-34): tmp = (x + (y + (z + (a * b)))) - (z * math.log(t)) else: tmp = x + (y + ((-0.5 * b) + (a * b))) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((z <= -1.68e+41) || !(z <= 8e-34)) tmp = Float64(Float64(x + Float64(y + Float64(z + Float64(a * b)))) - Float64(z * log(t))); else tmp = Float64(x + Float64(y + Float64(Float64(-0.5 * b) + Float64(a * b)))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((z <= -1.68e+41) || ~((z <= 8e-34))) tmp = (x + (y + (z + (a * b)))) - (z * log(t)); else tmp = x + (y + ((-0.5 * b) + (a * b))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[z, -1.68e+41], N[Not[LessEqual[z, 8e-34]], $MachinePrecision]], N[(N[(x + N[(y + N[(z + N[(a * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(z * N[Log[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(y + N[(N[(-0.5 * b), $MachinePrecision] + N[(a * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.68 \cdot 10^{+41} \lor \neg \left(z \leq 8 \cdot 10^{-34}\right):\\
\;\;\;\;\left(x + \left(y + \left(z + a \cdot b\right)\right)\right) - z \cdot \log t\\
\mathbf{else}:\\
\;\;\;\;x + \left(y + \left(-0.5 \cdot b + a \cdot b\right)\right)\\
\end{array}
\end{array}
if z < -1.68000000000000008e41 or 7.99999999999999942e-34 < z Initial program 99.7%
+-commutative99.7%
fma-define99.7%
sub-neg99.7%
metadata-eval99.7%
associate--l+99.8%
associate-+l+99.8%
Simplified99.8%
Taylor expanded in a around 0 99.7%
Taylor expanded in a around inf 97.9%
*-commutative97.9%
Simplified97.9%
if -1.68000000000000008e41 < z < 7.99999999999999942e-34Initial program 100.0%
+-commutative100.0%
fma-define100.0%
sub-neg100.0%
metadata-eval100.0%
associate--l+100.0%
associate-+l+100.0%
Simplified100.0%
Taylor expanded in a around 0 100.0%
Taylor expanded in z around 0 97.7%
Final simplification97.8%
(FPCore (x y z t a b) :precision binary64 (if (or (<= z -1.28e+48) (not (<= z 3.1e+143))) (- (+ x (+ z (* a b))) (* z (log t))) (+ x (+ y (+ (* -0.5 b) (* a b))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((z <= -1.28e+48) || !(z <= 3.1e+143)) {
tmp = (x + (z + (a * b))) - (z * log(t));
} else {
tmp = x + (y + ((-0.5 * b) + (a * 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 ((z <= (-1.28d+48)) .or. (.not. (z <= 3.1d+143))) then
tmp = (x + (z + (a * b))) - (z * log(t))
else
tmp = x + (y + (((-0.5d0) * b) + (a * 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 ((z <= -1.28e+48) || !(z <= 3.1e+143)) {
tmp = (x + (z + (a * b))) - (z * Math.log(t));
} else {
tmp = x + (y + ((-0.5 * b) + (a * b)));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (z <= -1.28e+48) or not (z <= 3.1e+143): tmp = (x + (z + (a * b))) - (z * math.log(t)) else: tmp = x + (y + ((-0.5 * b) + (a * b))) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((z <= -1.28e+48) || !(z <= 3.1e+143)) tmp = Float64(Float64(x + Float64(z + Float64(a * b))) - Float64(z * log(t))); else tmp = Float64(x + Float64(y + Float64(Float64(-0.5 * b) + Float64(a * b)))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((z <= -1.28e+48) || ~((z <= 3.1e+143))) tmp = (x + (z + (a * b))) - (z * log(t)); else tmp = x + (y + ((-0.5 * b) + (a * b))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[z, -1.28e+48], N[Not[LessEqual[z, 3.1e+143]], $MachinePrecision]], N[(N[(x + N[(z + N[(a * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(z * N[Log[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(y + N[(N[(-0.5 * b), $MachinePrecision] + N[(a * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.28 \cdot 10^{+48} \lor \neg \left(z \leq 3.1 \cdot 10^{+143}\right):\\
\;\;\;\;\left(x + \left(z + a \cdot b\right)\right) - z \cdot \log t\\
\mathbf{else}:\\
\;\;\;\;x + \left(y + \left(-0.5 \cdot b + a \cdot b\right)\right)\\
\end{array}
\end{array}
if z < -1.28e48 or 3.0999999999999999e143 < z Initial program 99.7%
+-commutative99.7%
fma-define99.7%
sub-neg99.7%
metadata-eval99.7%
associate--l+99.7%
associate-+l+99.7%
Simplified99.7%
Taylor expanded in a around 0 99.7%
Taylor expanded in a around inf 99.7%
*-commutative99.7%
Simplified99.7%
Taylor expanded in y around 0 90.3%
if -1.28e48 < z < 3.0999999999999999e143Initial program 100.0%
+-commutative100.0%
fma-define100.0%
sub-neg100.0%
metadata-eval100.0%
associate--l+100.0%
associate-+l+100.0%
Simplified100.0%
Taylor expanded in a around 0 100.0%
Taylor expanded in z around 0 96.6%
Final simplification94.4%
(FPCore (x y z t a b) :precision binary64 (let* ((t_1 (* z (log t))) (t_2 (+ z (* b (- a 0.5))))) (if (<= (+ x y) -4e-76) (- (+ x t_2) t_1) (- (+ y t_2) t_1))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = z * log(t);
double t_2 = z + (b * (a - 0.5));
double tmp;
if ((x + y) <= -4e-76) {
tmp = (x + t_2) - t_1;
} else {
tmp = (y + t_2) - 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) :: t_2
real(8) :: tmp
t_1 = z * log(t)
t_2 = z + (b * (a - 0.5d0))
if ((x + y) <= (-4d-76)) then
tmp = (x + t_2) - t_1
else
tmp = (y + t_2) - 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 = z * Math.log(t);
double t_2 = z + (b * (a - 0.5));
double tmp;
if ((x + y) <= -4e-76) {
tmp = (x + t_2) - t_1;
} else {
tmp = (y + t_2) - t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = z * math.log(t) t_2 = z + (b * (a - 0.5)) tmp = 0 if (x + y) <= -4e-76: tmp = (x + t_2) - t_1 else: tmp = (y + t_2) - t_1 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(z * log(t)) t_2 = Float64(z + Float64(b * Float64(a - 0.5))) tmp = 0.0 if (Float64(x + y) <= -4e-76) tmp = Float64(Float64(x + t_2) - t_1); else tmp = Float64(Float64(y + t_2) - t_1); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = z * log(t); t_2 = z + (b * (a - 0.5)); tmp = 0.0; if ((x + y) <= -4e-76) tmp = (x + t_2) - t_1; else tmp = (y + t_2) - t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(z * N[Log[t], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(z + N[(b * N[(a - 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(x + y), $MachinePrecision], -4e-76], N[(N[(x + t$95$2), $MachinePrecision] - t$95$1), $MachinePrecision], N[(N[(y + t$95$2), $MachinePrecision] - t$95$1), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := z \cdot \log t\\
t_2 := z + b \cdot \left(a - 0.5\right)\\
\mathbf{if}\;x + y \leq -4 \cdot 10^{-76}:\\
\;\;\;\;\left(x + t\_2\right) - t\_1\\
\mathbf{else}:\\
\;\;\;\;\left(y + t\_2\right) - t\_1\\
\end{array}
\end{array}
if (+.f64 x y) < -3.99999999999999971e-76Initial program 99.8%
+-commutative99.8%
fma-define99.8%
sub-neg99.8%
metadata-eval99.8%
associate--l+99.9%
associate-+l+99.9%
Simplified99.9%
Taylor expanded in y around 0 74.7%
if -3.99999999999999971e-76 < (+.f64 x y) Initial program 99.9%
+-commutative99.9%
fma-define99.9%
sub-neg99.9%
metadata-eval99.9%
associate--l+99.9%
associate-+l+99.9%
Simplified99.9%
Taylor expanded in x around 0 80.8%
(FPCore (x y z t a b) :precision binary64 (if (or (<= z -8.8e+108) (not (<= z 3.5e+153))) (+ (* z (- 1.0 (log t))) x) (+ x (+ y (+ (* -0.5 b) (* a b))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((z <= -8.8e+108) || !(z <= 3.5e+153)) {
tmp = (z * (1.0 - log(t))) + x;
} else {
tmp = x + (y + ((-0.5 * b) + (a * 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 ((z <= (-8.8d+108)) .or. (.not. (z <= 3.5d+153))) then
tmp = (z * (1.0d0 - log(t))) + x
else
tmp = x + (y + (((-0.5d0) * b) + (a * 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 ((z <= -8.8e+108) || !(z <= 3.5e+153)) {
tmp = (z * (1.0 - Math.log(t))) + x;
} else {
tmp = x + (y + ((-0.5 * b) + (a * b)));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (z <= -8.8e+108) or not (z <= 3.5e+153): tmp = (z * (1.0 - math.log(t))) + x else: tmp = x + (y + ((-0.5 * b) + (a * b))) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((z <= -8.8e+108) || !(z <= 3.5e+153)) tmp = Float64(Float64(z * Float64(1.0 - log(t))) + x); else tmp = Float64(x + Float64(y + Float64(Float64(-0.5 * b) + Float64(a * b)))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((z <= -8.8e+108) || ~((z <= 3.5e+153))) tmp = (z * (1.0 - log(t))) + x; else tmp = x + (y + ((-0.5 * b) + (a * b))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[z, -8.8e+108], N[Not[LessEqual[z, 3.5e+153]], $MachinePrecision]], N[(N[(z * N[(1.0 - N[Log[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + x), $MachinePrecision], N[(x + N[(y + N[(N[(-0.5 * b), $MachinePrecision] + N[(a * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -8.8 \cdot 10^{+108} \lor \neg \left(z \leq 3.5 \cdot 10^{+153}\right):\\
\;\;\;\;z \cdot \left(1 - \log t\right) + x\\
\mathbf{else}:\\
\;\;\;\;x + \left(y + \left(-0.5 \cdot b + a \cdot b\right)\right)\\
\end{array}
\end{array}
if z < -8.8000000000000005e108 or 3.4999999999999999e153 < z Initial program 99.6%
+-commutative99.6%
associate--l+99.7%
associate-+r+99.7%
+-commutative99.7%
*-lft-identity99.7%
metadata-eval99.7%
*-commutative99.7%
distribute-rgt-out--99.7%
metadata-eval99.7%
fma-define99.7%
sub-neg99.7%
metadata-eval99.7%
Simplified99.7%
Taylor expanded in x around inf 73.7%
if -8.8000000000000005e108 < z < 3.4999999999999999e153Initial program 100.0%
+-commutative100.0%
fma-define100.0%
sub-neg100.0%
metadata-eval100.0%
associate--l+100.0%
associate-+l+100.0%
Simplified100.0%
Taylor expanded in a around 0 100.0%
Taylor expanded in z around 0 95.2%
Final simplification89.0%
(FPCore (x y z t a b) :precision binary64 (- (+ x (+ y (+ z (+ (* -0.5 b) (* a b))))) (* z (log t))))
double code(double x, double y, double z, double t, double a, double b) {
return (x + (y + (z + ((-0.5 * b) + (a * b))))) - (z * log(t));
}
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 + (((-0.5d0) * b) + (a * b))))) - (z * log(t))
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return (x + (y + (z + ((-0.5 * b) + (a * b))))) - (z * Math.log(t));
}
def code(x, y, z, t, a, b): return (x + (y + (z + ((-0.5 * b) + (a * b))))) - (z * math.log(t))
function code(x, y, z, t, a, b) return Float64(Float64(x + Float64(y + Float64(z + Float64(Float64(-0.5 * b) + Float64(a * b))))) - Float64(z * log(t))) end
function tmp = code(x, y, z, t, a, b) tmp = (x + (y + (z + ((-0.5 * b) + (a * b))))) - (z * log(t)); end
code[x_, y_, z_, t_, a_, b_] := N[(N[(x + N[(y + N[(z + N[(N[(-0.5 * b), $MachinePrecision] + N[(a * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(z * N[Log[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(x + \left(y + \left(z + \left(-0.5 \cdot b + a \cdot b\right)\right)\right)\right) - z \cdot \log t
\end{array}
Initial program 99.9%
+-commutative99.9%
fma-define99.9%
sub-neg99.9%
metadata-eval99.9%
associate--l+99.9%
associate-+l+99.9%
Simplified99.9%
Taylor expanded in a around 0 99.9%
(FPCore (x y z t a b) :precision binary64 (if (or (<= z -3e+252) (not (<= z 1.2e+181))) (* z (- 1.0 (log t))) (+ x (+ y (+ (* -0.5 b) (* a b))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((z <= -3e+252) || !(z <= 1.2e+181)) {
tmp = z * (1.0 - log(t));
} else {
tmp = x + (y + ((-0.5 * b) + (a * 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 ((z <= (-3d+252)) .or. (.not. (z <= 1.2d+181))) then
tmp = z * (1.0d0 - log(t))
else
tmp = x + (y + (((-0.5d0) * b) + (a * 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 ((z <= -3e+252) || !(z <= 1.2e+181)) {
tmp = z * (1.0 - Math.log(t));
} else {
tmp = x + (y + ((-0.5 * b) + (a * b)));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (z <= -3e+252) or not (z <= 1.2e+181): tmp = z * (1.0 - math.log(t)) else: tmp = x + (y + ((-0.5 * b) + (a * b))) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((z <= -3e+252) || !(z <= 1.2e+181)) tmp = Float64(z * Float64(1.0 - log(t))); else tmp = Float64(x + Float64(y + Float64(Float64(-0.5 * b) + Float64(a * b)))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((z <= -3e+252) || ~((z <= 1.2e+181))) tmp = z * (1.0 - log(t)); else tmp = x + (y + ((-0.5 * b) + (a * b))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[z, -3e+252], N[Not[LessEqual[z, 1.2e+181]], $MachinePrecision]], N[(z * N[(1.0 - N[Log[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(y + N[(N[(-0.5 * b), $MachinePrecision] + N[(a * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -3 \cdot 10^{+252} \lor \neg \left(z \leq 1.2 \cdot 10^{+181}\right):\\
\;\;\;\;z \cdot \left(1 - \log t\right)\\
\mathbf{else}:\\
\;\;\;\;x + \left(y + \left(-0.5 \cdot b + a \cdot b\right)\right)\\
\end{array}
\end{array}
if z < -2.99999999999999989e252 or 1.20000000000000001e181 < z Initial program 99.6%
+-commutative99.6%
associate--l+99.7%
associate-+r+99.7%
+-commutative99.7%
*-lft-identity99.7%
metadata-eval99.7%
*-commutative99.7%
distribute-rgt-out--99.7%
metadata-eval99.7%
fma-define99.7%
sub-neg99.7%
metadata-eval99.7%
Simplified99.7%
Taylor expanded in x around inf 82.2%
Taylor expanded in z around inf 70.2%
if -2.99999999999999989e252 < z < 1.20000000000000001e181Initial program 99.9%
+-commutative99.9%
fma-define99.9%
sub-neg99.9%
metadata-eval99.9%
associate--l+99.9%
associate-+l+99.9%
Simplified99.9%
Taylor expanded in a around 0 99.9%
Taylor expanded in z around 0 88.4%
Final simplification86.0%
(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 (<= (- a 0.5) -1000000.0) (not (<= (- a 0.5) -0.5))) (+ x (+ y (* a b))) (+ x (+ y (* -0.5 b)))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (((a - 0.5) <= -1000000.0) || !((a - 0.5) <= -0.5)) {
tmp = x + (y + (a * b));
} 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) :: tmp
if (((a - 0.5d0) <= (-1000000.0d0)) .or. (.not. ((a - 0.5d0) <= (-0.5d0)))) then
tmp = x + (y + (a * b))
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 tmp;
if (((a - 0.5) <= -1000000.0) || !((a - 0.5) <= -0.5)) {
tmp = x + (y + (a * b));
} else {
tmp = x + (y + (-0.5 * b));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if ((a - 0.5) <= -1000000.0) or not ((a - 0.5) <= -0.5): tmp = x + (y + (a * b)) else: tmp = x + (y + (-0.5 * b)) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((Float64(a - 0.5) <= -1000000.0) || !(Float64(a - 0.5) <= -0.5)) tmp = Float64(x + Float64(y + Float64(a * b))); else tmp = Float64(x + Float64(y + Float64(-0.5 * b))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (((a - 0.5) <= -1000000.0) || ~(((a - 0.5) <= -0.5))) tmp = x + (y + (a * b)); else tmp = x + (y + (-0.5 * b)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[N[(a - 0.5), $MachinePrecision], -1000000.0], N[Not[LessEqual[N[(a - 0.5), $MachinePrecision], -0.5]], $MachinePrecision]], N[(x + N[(y + N[(a * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(y + N[(-0.5 * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a - 0.5 \leq -1000000 \lor \neg \left(a - 0.5 \leq -0.5\right):\\
\;\;\;\;x + \left(y + a \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;x + \left(y + -0.5 \cdot b\right)\\
\end{array}
\end{array}
if (-.f64 a #s(literal 1/2 binary64)) < -1e6 or -0.5 < (-.f64 a #s(literal 1/2 binary64)) Initial program 99.9%
+-commutative99.9%
fma-define99.9%
sub-neg99.9%
metadata-eval99.9%
associate--l+99.9%
associate-+l+99.9%
Simplified99.9%
Taylor expanded in a around 0 99.9%
Taylor expanded in z around 0 83.8%
Taylor expanded in a around inf 83.2%
*-commutative99.3%
Simplified83.2%
if -1e6 < (-.f64 a #s(literal 1/2 binary64)) < -0.5Initial program 99.8%
+-commutative99.8%
fma-define99.8%
sub-neg99.8%
metadata-eval99.8%
associate--l+99.8%
associate-+l+99.8%
Simplified99.8%
Taylor expanded in a around 0 99.8%
Taylor expanded in z around 0 74.5%
Taylor expanded in a around 0 74.0%
*-commutative74.0%
Simplified74.0%
Final simplification79.1%
(FPCore (x y z t a b) :precision binary64 (if (or (<= (- a 0.5) -0.500005) (not (<= (- a 0.5) 5e+73))) (+ x (* (+ a -0.5) b)) (+ x (+ y (* -0.5 b)))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (((a - 0.5) <= -0.500005) || !((a - 0.5) <= 5e+73)) {
tmp = x + ((a + -0.5) * b);
} 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) :: tmp
if (((a - 0.5d0) <= (-0.500005d0)) .or. (.not. ((a - 0.5d0) <= 5d+73))) then
tmp = x + ((a + (-0.5d0)) * b)
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 tmp;
if (((a - 0.5) <= -0.500005) || !((a - 0.5) <= 5e+73)) {
tmp = x + ((a + -0.5) * b);
} else {
tmp = x + (y + (-0.5 * b));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if ((a - 0.5) <= -0.500005) or not ((a - 0.5) <= 5e+73): tmp = x + ((a + -0.5) * b) else: tmp = x + (y + (-0.5 * b)) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((Float64(a - 0.5) <= -0.500005) || !(Float64(a - 0.5) <= 5e+73)) tmp = Float64(x + Float64(Float64(a + -0.5) * b)); else tmp = Float64(x + Float64(y + Float64(-0.5 * b))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (((a - 0.5) <= -0.500005) || ~(((a - 0.5) <= 5e+73))) tmp = x + ((a + -0.5) * b); else tmp = x + (y + (-0.5 * b)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[N[(a - 0.5), $MachinePrecision], -0.500005], N[Not[LessEqual[N[(a - 0.5), $MachinePrecision], 5e+73]], $MachinePrecision]], N[(x + N[(N[(a + -0.5), $MachinePrecision] * b), $MachinePrecision]), $MachinePrecision], N[(x + N[(y + N[(-0.5 * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a - 0.5 \leq -0.500005 \lor \neg \left(a - 0.5 \leq 5 \cdot 10^{+73}\right):\\
\;\;\;\;x + \left(a + -0.5\right) \cdot b\\
\mathbf{else}:\\
\;\;\;\;x + \left(y + -0.5 \cdot b\right)\\
\end{array}
\end{array}
if (-.f64 a #s(literal 1/2 binary64)) < -0.50000500000000003 or 4.99999999999999976e73 < (-.f64 a #s(literal 1/2 binary64)) Initial program 99.9%
+-commutative99.9%
fma-define99.9%
sub-neg99.9%
metadata-eval99.9%
associate--l+99.9%
associate-+l+99.9%
Simplified99.9%
Taylor expanded in a around 0 99.9%
Taylor expanded in z around 0 85.6%
Taylor expanded in y around 0 73.1%
+-commutative73.1%
distribute-rgt-in73.1%
Simplified73.1%
if -0.50000500000000003 < (-.f64 a #s(literal 1/2 binary64)) < 4.99999999999999976e73Initial program 99.9%
+-commutative99.9%
fma-define99.9%
sub-neg99.9%
metadata-eval99.9%
associate--l+99.8%
associate-+l+99.8%
Simplified99.8%
Taylor expanded in a around 0 99.9%
Taylor expanded in z around 0 73.9%
Taylor expanded in a around 0 71.6%
*-commutative71.6%
Simplified71.6%
Final simplification72.4%
(FPCore (x y z t a b) :precision binary64 (if (or (<= b -2.45e+14) (not (<= b 9e+88))) (* b (- a 0.5)) (+ x y)))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((b <= -2.45e+14) || !(b <= 9e+88)) {
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 ((b <= (-2.45d+14)) .or. (.not. (b <= 9d+88))) 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 ((b <= -2.45e+14) || !(b <= 9e+88)) {
tmp = b * (a - 0.5);
} else {
tmp = x + y;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (b <= -2.45e+14) or not (b <= 9e+88): tmp = b * (a - 0.5) else: tmp = x + y return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((b <= -2.45e+14) || !(b <= 9e+88)) 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 ((b <= -2.45e+14) || ~((b <= 9e+88))) tmp = b * (a - 0.5); else tmp = x + y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[b, -2.45e+14], N[Not[LessEqual[b, 9e+88]], $MachinePrecision]], N[(b * N[(a - 0.5), $MachinePrecision]), $MachinePrecision], N[(x + y), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq -2.45 \cdot 10^{+14} \lor \neg \left(b \leq 9 \cdot 10^{+88}\right):\\
\;\;\;\;b \cdot \left(a - 0.5\right)\\
\mathbf{else}:\\
\;\;\;\;x + y\\
\end{array}
\end{array}
if b < -2.45e14 or 9e88 < b Initial program 99.9%
+-commutative99.9%
fma-define99.9%
sub-neg99.9%
metadata-eval99.9%
associate--l+99.9%
associate-+l+99.9%
Simplified99.9%
Taylor expanded in a around 0 99.9%
Taylor expanded in z around 0 91.3%
Taylor expanded in b around inf 73.1%
if -2.45e14 < b < 9e88Initial program 99.8%
+-commutative99.8%
fma-define99.8%
sub-neg99.8%
metadata-eval99.8%
associate--l+99.8%
associate-+l+99.8%
Simplified99.8%
Taylor expanded in a around 0 99.8%
Taylor expanded in z around 0 70.8%
Taylor expanded in b around 0 54.9%
+-commutative54.9%
Simplified54.9%
Final simplification62.7%
(FPCore (x y z t a b) :precision binary64 (if (or (<= a -1.15e+66) (not (<= a 8.5e+77))) (* a b) (+ x y)))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((a <= -1.15e+66) || !(a <= 8.5e+77)) {
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 ((a <= (-1.15d+66)) .or. (.not. (a <= 8.5d+77))) 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 ((a <= -1.15e+66) || !(a <= 8.5e+77)) {
tmp = a * b;
} else {
tmp = x + y;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (a <= -1.15e+66) or not (a <= 8.5e+77): tmp = a * b else: tmp = x + y return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((a <= -1.15e+66) || !(a <= 8.5e+77)) 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 ((a <= -1.15e+66) || ~((a <= 8.5e+77))) tmp = a * b; else tmp = x + y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[a, -1.15e+66], N[Not[LessEqual[a, 8.5e+77]], $MachinePrecision]], N[(a * b), $MachinePrecision], N[(x + y), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -1.15 \cdot 10^{+66} \lor \neg \left(a \leq 8.5 \cdot 10^{+77}\right):\\
\;\;\;\;a \cdot b\\
\mathbf{else}:\\
\;\;\;\;x + y\\
\end{array}
\end{array}
if a < -1.15e66 or 8.50000000000000018e77 < a Initial program 99.9%
+-commutative99.9%
associate--l+99.9%
associate-+r+99.9%
+-commutative99.9%
*-lft-identity99.9%
metadata-eval99.9%
*-commutative99.9%
distribute-rgt-out--100.0%
metadata-eval100.0%
fma-define100.0%
sub-neg100.0%
metadata-eval100.0%
Simplified100.0%
Taylor expanded in b around inf 76.9%
associate--l+76.9%
associate-/l*76.9%
Simplified76.9%
clear-num76.9%
inv-pow76.9%
Applied egg-rr76.9%
unpow-176.9%
Simplified76.9%
Taylor expanded in a around inf 64.2%
*-commutative64.2%
Simplified64.2%
if -1.15e66 < a < 8.50000000000000018e77Initial program 99.8%
+-commutative99.8%
fma-define99.8%
sub-neg99.8%
metadata-eval99.8%
associate--l+99.8%
associate-+l+99.8%
Simplified99.8%
Taylor expanded in a around 0 99.9%
Taylor expanded in z around 0 75.0%
Taylor expanded in b around 0 51.2%
+-commutative51.2%
Simplified51.2%
Final simplification56.4%
(FPCore (x y z t a b) :precision binary64 (if (<= x -3.6e+146) x (if (<= x 9.2e-206) (* a b) y)))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (x <= -3.6e+146) {
tmp = x;
} else if (x <= 9.2e-206) {
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 <= (-3.6d+146)) then
tmp = x
else if (x <= 9.2d-206) 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 <= -3.6e+146) {
tmp = x;
} else if (x <= 9.2e-206) {
tmp = a * b;
} else {
tmp = y;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if x <= -3.6e+146: tmp = x elif x <= 9.2e-206: tmp = a * b else: tmp = y return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (x <= -3.6e+146) tmp = x; elseif (x <= 9.2e-206) 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 <= -3.6e+146) tmp = x; elseif (x <= 9.2e-206) tmp = a * b; else tmp = y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[x, -3.6e+146], x, If[LessEqual[x, 9.2e-206], N[(a * b), $MachinePrecision], y]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -3.6 \cdot 10^{+146}:\\
\;\;\;\;x\\
\mathbf{elif}\;x \leq 9.2 \cdot 10^{-206}:\\
\;\;\;\;a \cdot b\\
\mathbf{else}:\\
\;\;\;\;y\\
\end{array}
\end{array}
if x < -3.5999999999999998e146Initial program 99.9%
+-commutative99.9%
associate--l+100.0%
associate-+r+100.0%
+-commutative100.0%
*-lft-identity100.0%
metadata-eval100.0%
*-commutative100.0%
distribute-rgt-out--100.0%
metadata-eval100.0%
fma-define100.0%
sub-neg100.0%
metadata-eval100.0%
Simplified100.0%
Taylor expanded in x around inf 69.5%
Taylor expanded in z around 0 59.4%
if -3.5999999999999998e146 < x < 9.2e-206Initial program 99.8%
+-commutative99.8%
associate--l+99.8%
associate-+r+99.8%
+-commutative99.8%
*-lft-identity99.8%
metadata-eval99.8%
*-commutative99.8%
distribute-rgt-out--99.9%
metadata-eval99.9%
fma-define99.9%
sub-neg99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in b around inf 85.0%
associate--l+85.0%
associate-/l*85.0%
Simplified85.0%
clear-num85.0%
inv-pow85.0%
Applied egg-rr85.0%
unpow-185.0%
Simplified85.0%
Taylor expanded in a around inf 39.1%
*-commutative39.1%
Simplified39.1%
if 9.2e-206 < x Initial program 99.9%
+-commutative99.9%
associate--l+99.9%
associate-+r+99.9%
+-commutative99.9%
*-lft-identity99.9%
metadata-eval99.9%
*-commutative99.9%
distribute-rgt-out--99.9%
metadata-eval99.9%
fma-define99.9%
sub-neg99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in b around inf 72.3%
associate--l+72.3%
associate-/l*72.3%
Simplified72.3%
clear-num72.2%
inv-pow72.2%
Applied egg-rr72.2%
unpow-172.2%
Simplified72.2%
Taylor expanded in y around inf 22.0%
Final simplification35.2%
(FPCore (x y z t a b) :precision binary64 (if (<= y 1.05e+141) (+ x (* (+ a -0.5) b)) (+ x y)))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (y <= 1.05e+141) {
tmp = x + ((a + -0.5) * 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 (y <= 1.05d+141) then
tmp = x + ((a + (-0.5d0)) * 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 (y <= 1.05e+141) {
tmp = x + ((a + -0.5) * b);
} else {
tmp = x + y;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if y <= 1.05e+141: tmp = x + ((a + -0.5) * b) else: tmp = x + y return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (y <= 1.05e+141) tmp = Float64(x + Float64(Float64(a + -0.5) * b)); else tmp = Float64(x + y); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (y <= 1.05e+141) tmp = x + ((a + -0.5) * b); else tmp = x + y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[y, 1.05e+141], N[(x + N[(N[(a + -0.5), $MachinePrecision] * b), $MachinePrecision]), $MachinePrecision], N[(x + y), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq 1.05 \cdot 10^{+141}:\\
\;\;\;\;x + \left(a + -0.5\right) \cdot b\\
\mathbf{else}:\\
\;\;\;\;x + y\\
\end{array}
\end{array}
if y < 1.0499999999999999e141Initial program 99.9%
+-commutative99.9%
fma-define99.9%
sub-neg99.9%
metadata-eval99.9%
associate--l+99.9%
associate-+l+99.9%
Simplified99.9%
Taylor expanded in a around 0 99.9%
Taylor expanded in z around 0 79.4%
Taylor expanded in y around 0 63.3%
+-commutative63.3%
distribute-rgt-in63.3%
Simplified63.3%
if 1.0499999999999999e141 < y Initial program 99.8%
+-commutative99.8%
fma-define99.8%
sub-neg99.8%
metadata-eval99.8%
associate--l+99.9%
associate-+l+99.9%
Simplified99.9%
Taylor expanded in a around 0 99.8%
Taylor expanded in z around 0 81.2%
Taylor expanded in b around 0 43.8%
+-commutative43.8%
Simplified43.8%
Final simplification60.9%
(FPCore (x y z t a b) :precision binary64 (+ x (+ y (+ (* -0.5 b) (* a b)))))
double code(double x, double y, double z, double t, double a, double b) {
return x + (y + ((-0.5 * b) + (a * 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 + (((-0.5d0) * b) + (a * b)))
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return x + (y + ((-0.5 * b) + (a * b)));
}
def code(x, y, z, t, a, b): return x + (y + ((-0.5 * b) + (a * b)))
function code(x, y, z, t, a, b) return Float64(x + Float64(y + Float64(Float64(-0.5 * b) + Float64(a * b)))) end
function tmp = code(x, y, z, t, a, b) tmp = x + (y + ((-0.5 * b) + (a * b))); end
code[x_, y_, z_, t_, a_, b_] := N[(x + N[(y + N[(N[(-0.5 * b), $MachinePrecision] + N[(a * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \left(y + \left(-0.5 \cdot b + a \cdot b\right)\right)
\end{array}
Initial program 99.9%
+-commutative99.9%
fma-define99.9%
sub-neg99.9%
metadata-eval99.9%
associate--l+99.9%
associate-+l+99.9%
Simplified99.9%
Taylor expanded in a around 0 99.9%
Taylor expanded in z around 0 79.6%
(FPCore (x y z t a b) :precision binary64 (+ (* b (- a 0.5)) (+ x y)))
double code(double x, double y, double z, double t, double a, double b) {
return (b * (a - 0.5)) + (x + y);
}
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)
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);
}
def code(x, y, z, t, a, b): return (b * (a - 0.5)) + (x + y)
function code(x, y, z, t, a, b) return Float64(Float64(b * Float64(a - 0.5)) + Float64(x + y)) end
function tmp = code(x, y, z, t, a, b) tmp = (b * (a - 0.5)) + (x + y); end
code[x_, y_, z_, t_, a_, b_] := N[(N[(b * N[(a - 0.5), $MachinePrecision]), $MachinePrecision] + N[(x + y), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
b \cdot \left(a - 0.5\right) + \left(x + y\right)
\end{array}
Initial program 99.9%
add-exp-log46.8%
Applied egg-rr46.8%
Taylor expanded in z around 0 79.6%
Final simplification79.6%
(FPCore (x y z t a b) :precision binary64 (if (<= x -1e-22) x y))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (x <= -1e-22) {
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 (x <= (-1d-22)) 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 (x <= -1e-22) {
tmp = x;
} else {
tmp = y;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if x <= -1e-22: tmp = x else: tmp = y return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (x <= -1e-22) tmp = x; else tmp = y; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (x <= -1e-22) tmp = x; else tmp = y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[x, -1e-22], x, y]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1 \cdot 10^{-22}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;y\\
\end{array}
\end{array}
if x < -1e-22Initial program 99.9%
+-commutative99.9%
associate--l+99.9%
associate-+r+99.9%
+-commutative99.9%
*-lft-identity99.9%
metadata-eval99.9%
*-commutative99.9%
distribute-rgt-out--100.0%
metadata-eval100.0%
fma-define100.0%
sub-neg100.0%
metadata-eval100.0%
Simplified100.0%
Taylor expanded in x around inf 54.3%
Taylor expanded in z around 0 42.8%
if -1e-22 < x Initial program 99.9%
+-commutative99.9%
associate--l+99.8%
associate-+r+99.8%
+-commutative99.8%
*-lft-identity99.8%
metadata-eval99.8%
*-commutative99.8%
distribute-rgt-out--99.9%
metadata-eval99.9%
fma-define99.9%
sub-neg99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in b around inf 78.6%
associate--l+78.6%
associate-/l*78.6%
Simplified78.6%
clear-num78.5%
inv-pow78.5%
Applied egg-rr78.5%
unpow-178.5%
Simplified78.5%
Taylor expanded in y around inf 21.2%
(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%
+-commutative99.9%
associate--l+99.9%
associate-+r+99.9%
+-commutative99.9%
*-lft-identity99.9%
metadata-eval99.9%
*-commutative99.9%
distribute-rgt-out--99.9%
metadata-eval99.9%
fma-define99.9%
sub-neg99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in x around inf 43.0%
Taylor expanded in z around 0 23.2%
(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 2024186
(FPCore (x y z t a b)
:name "Numeric.SpecFunctions:logBeta from math-functions-0.1.5.2, A"
:precision binary64
:alt
(! :herbie-platform default (+ (+ (+ x y) (/ (* (- 1 (pow (log t) 2)) z) (+ 1 (log t)))) (* (- a 1/2) b)))
(+ (- (+ (+ x y) z) (* z (log t))) (* (- a 0.5) b)))