
(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 18 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.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-def99.9%
sub-neg99.9%
metadata-eval99.9%
Simplified99.9%
Final simplification99.9%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* b (- a 0.5))) (t_2 (* z (- 1.0 (log t)))) (t_3 (+ t_2 t_1)))
(if (<= t_1 -5e+108)
t_3
(if (<= t_1 -1e+21)
(+ (+ x y) t_1)
(if (<= t_1 -2e-10)
t_3
(if (<= t_1 5e+136) (+ x (+ t_2 y)) (+ x (fma b (+ a -0.5) y))))))))
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 t_3 = t_2 + t_1;
double tmp;
if (t_1 <= -5e+108) {
tmp = t_3;
} else if (t_1 <= -1e+21) {
tmp = (x + y) + t_1;
} else if (t_1 <= -2e-10) {
tmp = t_3;
} else if (t_1 <= 5e+136) {
tmp = x + (t_2 + y);
} else {
tmp = x + fma(b, (a + -0.5), y);
}
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))) t_3 = Float64(t_2 + t_1) tmp = 0.0 if (t_1 <= -5e+108) tmp = t_3; elseif (t_1 <= -1e+21) tmp = Float64(Float64(x + y) + t_1); elseif (t_1 <= -2e-10) tmp = t_3; elseif (t_1 <= 5e+136) tmp = Float64(x + Float64(t_2 + y)); else tmp = Float64(x + fma(b, Float64(a + -0.5), y)); end return 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]}, Block[{t$95$3 = N[(t$95$2 + t$95$1), $MachinePrecision]}, If[LessEqual[t$95$1, -5e+108], t$95$3, If[LessEqual[t$95$1, -1e+21], N[(N[(x + y), $MachinePrecision] + t$95$1), $MachinePrecision], If[LessEqual[t$95$1, -2e-10], t$95$3, If[LessEqual[t$95$1, 5e+136], N[(x + N[(t$95$2 + y), $MachinePrecision]), $MachinePrecision], N[(x + N[(b * N[(a + -0.5), $MachinePrecision] + y), $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)\\
t_3 := t_2 + t_1\\
\mathbf{if}\;t_1 \leq -5 \cdot 10^{+108}:\\
\;\;\;\;t_3\\
\mathbf{elif}\;t_1 \leq -1 \cdot 10^{+21}:\\
\;\;\;\;\left(x + y\right) + t_1\\
\mathbf{elif}\;t_1 \leq -2 \cdot 10^{-10}:\\
\;\;\;\;t_3\\
\mathbf{elif}\;t_1 \leq 5 \cdot 10^{+136}:\\
\;\;\;\;x + \left(t_2 + y\right)\\
\mathbf{else}:\\
\;\;\;\;x + \mathsf{fma}\left(b, a + -0.5, y\right)\\
\end{array}
\end{array}
if (*.f64 (-.f64 a 1/2) b) < -4.99999999999999991e108 or -1e21 < (*.f64 (-.f64 a 1/2) b) < -2.00000000000000007e-10Initial program 99.8%
add-exp-log45.7%
sub-neg45.7%
associate-+l+45.7%
sub-neg45.7%
*-un-lft-identity45.7%
*-commutative45.7%
distribute-rgt-out--45.7%
+-commutative45.7%
Applied egg-rr45.7%
Taylor expanded in z around inf 94.9%
if -4.99999999999999991e108 < (*.f64 (-.f64 a 1/2) b) < -1e21Initial program 99.9%
Taylor expanded in z around 0 94.2%
if -2.00000000000000007e-10 < (*.f64 (-.f64 a 1/2) b) < 5.0000000000000002e136Initial 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.8%
metadata-eval99.8%
fma-def99.8%
sub-neg99.8%
metadata-eval99.8%
Simplified99.8%
Taylor expanded in b around 0 90.8%
if 5.0000000000000002e136 < (*.f64 (-.f64 a 1/2) b) Initial program 100.0%
+-commutative100.0%
associate--l+100.0%
associate-+r+100.0%
+-commutative100.0%
*-lft-identity100.0%
metadata-eval100.0%
*-commutative100.0%
distribute-rgt-out--99.9%
metadata-eval99.9%
fma-def100.0%
sub-neg100.0%
metadata-eval100.0%
Simplified100.0%
Taylor expanded in z around 0 96.1%
+-commutative96.1%
sub-neg96.1%
metadata-eval96.1%
fma-def96.1%
Simplified96.1%
Final simplification93.0%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* b (- a 0.5))))
(if (or (<= t_1 -5e+16) (not (<= t_1 5e+136)))
(+ x (fma b (+ a -0.5) 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 <= -5e+16) || !(t_1 <= 5e+136)) {
tmp = x + fma(b, (a + -0.5), y);
} else {
tmp = x + ((z * (1.0 - 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 <= -5e+16) || !(t_1 <= 5e+136)) tmp = Float64(x + fma(b, Float64(a + -0.5), y)); else tmp = Float64(x + Float64(Float64(z * Float64(1.0 - log(t))) + y)); end return 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, -5e+16], N[Not[LessEqual[t$95$1, 5e+136]], $MachinePrecision]], N[(x + N[(b * N[(a + -0.5), $MachinePrecision] + 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 -5 \cdot 10^{+16} \lor \neg \left(t_1 \leq 5 \cdot 10^{+136}\right):\\
\;\;\;\;x + \mathsf{fma}\left(b, a + -0.5, y\right)\\
\mathbf{else}:\\
\;\;\;\;x + \left(z \cdot \left(1 - \log t\right) + y\right)\\
\end{array}
\end{array}
if (*.f64 (-.f64 a 1/2) b) < -5e16 or 5.0000000000000002e136 < (*.f64 (-.f64 a 1/2) b) 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-def99.9%
sub-neg99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in z around 0 90.1%
+-commutative90.1%
sub-neg90.1%
metadata-eval90.1%
fma-def90.1%
Simplified90.1%
if -5e16 < (*.f64 (-.f64 a 1/2) b) < 5.0000000000000002e136Initial 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.8%
metadata-eval99.8%
fma-def99.8%
sub-neg99.8%
metadata-eval99.8%
Simplified99.8%
Taylor expanded in b around 0 91.0%
Final simplification90.6%
(FPCore (x y z t a b) :precision binary64 (let* ((t_1 (* b (- a 0.5)))) (if (<= (+ x y) -1e+50) (+ (+ x y) t_1) (+ t_1 (- (+ z y) (* z (log t)))))))
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) <= -1e+50) {
tmp = (x + y) + t_1;
} else {
tmp = t_1 + ((z + y) - (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) :: tmp
t_1 = b * (a - 0.5d0)
if ((x + y) <= (-1d+50)) then
tmp = (x + y) + t_1
else
tmp = t_1 + ((z + y) - (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 = b * (a - 0.5);
double tmp;
if ((x + y) <= -1e+50) {
tmp = (x + y) + t_1;
} else {
tmp = t_1 + ((z + y) - (z * Math.log(t)));
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = b * (a - 0.5) tmp = 0 if (x + y) <= -1e+50: tmp = (x + y) + t_1 else: tmp = t_1 + ((z + y) - (z * math.log(t))) 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) <= -1e+50) tmp = Float64(Float64(x + y) + t_1); else tmp = Float64(t_1 + Float64(Float64(z + y) - Float64(z * log(t)))); 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) <= -1e+50) tmp = (x + y) + t_1; else tmp = t_1 + ((z + y) - (z * log(t))); 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], -1e+50], N[(N[(x + y), $MachinePrecision] + t$95$1), $MachinePrecision], N[(t$95$1 + N[(N[(z + y), $MachinePrecision] - N[(z * N[Log[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := b \cdot \left(a - 0.5\right)\\
\mathbf{if}\;x + y \leq -1 \cdot 10^{+50}:\\
\;\;\;\;\left(x + y\right) + t_1\\
\mathbf{else}:\\
\;\;\;\;t_1 + \left(\left(z + y\right) - z \cdot \log t\right)\\
\end{array}
\end{array}
if (+.f64 x y) < -1.0000000000000001e50Initial program 99.9%
Taylor expanded in z around 0 92.3%
if -1.0000000000000001e50 < (+.f64 x y) Initial program 99.8%
Taylor expanded in x around 0 87.1%
+-commutative87.1%
Simplified87.1%
Final simplification88.8%
(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.8%
Final simplification99.8%
(FPCore (x y z t a b) :precision binary64 (if (or (<= z -2.7e+150) (not (<= z 2.4e+207))) (+ x (- z (* z (log t)))) (+ (+ x y) (* b (- a 0.5)))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((z <= -2.7e+150) || !(z <= 2.4e+207)) {
tmp = x + (z - (z * log(t)));
} else {
tmp = (x + 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 ((z <= (-2.7d+150)) .or. (.not. (z <= 2.4d+207))) then
tmp = x + (z - (z * log(t)))
else
tmp = (x + 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 ((z <= -2.7e+150) || !(z <= 2.4e+207)) {
tmp = x + (z - (z * Math.log(t)));
} else {
tmp = (x + y) + (b * (a - 0.5));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (z <= -2.7e+150) or not (z <= 2.4e+207): tmp = x + (z - (z * math.log(t))) else: tmp = (x + y) + (b * (a - 0.5)) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((z <= -2.7e+150) || !(z <= 2.4e+207)) tmp = Float64(x + Float64(z - Float64(z * log(t)))); else tmp = Float64(Float64(x + 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 ((z <= -2.7e+150) || ~((z <= 2.4e+207))) tmp = x + (z - (z * log(t))); else tmp = (x + y) + (b * (a - 0.5)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[z, -2.7e+150], N[Not[LessEqual[z, 2.4e+207]], $MachinePrecision]], N[(x + N[(z - N[(z * N[Log[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x + y), $MachinePrecision] + N[(b * N[(a - 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.7 \cdot 10^{+150} \lor \neg \left(z \leq 2.4 \cdot 10^{+207}\right):\\
\;\;\;\;x + \left(z - z \cdot \log t\right)\\
\mathbf{else}:\\
\;\;\;\;\left(x + y\right) + b \cdot \left(a - 0.5\right)\\
\end{array}
\end{array}
if z < -2.70000000000000008e150 or 2.4000000000000001e207 < z Initial program 99.6%
+-commutative99.6%
associate--l+99.6%
associate-+r+99.6%
+-commutative99.6%
*-lft-identity99.6%
metadata-eval99.6%
*-commutative99.6%
distribute-rgt-out--99.7%
metadata-eval99.7%
fma-def99.7%
sub-neg99.7%
metadata-eval99.7%
Simplified99.7%
Taylor expanded in b around 0 85.8%
distribute-rgt-out--85.7%
*-commutative85.7%
*-un-lft-identity85.7%
Applied egg-rr85.7%
Taylor expanded in y around 0 76.9%
if -2.70000000000000008e150 < z < 2.4000000000000001e207Initial program 99.9%
Taylor expanded in z around 0 88.9%
Final simplification85.9%
(FPCore (x y z t a b) :precision binary64 (if (or (<= z -4.1e+154) (not (<= z 1.1e+207))) (+ x (- z (* z (log t)))) (+ x (fma b (+ a -0.5) y))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((z <= -4.1e+154) || !(z <= 1.1e+207)) {
tmp = x + (z - (z * log(t)));
} else {
tmp = x + fma(b, (a + -0.5), y);
}
return tmp;
}
function code(x, y, z, t, a, b) tmp = 0.0 if ((z <= -4.1e+154) || !(z <= 1.1e+207)) tmp = Float64(x + Float64(z - Float64(z * log(t)))); else tmp = Float64(x + fma(b, Float64(a + -0.5), y)); end return tmp end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[z, -4.1e+154], N[Not[LessEqual[z, 1.1e+207]], $MachinePrecision]], N[(x + N[(z - N[(z * N[Log[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(b * N[(a + -0.5), $MachinePrecision] + y), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -4.1 \cdot 10^{+154} \lor \neg \left(z \leq 1.1 \cdot 10^{+207}\right):\\
\;\;\;\;x + \left(z - z \cdot \log t\right)\\
\mathbf{else}:\\
\;\;\;\;x + \mathsf{fma}\left(b, a + -0.5, y\right)\\
\end{array}
\end{array}
if z < -4.1e154 or 1.10000000000000004e207 < z Initial program 99.6%
+-commutative99.6%
associate--l+99.6%
associate-+r+99.6%
+-commutative99.6%
*-lft-identity99.6%
metadata-eval99.6%
*-commutative99.6%
distribute-rgt-out--99.7%
metadata-eval99.7%
fma-def99.7%
sub-neg99.7%
metadata-eval99.7%
Simplified99.7%
Taylor expanded in b around 0 85.8%
distribute-rgt-out--85.7%
*-commutative85.7%
*-un-lft-identity85.7%
Applied egg-rr85.7%
Taylor expanded in y around 0 76.9%
if -4.1e154 < z < 1.10000000000000004e207Initial 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-def99.9%
sub-neg99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in z around 0 88.9%
+-commutative88.9%
sub-neg88.9%
metadata-eval88.9%
fma-def88.9%
Simplified88.9%
Final simplification85.9%
(FPCore (x y z t a b) :precision binary64 (if (<= z -4.4e+151) (+ (* z (- 1.0 (log t))) x) (if (<= z 8.2e+206) (+ x (fma b (+ a -0.5) y)) (+ x (- z (* z (log t)))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (z <= -4.4e+151) {
tmp = (z * (1.0 - log(t))) + x;
} else if (z <= 8.2e+206) {
tmp = x + fma(b, (a + -0.5), y);
} else {
tmp = x + (z - (z * log(t)));
}
return tmp;
}
function code(x, y, z, t, a, b) tmp = 0.0 if (z <= -4.4e+151) tmp = Float64(Float64(z * Float64(1.0 - log(t))) + x); elseif (z <= 8.2e+206) tmp = Float64(x + fma(b, Float64(a + -0.5), y)); else tmp = Float64(x + Float64(z - Float64(z * log(t)))); end return tmp end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[z, -4.4e+151], N[(N[(z * N[(1.0 - N[Log[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + x), $MachinePrecision], If[LessEqual[z, 8.2e+206], N[(x + N[(b * N[(a + -0.5), $MachinePrecision] + y), $MachinePrecision]), $MachinePrecision], N[(x + N[(z - N[(z * N[Log[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -4.4 \cdot 10^{+151}:\\
\;\;\;\;z \cdot \left(1 - \log t\right) + x\\
\mathbf{elif}\;z \leq 8.2 \cdot 10^{+206}:\\
\;\;\;\;x + \mathsf{fma}\left(b, a + -0.5, y\right)\\
\mathbf{else}:\\
\;\;\;\;x + \left(z - z \cdot \log t\right)\\
\end{array}
\end{array}
if z < -4.40000000000000013e151Initial program 99.6%
+-commutative99.6%
associate--l+99.6%
associate-+r+99.6%
+-commutative99.6%
*-lft-identity99.6%
metadata-eval99.6%
*-commutative99.6%
distribute-rgt-out--99.8%
metadata-eval99.8%
fma-def99.8%
sub-neg99.8%
metadata-eval99.8%
Simplified99.8%
Taylor expanded in b around 0 87.0%
distribute-rgt-out--86.9%
*-commutative86.9%
*-un-lft-identity86.9%
Applied egg-rr86.9%
Taylor expanded in y around 0 77.3%
associate--l+77.3%
*-commutative77.3%
cancel-sign-sub-inv77.3%
*-lft-identity77.3%
log-rec77.3%
distribute-rgt-in77.4%
log-rec77.4%
sub-neg77.4%
+-commutative77.4%
Simplified77.4%
if -4.40000000000000013e151 < z < 8.2000000000000006e206Initial 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-def99.9%
sub-neg99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in z around 0 88.9%
+-commutative88.9%
sub-neg88.9%
metadata-eval88.9%
fma-def88.9%
Simplified88.9%
if 8.2000000000000006e206 < z Initial program 99.7%
+-commutative99.7%
associate--l+99.6%
associate-+r+99.6%
+-commutative99.6%
*-lft-identity99.6%
metadata-eval99.6%
*-commutative99.6%
distribute-rgt-out--99.6%
metadata-eval99.6%
fma-def99.6%
sub-neg99.6%
metadata-eval99.6%
Simplified99.6%
Taylor expanded in b around 0 83.9%
distribute-rgt-out--83.9%
*-commutative83.9%
*-un-lft-identity83.9%
Applied egg-rr83.9%
Taylor expanded in y around 0 76.4%
Final simplification85.9%
(FPCore (x y z t a b) :precision binary64 (if (or (<= z -7.6e+152) (not (<= z 1.65e+208))) (* z (- 1.0 (log t))) (+ (+ x y) (* b (- a 0.5)))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((z <= -7.6e+152) || !(z <= 1.65e+208)) {
tmp = z * (1.0 - log(t));
} else {
tmp = (x + 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 ((z <= (-7.6d+152)) .or. (.not. (z <= 1.65d+208))) then
tmp = z * (1.0d0 - log(t))
else
tmp = (x + 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 ((z <= -7.6e+152) || !(z <= 1.65e+208)) {
tmp = z * (1.0 - Math.log(t));
} else {
tmp = (x + y) + (b * (a - 0.5));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (z <= -7.6e+152) or not (z <= 1.65e+208): tmp = z * (1.0 - math.log(t)) else: tmp = (x + y) + (b * (a - 0.5)) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((z <= -7.6e+152) || !(z <= 1.65e+208)) tmp = Float64(z * Float64(1.0 - log(t))); else tmp = Float64(Float64(x + 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 ((z <= -7.6e+152) || ~((z <= 1.65e+208))) tmp = z * (1.0 - log(t)); else tmp = (x + y) + (b * (a - 0.5)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[z, -7.6e+152], N[Not[LessEqual[z, 1.65e+208]], $MachinePrecision]], N[(z * N[(1.0 - N[Log[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x + y), $MachinePrecision] + N[(b * N[(a - 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -7.6 \cdot 10^{+152} \lor \neg \left(z \leq 1.65 \cdot 10^{+208}\right):\\
\;\;\;\;z \cdot \left(1 - \log t\right)\\
\mathbf{else}:\\
\;\;\;\;\left(x + y\right) + b \cdot \left(a - 0.5\right)\\
\end{array}
\end{array}
if z < -7.6000000000000001e152 or 1.65e208 < z Initial program 99.6%
+-commutative99.6%
associate--l+99.6%
associate-+r+99.6%
+-commutative99.6%
*-lft-identity99.6%
metadata-eval99.6%
*-commutative99.6%
distribute-rgt-out--99.7%
metadata-eval99.7%
fma-def99.7%
sub-neg99.7%
metadata-eval99.7%
Simplified99.7%
Taylor expanded in b around 0 85.8%
distribute-rgt-out--85.7%
*-commutative85.7%
*-un-lft-identity85.7%
Applied egg-rr85.7%
Taylor expanded in y around 0 77.0%
associate--l+76.9%
*-commutative76.9%
cancel-sign-sub-inv76.9%
*-lft-identity76.9%
log-rec76.9%
distribute-rgt-in77.0%
log-rec77.0%
sub-neg77.0%
+-commutative77.0%
Simplified77.0%
Taylor expanded in z around inf 66.0%
if -7.6000000000000001e152 < z < 1.65e208Initial program 99.9%
Taylor expanded in z around 0 88.9%
Final simplification83.2%
(FPCore (x y z t a b)
:precision binary64
(if (<= x -1.9e+125)
x
(if (<= x -4.2e-74)
(* a b)
(if (<= x -2e-134)
(* -0.5 b)
(if (or (<= x 1.9e-257) (and (not (<= x 1.5e-149)) (<= x 0.015)))
(* a b)
y)))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (x <= -1.9e+125) {
tmp = x;
} else if (x <= -4.2e-74) {
tmp = a * b;
} else if (x <= -2e-134) {
tmp = -0.5 * b;
} else if ((x <= 1.9e-257) || (!(x <= 1.5e-149) && (x <= 0.015))) {
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.9d+125)) then
tmp = x
else if (x <= (-4.2d-74)) then
tmp = a * b
else if (x <= (-2d-134)) then
tmp = (-0.5d0) * b
else if ((x <= 1.9d-257) .or. (.not. (x <= 1.5d-149)) .and. (x <= 0.015d0)) 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.9e+125) {
tmp = x;
} else if (x <= -4.2e-74) {
tmp = a * b;
} else if (x <= -2e-134) {
tmp = -0.5 * b;
} else if ((x <= 1.9e-257) || (!(x <= 1.5e-149) && (x <= 0.015))) {
tmp = a * b;
} else {
tmp = y;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if x <= -1.9e+125: tmp = x elif x <= -4.2e-74: tmp = a * b elif x <= -2e-134: tmp = -0.5 * b elif (x <= 1.9e-257) or (not (x <= 1.5e-149) and (x <= 0.015)): tmp = a * b else: tmp = y return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (x <= -1.9e+125) tmp = x; elseif (x <= -4.2e-74) tmp = Float64(a * b); elseif (x <= -2e-134) tmp = Float64(-0.5 * b); elseif ((x <= 1.9e-257) || (!(x <= 1.5e-149) && (x <= 0.015))) 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.9e+125) tmp = x; elseif (x <= -4.2e-74) tmp = a * b; elseif (x <= -2e-134) tmp = -0.5 * b; elseif ((x <= 1.9e-257) || (~((x <= 1.5e-149)) && (x <= 0.015))) tmp = a * b; else tmp = y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[x, -1.9e+125], x, If[LessEqual[x, -4.2e-74], N[(a * b), $MachinePrecision], If[LessEqual[x, -2e-134], N[(-0.5 * b), $MachinePrecision], If[Or[LessEqual[x, 1.9e-257], And[N[Not[LessEqual[x, 1.5e-149]], $MachinePrecision], LessEqual[x, 0.015]]], N[(a * b), $MachinePrecision], y]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.9 \cdot 10^{+125}:\\
\;\;\;\;x\\
\mathbf{elif}\;x \leq -4.2 \cdot 10^{-74}:\\
\;\;\;\;a \cdot b\\
\mathbf{elif}\;x \leq -2 \cdot 10^{-134}:\\
\;\;\;\;-0.5 \cdot b\\
\mathbf{elif}\;x \leq 1.9 \cdot 10^{-257} \lor \neg \left(x \leq 1.5 \cdot 10^{-149}\right) \land x \leq 0.015:\\
\;\;\;\;a \cdot b\\
\mathbf{else}:\\
\;\;\;\;y\\
\end{array}
\end{array}
if x < -1.90000000000000001e125Initial program 100.0%
+-commutative100.0%
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-def100.0%
sub-neg100.0%
metadata-eval100.0%
Simplified100.0%
Taylor expanded in x around inf 52.9%
if -1.90000000000000001e125 < x < -4.2e-74 or -2.00000000000000008e-134 < x < 1.9000000000000002e-257 or 1.5000000000000001e-149 < x < 0.014999999999999999Initial program 99.7%
+-commutative99.7%
associate--l+99.7%
associate-+r+99.7%
+-commutative99.7%
*-lft-identity99.7%
metadata-eval99.7%
*-commutative99.7%
distribute-rgt-out--99.8%
metadata-eval99.8%
fma-def99.8%
sub-neg99.8%
metadata-eval99.8%
Simplified99.8%
Taylor expanded in a around inf 36.3%
*-commutative36.3%
Simplified36.3%
if -4.2e-74 < x < -2.00000000000000008e-134Initial 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--100.0%
metadata-eval100.0%
fma-def100.0%
sub-neg100.0%
metadata-eval100.0%
Simplified100.0%
Taylor expanded in b around inf 57.9%
Taylor expanded in a around 0 37.5%
*-commutative37.5%
Simplified37.5%
if 1.9000000000000002e-257 < x < 1.5000000000000001e-149 or 0.014999999999999999 < 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.8%
metadata-eval99.8%
fma-def99.9%
sub-neg99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in y around inf 25.6%
Final simplification35.1%
(FPCore (x y z t a b) :precision binary64 (let* ((t_1 (* b (- a 0.5)))) (if (<= (+ x y) -1e-244) (+ 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) <= -1e-244) {
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) <= (-1d-244)) 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) <= -1e-244) {
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) <= -1e-244: 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) <= -1e-244) 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) <= -1e-244) 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], -1e-244], 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 -1 \cdot 10^{-244}:\\
\;\;\;\;x + t_1\\
\mathbf{else}:\\
\;\;\;\;y + t_1\\
\end{array}
\end{array}
if (+.f64 x y) < -9.9999999999999993e-245Initial program 99.9%
Taylor expanded in z around 0 82.4%
Taylor expanded in y around 0 57.6%
if -9.9999999999999993e-245 < (+.f64 x y) Initial program 99.8%
Taylor expanded in z around 0 68.7%
Taylor expanded in x around 0 53.7%
Final simplification55.5%
(FPCore (x y z t a b) :precision binary64 (if (<= x -1.85e+30) x (if (<= x -2.25e-72) y (if (<= x -7.5e-277) (* -0.5 b) y))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (x <= -1.85e+30) {
tmp = x;
} else if (x <= -2.25e-72) {
tmp = y;
} else if (x <= -7.5e-277) {
tmp = -0.5 * 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.85d+30)) then
tmp = x
else if (x <= (-2.25d-72)) then
tmp = y
else if (x <= (-7.5d-277)) then
tmp = (-0.5d0) * 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.85e+30) {
tmp = x;
} else if (x <= -2.25e-72) {
tmp = y;
} else if (x <= -7.5e-277) {
tmp = -0.5 * b;
} else {
tmp = y;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if x <= -1.85e+30: tmp = x elif x <= -2.25e-72: tmp = y elif x <= -7.5e-277: tmp = -0.5 * b else: tmp = y return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (x <= -1.85e+30) tmp = x; elseif (x <= -2.25e-72) tmp = y; elseif (x <= -7.5e-277) tmp = Float64(-0.5 * b); else tmp = y; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (x <= -1.85e+30) tmp = x; elseif (x <= -2.25e-72) tmp = y; elseif (x <= -7.5e-277) tmp = -0.5 * b; else tmp = y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[x, -1.85e+30], x, If[LessEqual[x, -2.25e-72], y, If[LessEqual[x, -7.5e-277], N[(-0.5 * b), $MachinePrecision], y]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.85 \cdot 10^{+30}:\\
\;\;\;\;x\\
\mathbf{elif}\;x \leq -2.25 \cdot 10^{-72}:\\
\;\;\;\;y\\
\mathbf{elif}\;x \leq -7.5 \cdot 10^{-277}:\\
\;\;\;\;-0.5 \cdot b\\
\mathbf{else}:\\
\;\;\;\;y\\
\end{array}
\end{array}
if x < -1.85000000000000008e30Initial 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-def99.9%
sub-neg99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in x around inf 40.8%
if -1.85000000000000008e30 < x < -2.25e-72 or -7.49999999999999971e-277 < x Initial 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.8%
metadata-eval99.8%
fma-def99.9%
sub-neg99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in y around inf 23.8%
if -2.25e-72 < x < -7.49999999999999971e-277Initial 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-def100.0%
sub-neg100.0%
metadata-eval100.0%
Simplified100.0%
Taylor expanded in b around inf 52.5%
Taylor expanded in a around 0 23.9%
*-commutative23.9%
Simplified23.9%
Final simplification27.7%
(FPCore (x y z t a b) :precision binary64 (if (or (<= b -6.3e+31) (not (<= b 8.2e+86))) (* b (- a 0.5)) (+ x y)))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((b <= -6.3e+31) || !(b <= 8.2e+86)) {
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 <= (-6.3d+31)) .or. (.not. (b <= 8.2d+86))) 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 <= -6.3e+31) || !(b <= 8.2e+86)) {
tmp = b * (a - 0.5);
} else {
tmp = x + y;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (b <= -6.3e+31) or not (b <= 8.2e+86): tmp = b * (a - 0.5) else: tmp = x + y return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((b <= -6.3e+31) || !(b <= 8.2e+86)) 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 <= -6.3e+31) || ~((b <= 8.2e+86))) 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, -6.3e+31], N[Not[LessEqual[b, 8.2e+86]], $MachinePrecision]], N[(b * N[(a - 0.5), $MachinePrecision]), $MachinePrecision], N[(x + y), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq -6.3 \cdot 10^{+31} \lor \neg \left(b \leq 8.2 \cdot 10^{+86}\right):\\
\;\;\;\;b \cdot \left(a - 0.5\right)\\
\mathbf{else}:\\
\;\;\;\;x + y\\
\end{array}
\end{array}
if b < -6.2999999999999998e31 or 8.1999999999999998e86 < b 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-def99.9%
sub-neg99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in b around inf 66.6%
if -6.2999999999999998e31 < b < 8.1999999999999998e86Initial program 99.8%
Taylor expanded in z around 0 67.3%
Taylor expanded in b around 0 52.0%
+-commutative52.0%
Simplified52.0%
Final simplification58.3%
(FPCore (x y z t a b) :precision binary64 (if (<= y 1.16e+200) (+ x (* b (- a 0.5))) (+ x y)))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (y <= 1.16e+200) {
tmp = x + (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 (y <= 1.16d+200) then
tmp = x + (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 (y <= 1.16e+200) {
tmp = x + (b * (a - 0.5));
} else {
tmp = x + y;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if y <= 1.16e+200: tmp = x + (b * (a - 0.5)) else: tmp = x + y return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (y <= 1.16e+200) tmp = Float64(x + 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 (y <= 1.16e+200) tmp = x + (b * (a - 0.5)); else tmp = x + y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[y, 1.16e+200], N[(x + N[(b * N[(a - 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + y), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq 1.16 \cdot 10^{+200}:\\
\;\;\;\;x + b \cdot \left(a - 0.5\right)\\
\mathbf{else}:\\
\;\;\;\;x + y\\
\end{array}
\end{array}
if y < 1.16e200Initial program 99.8%
Taylor expanded in z around 0 74.3%
Taylor expanded in y around 0 57.7%
if 1.16e200 < y Initial program 99.9%
Taylor expanded in z around 0 86.9%
Taylor expanded in b around 0 75.8%
+-commutative75.8%
Simplified75.8%
Final simplification59.0%
(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.8%
Taylor expanded in z around 0 75.1%
Final simplification75.1%
(FPCore (x y z t a b) :precision binary64 (if (or (<= b -5.1e+92) (not (<= b 1.65e+111))) (* a b) (+ x y)))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((b <= -5.1e+92) || !(b <= 1.65e+111)) {
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 ((b <= (-5.1d+92)) .or. (.not. (b <= 1.65d+111))) 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 ((b <= -5.1e+92) || !(b <= 1.65e+111)) {
tmp = a * b;
} else {
tmp = x + y;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (b <= -5.1e+92) or not (b <= 1.65e+111): tmp = a * b else: tmp = x + y return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((b <= -5.1e+92) || !(b <= 1.65e+111)) 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 ((b <= -5.1e+92) || ~((b <= 1.65e+111))) tmp = a * b; else tmp = x + y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[b, -5.1e+92], N[Not[LessEqual[b, 1.65e+111]], $MachinePrecision]], N[(a * b), $MachinePrecision], N[(x + y), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq -5.1 \cdot 10^{+92} \lor \neg \left(b \leq 1.65 \cdot 10^{+111}\right):\\
\;\;\;\;a \cdot b\\
\mathbf{else}:\\
\;\;\;\;x + y\\
\end{array}
\end{array}
if b < -5.1000000000000003e92 or 1.6500000000000001e111 < b 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-def99.9%
sub-neg99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in a around inf 52.1%
*-commutative52.1%
Simplified52.1%
if -5.1000000000000003e92 < b < 1.6500000000000001e111Initial program 99.8%
Taylor expanded in z around 0 69.4%
Taylor expanded in b around 0 49.8%
+-commutative49.8%
Simplified49.8%
Final simplification50.5%
(FPCore (x y z t a b) :precision binary64 (if (<= x -5.2e+28) x y))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (x <= -5.2e+28) {
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 <= (-5.2d+28)) 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 <= -5.2e+28) {
tmp = x;
} else {
tmp = y;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if x <= -5.2e+28: tmp = x else: tmp = y return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (x <= -5.2e+28) tmp = x; else tmp = y; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (x <= -5.2e+28) tmp = x; else tmp = y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[x, -5.2e+28], x, y]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -5.2 \cdot 10^{+28}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;y\\
\end{array}
\end{array}
if x < -5.2000000000000004e28Initial 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-def99.9%
sub-neg99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in x around inf 40.8%
if -5.2000000000000004e28 < x Initial 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-def99.9%
sub-neg99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in y around inf 25.1%
Final simplification28.7%
(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.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-def99.9%
sub-neg99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in x around inf 18.7%
Final simplification18.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 2023334
(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)))