
(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 17 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 (+ (- (+ (+ 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}
Initial program 99.9%
Final simplification99.9%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* (- a 0.5) b)))
(if (<= z -5.2e+99)
(+ (+ x y) (* z (- 1.0 (log t))))
(if (<= z 5.8e+92) (+ x (+ y t_1)) (- (+ z t_1) (* z (log t)))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (a - 0.5) * b;
double tmp;
if (z <= -5.2e+99) {
tmp = (x + y) + (z * (1.0 - log(t)));
} else if (z <= 5.8e+92) {
tmp = x + (y + t_1);
} else {
tmp = (z + t_1) - (z * log(t));
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: t_1
real(8) :: tmp
t_1 = (a - 0.5d0) * b
if (z <= (-5.2d+99)) then
tmp = (x + y) + (z * (1.0d0 - log(t)))
else if (z <= 5.8d+92) then
tmp = x + (y + t_1)
else
tmp = (z + t_1) - (z * log(t))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (a - 0.5) * b;
double tmp;
if (z <= -5.2e+99) {
tmp = (x + y) + (z * (1.0 - Math.log(t)));
} else if (z <= 5.8e+92) {
tmp = x + (y + t_1);
} else {
tmp = (z + t_1) - (z * Math.log(t));
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = (a - 0.5) * b tmp = 0 if z <= -5.2e+99: tmp = (x + y) + (z * (1.0 - math.log(t))) elif z <= 5.8e+92: tmp = x + (y + t_1) else: tmp = (z + t_1) - (z * math.log(t)) return tmp
function code(x, y, z, t, a, b) t_1 = Float64(Float64(a - 0.5) * b) tmp = 0.0 if (z <= -5.2e+99) tmp = Float64(Float64(x + y) + Float64(z * Float64(1.0 - log(t)))); elseif (z <= 5.8e+92) tmp = Float64(x + Float64(y + t_1)); else tmp = Float64(Float64(z + t_1) - Float64(z * log(t))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = (a - 0.5) * b; tmp = 0.0; if (z <= -5.2e+99) tmp = (x + y) + (z * (1.0 - log(t))); elseif (z <= 5.8e+92) tmp = x + (y + t_1); else tmp = (z + t_1) - (z * log(t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(a - 0.5), $MachinePrecision] * b), $MachinePrecision]}, If[LessEqual[z, -5.2e+99], N[(N[(x + y), $MachinePrecision] + N[(z * N[(1.0 - N[Log[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 5.8e+92], N[(x + N[(y + t$95$1), $MachinePrecision]), $MachinePrecision], N[(N[(z + t$95$1), $MachinePrecision] - N[(z * N[Log[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(a - 0.5\right) \cdot b\\
\mathbf{if}\;z \leq -5.2 \cdot 10^{+99}:\\
\;\;\;\;\left(x + y\right) + z \cdot \left(1 - \log t\right)\\
\mathbf{elif}\;z \leq 5.8 \cdot 10^{+92}:\\
\;\;\;\;x + \left(y + t_1\right)\\
\mathbf{else}:\\
\;\;\;\;\left(z + t_1\right) - z \cdot \log t\\
\end{array}
\end{array}
if z < -5.1999999999999999e99Initial 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.7%
metadata-eval99.7%
fma-def99.7%
sub-neg99.7%
metadata-eval99.7%
Simplified99.7%
Taylor expanded in b around 0 86.2%
if -5.1999999999999999e99 < z < 5.8000000000000001e92Initial 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 z around 0 95.2%
if 5.8000000000000001e92 < z Initial program 99.9%
Taylor expanded in x around 0 96.9%
Taylor expanded in y around 0 88.3%
Final simplification92.9%
(FPCore (x y z t a b) :precision binary64 (let* ((t_1 (* (- a 0.5) b))) (if (<= (+ x y) -5e-17) (+ x (+ y t_1)) (+ t_1 (- (+ y z) (* z (log t)))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (a - 0.5) * b;
double tmp;
if ((x + y) <= -5e-17) {
tmp = x + (y + t_1);
} else {
tmp = t_1 + ((y + z) - (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 = (a - 0.5d0) * b
if ((x + y) <= (-5d-17)) then
tmp = x + (y + t_1)
else
tmp = t_1 + ((y + z) - (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 = (a - 0.5) * b;
double tmp;
if ((x + y) <= -5e-17) {
tmp = x + (y + t_1);
} else {
tmp = t_1 + ((y + z) - (z * Math.log(t)));
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = (a - 0.5) * b tmp = 0 if (x + y) <= -5e-17: tmp = x + (y + t_1) else: tmp = t_1 + ((y + z) - (z * math.log(t))) return tmp
function code(x, y, z, t, a, b) t_1 = Float64(Float64(a - 0.5) * b) tmp = 0.0 if (Float64(x + y) <= -5e-17) tmp = Float64(x + Float64(y + t_1)); else tmp = Float64(t_1 + Float64(Float64(y + z) - Float64(z * log(t)))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = (a - 0.5) * b; tmp = 0.0; if ((x + y) <= -5e-17) tmp = x + (y + t_1); else tmp = t_1 + ((y + z) - (z * log(t))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(a - 0.5), $MachinePrecision] * b), $MachinePrecision]}, If[LessEqual[N[(x + y), $MachinePrecision], -5e-17], N[(x + N[(y + t$95$1), $MachinePrecision]), $MachinePrecision], N[(t$95$1 + N[(N[(y + z), $MachinePrecision] - N[(z * N[Log[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(a - 0.5\right) \cdot b\\
\mathbf{if}\;x + y \leq -5 \cdot 10^{-17}:\\
\;\;\;\;x + \left(y + t_1\right)\\
\mathbf{else}:\\
\;\;\;\;t_1 + \left(\left(y + z\right) - z \cdot \log t\right)\\
\end{array}
\end{array}
if (+.f64 x y) < -4.9999999999999999e-17Initial 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-def99.9%
sub-neg99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in z around 0 86.2%
if -4.9999999999999999e-17 < (+.f64 x y) Initial program 99.9%
Taylor expanded in x around 0 81.4%
Final simplification83.3%
(FPCore (x y z t a b) :precision binary64 (if (or (<= b -5.6e-28) (not (<= b 5e-90))) (+ x (+ y (* (- a 0.5) b))) (+ (+ x y) (* z (- 1.0 (log t))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((b <= -5.6e-28) || !(b <= 5e-90)) {
tmp = x + (y + ((a - 0.5) * b));
} else {
tmp = (x + y) + (z * (1.0 - 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) :: tmp
if ((b <= (-5.6d-28)) .or. (.not. (b <= 5d-90))) then
tmp = x + (y + ((a - 0.5d0) * b))
else
tmp = (x + y) + (z * (1.0d0 - 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 tmp;
if ((b <= -5.6e-28) || !(b <= 5e-90)) {
tmp = x + (y + ((a - 0.5) * b));
} else {
tmp = (x + y) + (z * (1.0 - Math.log(t)));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (b <= -5.6e-28) or not (b <= 5e-90): tmp = x + (y + ((a - 0.5) * b)) else: tmp = (x + y) + (z * (1.0 - math.log(t))) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((b <= -5.6e-28) || !(b <= 5e-90)) tmp = Float64(x + Float64(y + Float64(Float64(a - 0.5) * b))); else tmp = Float64(Float64(x + y) + Float64(z * Float64(1.0 - log(t)))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((b <= -5.6e-28) || ~((b <= 5e-90))) tmp = x + (y + ((a - 0.5) * b)); else tmp = (x + y) + (z * (1.0 - log(t))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[b, -5.6e-28], N[Not[LessEqual[b, 5e-90]], $MachinePrecision]], N[(x + N[(y + N[(N[(a - 0.5), $MachinePrecision] * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x + y), $MachinePrecision] + N[(z * N[(1.0 - N[Log[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq -5.6 \cdot 10^{-28} \lor \neg \left(b \leq 5 \cdot 10^{-90}\right):\\
\;\;\;\;x + \left(y + \left(a - 0.5\right) \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;\left(x + y\right) + z \cdot \left(1 - \log t\right)\\
\end{array}
\end{array}
if b < -5.5999999999999996e-28 or 5.00000000000000019e-90 < 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--100.0%
metadata-eval100.0%
fma-def100.0%
sub-neg100.0%
metadata-eval100.0%
Simplified100.0%
Taylor expanded in z around 0 91.1%
if -5.5999999999999996e-28 < b < 5.00000000000000019e-90Initial 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.8%
sub-neg99.8%
metadata-eval99.8%
Simplified99.8%
Taylor expanded in b around 0 94.8%
Final simplification92.7%
(FPCore (x y z t a b) :precision binary64 (if (or (<= z -1.75e+147) (not (<= z 4.2e+93))) (+ x (* z (- 1.0 (log t)))) (+ x (+ y (* (- a 0.5) b)))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((z <= -1.75e+147) || !(z <= 4.2e+93)) {
tmp = x + (z * (1.0 - log(t)));
} else {
tmp = x + (y + ((a - 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 ((z <= (-1.75d+147)) .or. (.not. (z <= 4.2d+93))) then
tmp = x + (z * (1.0d0 - log(t)))
else
tmp = x + (y + ((a - 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 ((z <= -1.75e+147) || !(z <= 4.2e+93)) {
tmp = x + (z * (1.0 - Math.log(t)));
} else {
tmp = x + (y + ((a - 0.5) * b));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (z <= -1.75e+147) or not (z <= 4.2e+93): tmp = x + (z * (1.0 - math.log(t))) else: tmp = x + (y + ((a - 0.5) * b)) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((z <= -1.75e+147) || !(z <= 4.2e+93)) tmp = Float64(x + Float64(z * Float64(1.0 - log(t)))); else tmp = Float64(x + Float64(y + Float64(Float64(a - 0.5) * b))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((z <= -1.75e+147) || ~((z <= 4.2e+93))) tmp = x + (z * (1.0 - log(t))); else tmp = x + (y + ((a - 0.5) * b)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[z, -1.75e+147], N[Not[LessEqual[z, 4.2e+93]], $MachinePrecision]], N[(x + N[(z * N[(1.0 - N[Log[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(y + N[(N[(a - 0.5), $MachinePrecision] * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.75 \cdot 10^{+147} \lor \neg \left(z \leq 4.2 \cdot 10^{+93}\right):\\
\;\;\;\;x + z \cdot \left(1 - \log t\right)\\
\mathbf{else}:\\
\;\;\;\;x + \left(y + \left(a - 0.5\right) \cdot b\right)\\
\end{array}
\end{array}
if z < -1.74999999999999987e147 or 4.1999999999999996e93 < z 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.7%
metadata-eval99.7%
fma-def99.7%
sub-neg99.7%
metadata-eval99.7%
Simplified99.7%
Taylor expanded in b around 0 80.1%
Taylor expanded in y around 0 65.2%
+-commutative65.2%
Simplified65.2%
if -1.74999999999999987e147 < z < 4.1999999999999996e93Initial 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 z around 0 94.5%
Final simplification87.2%
(FPCore (x y z t a b)
:precision binary64
(if (<= z -2.8e+146)
(- (+ y z) (* z (log t)))
(if (<= z 1.02e+83)
(+ x (+ y (* (- a 0.5) b)))
(+ x (* z (- 1.0 (log t)))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (z <= -2.8e+146) {
tmp = (y + z) - (z * log(t));
} else if (z <= 1.02e+83) {
tmp = x + (y + ((a - 0.5) * b));
} else {
tmp = x + (z * (1.0 - 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) :: tmp
if (z <= (-2.8d+146)) then
tmp = (y + z) - (z * log(t))
else if (z <= 1.02d+83) then
tmp = x + (y + ((a - 0.5d0) * b))
else
tmp = x + (z * (1.0d0 - 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 tmp;
if (z <= -2.8e+146) {
tmp = (y + z) - (z * Math.log(t));
} else if (z <= 1.02e+83) {
tmp = x + (y + ((a - 0.5) * b));
} else {
tmp = x + (z * (1.0 - Math.log(t)));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if z <= -2.8e+146: tmp = (y + z) - (z * math.log(t)) elif z <= 1.02e+83: tmp = x + (y + ((a - 0.5) * b)) else: tmp = x + (z * (1.0 - math.log(t))) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (z <= -2.8e+146) tmp = Float64(Float64(y + z) - Float64(z * log(t))); elseif (z <= 1.02e+83) tmp = Float64(x + Float64(y + Float64(Float64(a - 0.5) * b))); else tmp = Float64(x + Float64(z * Float64(1.0 - log(t)))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (z <= -2.8e+146) tmp = (y + z) - (z * log(t)); elseif (z <= 1.02e+83) tmp = x + (y + ((a - 0.5) * b)); else tmp = x + (z * (1.0 - log(t))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[z, -2.8e+146], N[(N[(y + z), $MachinePrecision] - N[(z * N[Log[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.02e+83], N[(x + N[(y + N[(N[(a - 0.5), $MachinePrecision] * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(z * N[(1.0 - N[Log[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.8 \cdot 10^{+146}:\\
\;\;\;\;\left(y + z\right) - z \cdot \log t\\
\mathbf{elif}\;z \leq 1.02 \cdot 10^{+83}:\\
\;\;\;\;x + \left(y + \left(a - 0.5\right) \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;x + z \cdot \left(1 - \log t\right)\\
\end{array}
\end{array}
if z < -2.8000000000000001e146Initial program 99.7%
Taylor expanded in x around 0 99.7%
Taylor expanded in b around 0 82.2%
if -2.8000000000000001e146 < z < 1.0200000000000001e83Initial 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 z around 0 94.5%
if 1.0200000000000001e83 < z 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.8%
sub-neg99.8%
metadata-eval99.8%
Simplified99.8%
Taylor expanded in b around 0 78.0%
Taylor expanded in y around 0 69.4%
+-commutative69.4%
Simplified69.4%
Final simplification89.8%
(FPCore (x y z t a b)
:precision binary64
(if (<= a -8.8e+198)
(* a b)
(if (<= a -2.15e-240)
(+ x y)
(if (<= a 1.25e-291)
(* b -0.5)
(if (<= a 3.4e-145)
(+ x y)
(if (<= a 7.5e-116)
(* b -0.5)
(if (<= a 3.2e+133) (+ x y) (* a b))))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (a <= -8.8e+198) {
tmp = a * b;
} else if (a <= -2.15e-240) {
tmp = x + y;
} else if (a <= 1.25e-291) {
tmp = b * -0.5;
} else if (a <= 3.4e-145) {
tmp = x + y;
} else if (a <= 7.5e-116) {
tmp = b * -0.5;
} else if (a <= 3.2e+133) {
tmp = x + y;
} else {
tmp = 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 (a <= (-8.8d+198)) then
tmp = a * b
else if (a <= (-2.15d-240)) then
tmp = x + y
else if (a <= 1.25d-291) then
tmp = b * (-0.5d0)
else if (a <= 3.4d-145) then
tmp = x + y
else if (a <= 7.5d-116) then
tmp = b * (-0.5d0)
else if (a <= 3.2d+133) then
tmp = x + y
else
tmp = 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 (a <= -8.8e+198) {
tmp = a * b;
} else if (a <= -2.15e-240) {
tmp = x + y;
} else if (a <= 1.25e-291) {
tmp = b * -0.5;
} else if (a <= 3.4e-145) {
tmp = x + y;
} else if (a <= 7.5e-116) {
tmp = b * -0.5;
} else if (a <= 3.2e+133) {
tmp = x + y;
} else {
tmp = a * b;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if a <= -8.8e+198: tmp = a * b elif a <= -2.15e-240: tmp = x + y elif a <= 1.25e-291: tmp = b * -0.5 elif a <= 3.4e-145: tmp = x + y elif a <= 7.5e-116: tmp = b * -0.5 elif a <= 3.2e+133: tmp = x + y else: tmp = a * b return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (a <= -8.8e+198) tmp = Float64(a * b); elseif (a <= -2.15e-240) tmp = Float64(x + y); elseif (a <= 1.25e-291) tmp = Float64(b * -0.5); elseif (a <= 3.4e-145) tmp = Float64(x + y); elseif (a <= 7.5e-116) tmp = Float64(b * -0.5); elseif (a <= 3.2e+133) tmp = Float64(x + y); else tmp = Float64(a * b); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (a <= -8.8e+198) tmp = a * b; elseif (a <= -2.15e-240) tmp = x + y; elseif (a <= 1.25e-291) tmp = b * -0.5; elseif (a <= 3.4e-145) tmp = x + y; elseif (a <= 7.5e-116) tmp = b * -0.5; elseif (a <= 3.2e+133) tmp = x + y; else tmp = a * b; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[a, -8.8e+198], N[(a * b), $MachinePrecision], If[LessEqual[a, -2.15e-240], N[(x + y), $MachinePrecision], If[LessEqual[a, 1.25e-291], N[(b * -0.5), $MachinePrecision], If[LessEqual[a, 3.4e-145], N[(x + y), $MachinePrecision], If[LessEqual[a, 7.5e-116], N[(b * -0.5), $MachinePrecision], If[LessEqual[a, 3.2e+133], N[(x + y), $MachinePrecision], N[(a * b), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -8.8 \cdot 10^{+198}:\\
\;\;\;\;a \cdot b\\
\mathbf{elif}\;a \leq -2.15 \cdot 10^{-240}:\\
\;\;\;\;x + y\\
\mathbf{elif}\;a \leq 1.25 \cdot 10^{-291}:\\
\;\;\;\;b \cdot -0.5\\
\mathbf{elif}\;a \leq 3.4 \cdot 10^{-145}:\\
\;\;\;\;x + y\\
\mathbf{elif}\;a \leq 7.5 \cdot 10^{-116}:\\
\;\;\;\;b \cdot -0.5\\
\mathbf{elif}\;a \leq 3.2 \cdot 10^{+133}:\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;a \cdot b\\
\end{array}
\end{array}
if a < -8.7999999999999998e198 or 3.19999999999999997e133 < 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--99.9%
metadata-eval99.9%
fma-def99.9%
sub-neg99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in a around inf 67.4%
*-commutative67.4%
Simplified67.4%
if -8.7999999999999998e198 < a < -2.15000000000000007e-240 or 1.2500000000000001e-291 < a < 3.3999999999999999e-145 or 7.5000000000000004e-116 < a < 3.19999999999999997e133Initial 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 0 79.7%
Taylor expanded in z around 0 57.7%
if -2.15000000000000007e-240 < a < 1.2500000000000001e-291 or 3.3999999999999999e-145 < a < 7.5000000000000004e-116Initial 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 65.2%
Taylor expanded in a around 0 65.2%
Simplified65.2%
Final simplification60.6%
(FPCore (x y z t a b) :precision binary64 (if (or (<= (- a 0.5) -1e+201) (not (<= (- a 0.5) 5e+17))) (+ x (* a b)) (+ x (+ y (* b -0.5)))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (((a - 0.5) <= -1e+201) || !((a - 0.5) <= 5e+17)) {
tmp = x + (a * b);
} else {
tmp = x + (y + (b * -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 (((a - 0.5d0) <= (-1d+201)) .or. (.not. ((a - 0.5d0) <= 5d+17))) then
tmp = x + (a * b)
else
tmp = x + (y + (b * (-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 (((a - 0.5) <= -1e+201) || !((a - 0.5) <= 5e+17)) {
tmp = x + (a * b);
} else {
tmp = x + (y + (b * -0.5));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if ((a - 0.5) <= -1e+201) or not ((a - 0.5) <= 5e+17): tmp = x + (a * b) else: tmp = x + (y + (b * -0.5)) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((Float64(a - 0.5) <= -1e+201) || !(Float64(a - 0.5) <= 5e+17)) tmp = Float64(x + Float64(a * b)); else tmp = Float64(x + Float64(y + Float64(b * -0.5))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (((a - 0.5) <= -1e+201) || ~(((a - 0.5) <= 5e+17))) tmp = x + (a * b); else tmp = x + (y + (b * -0.5)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[N[(a - 0.5), $MachinePrecision], -1e+201], N[Not[LessEqual[N[(a - 0.5), $MachinePrecision], 5e+17]], $MachinePrecision]], N[(x + N[(a * b), $MachinePrecision]), $MachinePrecision], N[(x + N[(y + N[(b * -0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a - 0.5 \leq -1 \cdot 10^{+201} \lor \neg \left(a - 0.5 \leq 5 \cdot 10^{+17}\right):\\
\;\;\;\;x + a \cdot b\\
\mathbf{else}:\\
\;\;\;\;x + \left(y + b \cdot -0.5\right)\\
\end{array}
\end{array}
if (-.f64 a 1/2) < -1.00000000000000004e201 or 5e17 < (-.f64 a 1/2) 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-def99.9%
sub-neg99.9%
metadata-eval99.9%
Simplified99.9%
distribute-rgt-out--100.0%
*-commutative100.0%
prod-diff100.0%
*-commutative100.0%
fma-neg100.0%
*-commutative100.0%
distribute-rgt-out--99.9%
*-commutative99.9%
Applied egg-rr99.9%
fma-def99.9%
Simplified99.9%
Taylor expanded in t around inf 99.8%
Taylor expanded in a around inf 81.8%
*-commutative81.8%
Simplified81.8%
Taylor expanded in y around 0 71.0%
*-commutative71.0%
Simplified71.0%
if -1.00000000000000004e201 < (-.f64 a 1/2) < 5e17Initial 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 78.7%
Taylor expanded in a around 0 73.0%
Simplified73.0%
Final simplification72.4%
(FPCore (x y z t a b) :precision binary64 (if (or (<= (- a 0.5) -100000.0) (not (<= (- a 0.5) -0.5))) (+ x (+ y (* a b))) (+ x (+ y (* b -0.5)))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (((a - 0.5) <= -100000.0) || !((a - 0.5) <= -0.5)) {
tmp = x + (y + (a * b));
} else {
tmp = x + (y + (b * -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 (((a - 0.5d0) <= (-100000.0d0)) .or. (.not. ((a - 0.5d0) <= (-0.5d0)))) then
tmp = x + (y + (a * b))
else
tmp = x + (y + (b * (-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 (((a - 0.5) <= -100000.0) || !((a - 0.5) <= -0.5)) {
tmp = x + (y + (a * b));
} else {
tmp = x + (y + (b * -0.5));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if ((a - 0.5) <= -100000.0) or not ((a - 0.5) <= -0.5): tmp = x + (y + (a * b)) else: tmp = x + (y + (b * -0.5)) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((Float64(a - 0.5) <= -100000.0) || !(Float64(a - 0.5) <= -0.5)) tmp = Float64(x + Float64(y + Float64(a * b))); else tmp = Float64(x + Float64(y + Float64(b * -0.5))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (((a - 0.5) <= -100000.0) || ~(((a - 0.5) <= -0.5))) tmp = x + (y + (a * b)); else tmp = x + (y + (b * -0.5)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[N[(a - 0.5), $MachinePrecision], -100000.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[(b * -0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a - 0.5 \leq -100000 \lor \neg \left(a - 0.5 \leq -0.5\right):\\
\;\;\;\;x + \left(y + a \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;x + \left(y + b \cdot -0.5\right)\\
\end{array}
\end{array}
if (-.f64 a 1/2) < -1e5 or -0.5 < (-.f64 a 1/2) 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%
distribute-rgt-out--99.9%
*-commutative99.9%
prod-diff99.9%
*-commutative99.9%
fma-neg99.9%
*-commutative99.9%
distribute-rgt-out--99.9%
*-commutative99.9%
Applied egg-rr99.9%
fma-def99.9%
Simplified99.9%
Taylor expanded in t around inf 99.8%
Taylor expanded in a around inf 81.3%
*-commutative81.3%
Simplified81.3%
if -1e5 < (-.f64 a 1/2) < -0.5Initial 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 77.5%
Taylor expanded in a around 0 77.5%
Simplified77.5%
Final simplification79.3%
(FPCore (x y z t a b) :precision binary64 (if (<= (+ x y) -4e-20) (+ x (* a b)) (if (<= (+ x y) 2e+138) (* (- a 0.5) b) (+ x y))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((x + y) <= -4e-20) {
tmp = x + (a * b);
} else if ((x + y) <= 2e+138) {
tmp = (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 ((x + y) <= (-4d-20)) then
tmp = x + (a * b)
else if ((x + y) <= 2d+138) then
tmp = (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 ((x + y) <= -4e-20) {
tmp = x + (a * b);
} else if ((x + y) <= 2e+138) {
tmp = (a - 0.5) * b;
} else {
tmp = x + y;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (x + y) <= -4e-20: tmp = x + (a * b) elif (x + y) <= 2e+138: tmp = (a - 0.5) * b else: tmp = x + y return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (Float64(x + y) <= -4e-20) tmp = Float64(x + Float64(a * b)); elseif (Float64(x + y) <= 2e+138) tmp = 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 ((x + y) <= -4e-20) tmp = x + (a * b); elseif ((x + y) <= 2e+138) tmp = (a - 0.5) * b; else tmp = x + y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[N[(x + y), $MachinePrecision], -4e-20], N[(x + N[(a * b), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(x + y), $MachinePrecision], 2e+138], N[(N[(a - 0.5), $MachinePrecision] * b), $MachinePrecision], N[(x + y), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x + y \leq -4 \cdot 10^{-20}:\\
\;\;\;\;x + a \cdot b\\
\mathbf{elif}\;x + y \leq 2 \cdot 10^{+138}:\\
\;\;\;\;\left(a - 0.5\right) \cdot b\\
\mathbf{else}:\\
\;\;\;\;x + y\\
\end{array}
\end{array}
if (+.f64 x y) < -3.99999999999999978e-20Initial 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-def99.9%
sub-neg99.9%
metadata-eval99.9%
Simplified99.9%
distribute-rgt-out--100.0%
*-commutative100.0%
prod-diff100.0%
*-commutative100.0%
fma-neg100.0%
*-commutative100.0%
distribute-rgt-out--99.9%
*-commutative99.9%
Applied egg-rr99.9%
fma-def99.9%
Simplified99.9%
Taylor expanded in t around inf 99.9%
Taylor expanded in a around inf 72.8%
*-commutative72.8%
Simplified72.8%
Taylor expanded in y around 0 45.5%
*-commutative45.5%
Simplified45.5%
if -3.99999999999999978e-20 < (+.f64 x y) < 2.0000000000000001e138Initial 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.8%
sub-neg99.8%
metadata-eval99.8%
Simplified99.8%
Taylor expanded in b around inf 54.4%
if 2.0000000000000001e138 < (+.f64 x y) 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--100.0%
metadata-eval100.0%
fma-def100.0%
sub-neg100.0%
metadata-eval100.0%
Simplified100.0%
Taylor expanded in b around 0 80.3%
Taylor expanded in z around 0 76.5%
Final simplification55.7%
(FPCore (x y z t a b) :precision binary64 (if (<= (+ x y) -4e-20) (+ x (* a b)) (if (<= (+ x y) 4e+135) (* (- a 0.5) b) (+ (+ x y) z))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((x + y) <= -4e-20) {
tmp = x + (a * b);
} else if ((x + y) <= 4e+135) {
tmp = (a - 0.5) * b;
} else {
tmp = (x + y) + z;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if ((x + y) <= (-4d-20)) then
tmp = x + (a * b)
else if ((x + y) <= 4d+135) then
tmp = (a - 0.5d0) * b
else
tmp = (x + y) + z
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((x + y) <= -4e-20) {
tmp = x + (a * b);
} else if ((x + y) <= 4e+135) {
tmp = (a - 0.5) * b;
} else {
tmp = (x + y) + z;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (x + y) <= -4e-20: tmp = x + (a * b) elif (x + y) <= 4e+135: tmp = (a - 0.5) * b else: tmp = (x + y) + z return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (Float64(x + y) <= -4e-20) tmp = Float64(x + Float64(a * b)); elseif (Float64(x + y) <= 4e+135) tmp = Float64(Float64(a - 0.5) * b); else tmp = Float64(Float64(x + y) + z); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((x + y) <= -4e-20) tmp = x + (a * b); elseif ((x + y) <= 4e+135) tmp = (a - 0.5) * b; else tmp = (x + y) + z; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[N[(x + y), $MachinePrecision], -4e-20], N[(x + N[(a * b), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(x + y), $MachinePrecision], 4e+135], N[(N[(a - 0.5), $MachinePrecision] * b), $MachinePrecision], N[(N[(x + y), $MachinePrecision] + z), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x + y \leq -4 \cdot 10^{-20}:\\
\;\;\;\;x + a \cdot b\\
\mathbf{elif}\;x + y \leq 4 \cdot 10^{+135}:\\
\;\;\;\;\left(a - 0.5\right) \cdot b\\
\mathbf{else}:\\
\;\;\;\;\left(x + y\right) + z\\
\end{array}
\end{array}
if (+.f64 x y) < -3.99999999999999978e-20Initial 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-def99.9%
sub-neg99.9%
metadata-eval99.9%
Simplified99.9%
distribute-rgt-out--100.0%
*-commutative100.0%
prod-diff100.0%
*-commutative100.0%
fma-neg100.0%
*-commutative100.0%
distribute-rgt-out--99.9%
*-commutative99.9%
Applied egg-rr99.9%
fma-def99.9%
Simplified99.9%
Taylor expanded in t around inf 99.9%
Taylor expanded in a around inf 72.8%
*-commutative72.8%
Simplified72.8%
Taylor expanded in y around 0 45.5%
*-commutative45.5%
Simplified45.5%
if -3.99999999999999978e-20 < (+.f64 x y) < 3.99999999999999985e135Initial 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.8%
sub-neg99.8%
metadata-eval99.8%
Simplified99.8%
Taylor expanded in b around inf 55.5%
if 3.99999999999999985e135 < (+.f64 x y) 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--100.0%
metadata-eval100.0%
fma-def100.0%
sub-neg100.0%
metadata-eval100.0%
Simplified100.0%
Taylor expanded in b around 0 80.9%
add-exp-log53.7%
sub-neg53.7%
log1p-def53.7%
Applied egg-rr53.7%
Applied egg-rr66.7%
expm1-def66.7%
expm1-log1p74.8%
Simplified74.8%
Final simplification55.9%
(FPCore (x y z t a b) :precision binary64 (if (<= y -1.36e-275) x (if (<= y 4.3e-13) (* b -0.5) (if (<= y 1.6e+145) (* a b) y))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (y <= -1.36e-275) {
tmp = x;
} else if (y <= 4.3e-13) {
tmp = b * -0.5;
} else if (y <= 1.6e+145) {
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 (y <= (-1.36d-275)) then
tmp = x
else if (y <= 4.3d-13) then
tmp = b * (-0.5d0)
else if (y <= 1.6d+145) 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 (y <= -1.36e-275) {
tmp = x;
} else if (y <= 4.3e-13) {
tmp = b * -0.5;
} else if (y <= 1.6e+145) {
tmp = a * b;
} else {
tmp = y;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if y <= -1.36e-275: tmp = x elif y <= 4.3e-13: tmp = b * -0.5 elif y <= 1.6e+145: tmp = a * b else: tmp = y return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (y <= -1.36e-275) tmp = x; elseif (y <= 4.3e-13) tmp = Float64(b * -0.5); elseif (y <= 1.6e+145) 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 (y <= -1.36e-275) tmp = x; elseif (y <= 4.3e-13) tmp = b * -0.5; elseif (y <= 1.6e+145) tmp = a * b; else tmp = y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[y, -1.36e-275], x, If[LessEqual[y, 4.3e-13], N[(b * -0.5), $MachinePrecision], If[LessEqual[y, 1.6e+145], N[(a * b), $MachinePrecision], y]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.36 \cdot 10^{-275}:\\
\;\;\;\;x\\
\mathbf{elif}\;y \leq 4.3 \cdot 10^{-13}:\\
\;\;\;\;b \cdot -0.5\\
\mathbf{elif}\;y \leq 1.6 \cdot 10^{+145}:\\
\;\;\;\;a \cdot b\\
\mathbf{else}:\\
\;\;\;\;y\\
\end{array}
\end{array}
if y < -1.35999999999999997e-275Initial 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-def99.9%
sub-neg99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in x around inf 26.0%
if -1.35999999999999997e-275 < y < 4.2999999999999999e-13Initial 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-def99.9%
sub-neg99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in b around inf 48.9%
Taylor expanded in a around 0 36.3%
Simplified36.3%
if 4.2999999999999999e-13 < y < 1.60000000000000004e145Initial 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 a around inf 32.1%
*-commutative32.1%
Simplified32.1%
if 1.60000000000000004e145 < y 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 y around inf 66.7%
Final simplification33.8%
(FPCore (x y z t a b) :precision binary64 (if (<= y -1.5e-275) x (if (<= y 9.6e-52) (* b -0.5) (if (<= y 8.5e+140) x y))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (y <= -1.5e-275) {
tmp = x;
} else if (y <= 9.6e-52) {
tmp = b * -0.5;
} else if (y <= 8.5e+140) {
tmp = x;
} else {
tmp = y;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if (y <= (-1.5d-275)) then
tmp = x
else if (y <= 9.6d-52) then
tmp = b * (-0.5d0)
else if (y <= 8.5d+140) then
tmp = x
else
tmp = y
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (y <= -1.5e-275) {
tmp = x;
} else if (y <= 9.6e-52) {
tmp = b * -0.5;
} else if (y <= 8.5e+140) {
tmp = x;
} else {
tmp = y;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if y <= -1.5e-275: tmp = x elif y <= 9.6e-52: tmp = b * -0.5 elif y <= 8.5e+140: tmp = x else: tmp = y return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (y <= -1.5e-275) tmp = x; elseif (y <= 9.6e-52) tmp = Float64(b * -0.5); elseif (y <= 8.5e+140) tmp = x; else tmp = y; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (y <= -1.5e-275) tmp = x; elseif (y <= 9.6e-52) tmp = b * -0.5; elseif (y <= 8.5e+140) tmp = x; else tmp = y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[y, -1.5e-275], x, If[LessEqual[y, 9.6e-52], N[(b * -0.5), $MachinePrecision], If[LessEqual[y, 8.5e+140], x, y]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.5 \cdot 10^{-275}:\\
\;\;\;\;x\\
\mathbf{elif}\;y \leq 9.6 \cdot 10^{-52}:\\
\;\;\;\;b \cdot -0.5\\
\mathbf{elif}\;y \leq 8.5 \cdot 10^{+140}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;y\\
\end{array}
\end{array}
if y < -1.5e-275 or 9.6000000000000007e-52 < y < 8.4999999999999996e140Initial 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 x around inf 28.6%
if -1.5e-275 < y < 9.6000000000000007e-52Initial 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-def99.9%
sub-neg99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in b around inf 51.5%
Taylor expanded in a around 0 37.7%
Simplified37.7%
if 8.4999999999999996e140 < y 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 y around inf 66.7%
Final simplification34.8%
(FPCore (x y z t a b) :precision binary64 (if (or (<= b -2.2e+36) (not (<= b 4.4e+38))) (* (- a 0.5) b) (+ x y)))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((b <= -2.2e+36) || !(b <= 4.4e+38)) {
tmp = (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 ((b <= (-2.2d+36)) .or. (.not. (b <= 4.4d+38))) then
tmp = (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 ((b <= -2.2e+36) || !(b <= 4.4e+38)) {
tmp = (a - 0.5) * b;
} else {
tmp = x + y;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (b <= -2.2e+36) or not (b <= 4.4e+38): tmp = (a - 0.5) * b else: tmp = x + y return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((b <= -2.2e+36) || !(b <= 4.4e+38)) tmp = 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 ((b <= -2.2e+36) || ~((b <= 4.4e+38))) tmp = (a - 0.5) * b; else tmp = x + y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[b, -2.2e+36], N[Not[LessEqual[b, 4.4e+38]], $MachinePrecision]], N[(N[(a - 0.5), $MachinePrecision] * b), $MachinePrecision], N[(x + y), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq -2.2 \cdot 10^{+36} \lor \neg \left(b \leq 4.4 \cdot 10^{+38}\right):\\
\;\;\;\;\left(a - 0.5\right) \cdot b\\
\mathbf{else}:\\
\;\;\;\;x + y\\
\end{array}
\end{array}
if b < -2.2e36 or 4.40000000000000013e38 < 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--100.0%
metadata-eval100.0%
fma-def100.0%
sub-neg100.0%
metadata-eval100.0%
Simplified100.0%
Taylor expanded in b around inf 71.7%
if -2.2e36 < b < 4.40000000000000013e38Initial 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 0 87.2%
Taylor expanded in z around 0 58.5%
Final simplification63.5%
(FPCore (x y z t a b) :precision binary64 (+ x (+ y (* (- a 0.5) b))))
double code(double x, double y, double z, double t, double a, double b) {
return x + (y + ((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 + ((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 + ((a - 0.5) * b));
}
def code(x, y, z, t, a, b): return x + (y + ((a - 0.5) * b))
function code(x, y, z, t, a, b) return Float64(x + Float64(y + Float64(Float64(a - 0.5) * b))) end
function tmp = code(x, y, z, t, a, b) tmp = x + (y + ((a - 0.5) * b)); end
code[x_, y_, z_, t_, a_, b_] := N[(x + N[(y + N[(N[(a - 0.5), $MachinePrecision] * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \left(y + \left(a - 0.5\right) \cdot b\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-def99.9%
sub-neg99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in z around 0 79.6%
Final simplification79.6%
(FPCore (x y z t a b) :precision binary64 (if (<= y 4e+140) x y))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (y <= 4e+140) {
tmp = x;
} else {
tmp = y;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if (y <= 4d+140) then
tmp = x
else
tmp = y
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (y <= 4e+140) {
tmp = x;
} else {
tmp = y;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if y <= 4e+140: tmp = x else: tmp = y return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (y <= 4e+140) tmp = x; else tmp = y; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (y <= 4e+140) tmp = x; else tmp = y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[y, 4e+140], x, y]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq 4 \cdot 10^{+140}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;y\\
\end{array}
\end{array}
if y < 4.00000000000000024e140Initial 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 x around inf 27.5%
if 4.00000000000000024e140 < y 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 y around inf 66.7%
Final simplification31.9%
(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-def99.9%
sub-neg99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in x around inf 25.1%
Final simplification25.1%
(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 2024018
(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)))