
(FPCore (x y z t a b) :precision binary64 (* x (exp (+ (* y (- (log z) t)) (* a (- (log (- 1.0 z)) b))))))
double code(double x, double y, double z, double t, double a, double b) {
return x * exp(((y * (log(z) - t)) + (a * (log((1.0 - z)) - 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 * exp(((y * (log(z) - t)) + (a * (log((1.0d0 - z)) - b))))
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return x * Math.exp(((y * (Math.log(z) - t)) + (a * (Math.log((1.0 - z)) - b))));
}
def code(x, y, z, t, a, b): return x * math.exp(((y * (math.log(z) - t)) + (a * (math.log((1.0 - z)) - b))))
function code(x, y, z, t, a, b) return Float64(x * exp(Float64(Float64(y * Float64(log(z) - t)) + Float64(a * Float64(log(Float64(1.0 - z)) - b))))) end
function tmp = code(x, y, z, t, a, b) tmp = x * exp(((y * (log(z) - t)) + (a * (log((1.0 - z)) - b)))); end
code[x_, y_, z_, t_, a_, b_] := N[(x * N[Exp[N[(N[(y * N[(N[Log[z], $MachinePrecision] - t), $MachinePrecision]), $MachinePrecision] + N[(a * N[(N[Log[N[(1.0 - z), $MachinePrecision]], $MachinePrecision] - b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x \cdot e^{y \cdot \left(\log z - t\right) + a \cdot \left(\log \left(1 - z\right) - b\right)}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 13 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t a b) :precision binary64 (* x (exp (+ (* y (- (log z) t)) (* a (- (log (- 1.0 z)) b))))))
double code(double x, double y, double z, double t, double a, double b) {
return x * exp(((y * (log(z) - t)) + (a * (log((1.0 - z)) - 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 * exp(((y * (log(z) - t)) + (a * (log((1.0d0 - z)) - b))))
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return x * Math.exp(((y * (Math.log(z) - t)) + (a * (Math.log((1.0 - z)) - b))));
}
def code(x, y, z, t, a, b): return x * math.exp(((y * (math.log(z) - t)) + (a * (math.log((1.0 - z)) - b))))
function code(x, y, z, t, a, b) return Float64(x * exp(Float64(Float64(y * Float64(log(z) - t)) + Float64(a * Float64(log(Float64(1.0 - z)) - b))))) end
function tmp = code(x, y, z, t, a, b) tmp = x * exp(((y * (log(z) - t)) + (a * (log((1.0 - z)) - b)))); end
code[x_, y_, z_, t_, a_, b_] := N[(x * N[Exp[N[(N[(y * N[(N[Log[z], $MachinePrecision] - t), $MachinePrecision]), $MachinePrecision] + N[(a * N[(N[Log[N[(1.0 - z), $MachinePrecision]], $MachinePrecision] - b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x \cdot e^{y \cdot \left(\log z - t\right) + a \cdot \left(\log \left(1 - z\right) - b\right)}
\end{array}
(FPCore (x y z t a b) :precision binary64 (* x (exp (fma y (- (log z) t) (* a (- (log1p (- z)) b))))))
double code(double x, double y, double z, double t, double a, double b) {
return x * exp(fma(y, (log(z) - t), (a * (log1p(-z) - b))));
}
function code(x, y, z, t, a, b) return Float64(x * exp(fma(y, Float64(log(z) - t), Float64(a * Float64(log1p(Float64(-z)) - b))))) end
code[x_, y_, z_, t_, a_, b_] := N[(x * N[Exp[N[(y * N[(N[Log[z], $MachinePrecision] - t), $MachinePrecision] + N[(a * N[(N[Log[1 + (-z)], $MachinePrecision] - b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x \cdot e^{\mathsf{fma}\left(y, \log z - t, a \cdot \left(\mathsf{log1p}\left(-z\right) - b\right)\right)}
\end{array}
Initial program 96.9%
fma-define97.3%
sub-neg97.3%
log1p-define99.1%
Simplified99.1%
(FPCore (x y z t a b) :precision binary64 (if (or (<= y -5.8e-108) (not (<= y 1.18e-32))) (* x (exp (* y (- (log z) t)))) (* x (exp (* a (- b))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((y <= -5.8e-108) || !(y <= 1.18e-32)) {
tmp = x * exp((y * (log(z) - t)));
} else {
tmp = x * exp((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 ((y <= (-5.8d-108)) .or. (.not. (y <= 1.18d-32))) then
tmp = x * exp((y * (log(z) - t)))
else
tmp = x * exp((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 ((y <= -5.8e-108) || !(y <= 1.18e-32)) {
tmp = x * Math.exp((y * (Math.log(z) - t)));
} else {
tmp = x * Math.exp((a * -b));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (y <= -5.8e-108) or not (y <= 1.18e-32): tmp = x * math.exp((y * (math.log(z) - t))) else: tmp = x * math.exp((a * -b)) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((y <= -5.8e-108) || !(y <= 1.18e-32)) tmp = Float64(x * exp(Float64(y * Float64(log(z) - t)))); else tmp = Float64(x * exp(Float64(a * Float64(-b)))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((y <= -5.8e-108) || ~((y <= 1.18e-32))) tmp = x * exp((y * (log(z) - t))); else tmp = x * exp((a * -b)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[y, -5.8e-108], N[Not[LessEqual[y, 1.18e-32]], $MachinePrecision]], N[(x * N[Exp[N[(y * N[(N[Log[z], $MachinePrecision] - t), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(x * N[Exp[N[(a * (-b)), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -5.8 \cdot 10^{-108} \lor \neg \left(y \leq 1.18 \cdot 10^{-32}\right):\\
\;\;\;\;x \cdot e^{y \cdot \left(\log z - t\right)}\\
\mathbf{else}:\\
\;\;\;\;x \cdot e^{a \cdot \left(-b\right)}\\
\end{array}
\end{array}
if y < -5.8000000000000002e-108 or 1.17999999999999997e-32 < y Initial program 97.2%
fma-define97.7%
sub-neg97.7%
log1p-define98.8%
Simplified98.8%
Taylor expanded in a around 0 82.7%
if -5.8000000000000002e-108 < y < 1.17999999999999997e-32Initial program 96.3%
Taylor expanded in z around 0 99.8%
+-commutative99.8%
associate-*r*99.8%
associate-*r*99.8%
distribute-lft-out99.8%
mul-1-neg99.8%
Simplified99.8%
Taylor expanded in b around inf 88.9%
associate-*r*88.9%
mul-1-neg88.9%
Simplified88.9%
Final simplification84.6%
(FPCore (x y z t a b) :precision binary64 (* x (exp (- (* y (- (log z) t)) (* a (+ z b))))))
double code(double x, double y, double z, double t, double a, double b) {
return x * exp(((y * (log(z) - t)) - (a * (z + 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 * exp(((y * (log(z) - t)) - (a * (z + b))))
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return x * Math.exp(((y * (Math.log(z) - t)) - (a * (z + b))));
}
def code(x, y, z, t, a, b): return x * math.exp(((y * (math.log(z) - t)) - (a * (z + b))))
function code(x, y, z, t, a, b) return Float64(x * exp(Float64(Float64(y * Float64(log(z) - t)) - Float64(a * Float64(z + b))))) end
function tmp = code(x, y, z, t, a, b) tmp = x * exp(((y * (log(z) - t)) - (a * (z + b)))); end
code[x_, y_, z_, t_, a_, b_] := N[(x * N[Exp[N[(N[(y * N[(N[Log[z], $MachinePrecision] - t), $MachinePrecision]), $MachinePrecision] - N[(a * N[(z + b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x \cdot e^{y \cdot \left(\log z - t\right) - a \cdot \left(z + b\right)}
\end{array}
Initial program 96.9%
Taylor expanded in z around 0 98.7%
+-commutative98.7%
associate-*r*98.7%
associate-*r*98.7%
distribute-lft-out98.7%
mul-1-neg98.7%
Simplified98.7%
Final simplification98.7%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* x (exp (* t (- y))))))
(if (<= t -255.0)
t_1
(if (<= t 2.35e-80)
(* x (pow z y))
(if (<= t 1.15e+134) (* x (exp (* a (- b)))) t_1)))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = x * exp((t * -y));
double tmp;
if (t <= -255.0) {
tmp = t_1;
} else if (t <= 2.35e-80) {
tmp = x * pow(z, y);
} else if (t <= 1.15e+134) {
tmp = x * exp((a * -b));
} else {
tmp = 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 = x * exp((t * -y))
if (t <= (-255.0d0)) then
tmp = t_1
else if (t <= 2.35d-80) then
tmp = x * (z ** y)
else if (t <= 1.15d+134) then
tmp = x * exp((a * -b))
else
tmp = 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 = x * Math.exp((t * -y));
double tmp;
if (t <= -255.0) {
tmp = t_1;
} else if (t <= 2.35e-80) {
tmp = x * Math.pow(z, y);
} else if (t <= 1.15e+134) {
tmp = x * Math.exp((a * -b));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = x * math.exp((t * -y)) tmp = 0 if t <= -255.0: tmp = t_1 elif t <= 2.35e-80: tmp = x * math.pow(z, y) elif t <= 1.15e+134: tmp = x * math.exp((a * -b)) else: tmp = t_1 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(x * exp(Float64(t * Float64(-y)))) tmp = 0.0 if (t <= -255.0) tmp = t_1; elseif (t <= 2.35e-80) tmp = Float64(x * (z ^ y)); elseif (t <= 1.15e+134) tmp = Float64(x * exp(Float64(a * Float64(-b)))); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = x * exp((t * -y)); tmp = 0.0; if (t <= -255.0) tmp = t_1; elseif (t <= 2.35e-80) tmp = x * (z ^ y); elseif (t <= 1.15e+134) tmp = x * exp((a * -b)); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(x * N[Exp[N[(t * (-y)), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -255.0], t$95$1, If[LessEqual[t, 2.35e-80], N[(x * N[Power[z, y], $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 1.15e+134], N[(x * N[Exp[N[(a * (-b)), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot e^{t \cdot \left(-y\right)}\\
\mathbf{if}\;t \leq -255:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 2.35 \cdot 10^{-80}:\\
\;\;\;\;x \cdot {z}^{y}\\
\mathbf{elif}\;t \leq 1.15 \cdot 10^{+134}:\\
\;\;\;\;x \cdot e^{a \cdot \left(-b\right)}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t < -255 or 1.1499999999999999e134 < t Initial program 96.7%
Taylor expanded in z around 0 97.7%
+-commutative97.7%
associate-*r*97.7%
associate-*r*97.7%
distribute-lft-out97.7%
mul-1-neg97.7%
Simplified97.7%
Taylor expanded in t around inf 84.1%
associate-*r*84.1%
neg-mul-184.1%
Simplified84.1%
if -255 < t < 2.34999999999999986e-80Initial program 97.4%
fma-define97.4%
sub-neg97.4%
log1p-define99.9%
Simplified99.9%
Taylor expanded in a around 0 72.0%
Taylor expanded in t around 0 72.1%
if 2.34999999999999986e-80 < t < 1.1499999999999999e134Initial program 96.1%
Taylor expanded in z around 0 98.0%
+-commutative98.0%
associate-*r*98.0%
associate-*r*98.0%
distribute-lft-out98.0%
mul-1-neg98.0%
Simplified98.0%
Taylor expanded in b around inf 73.9%
associate-*r*73.9%
mul-1-neg73.9%
Simplified73.9%
Final simplification76.8%
(FPCore (x y z t a b) :precision binary64 (if (or (<= y -3.4e+52) (not (<= y 2.2e-7))) (* x (pow z y)) (* x (exp (* a (- b))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((y <= -3.4e+52) || !(y <= 2.2e-7)) {
tmp = x * pow(z, y);
} else {
tmp = x * exp((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 ((y <= (-3.4d+52)) .or. (.not. (y <= 2.2d-7))) then
tmp = x * (z ** y)
else
tmp = x * exp((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 ((y <= -3.4e+52) || !(y <= 2.2e-7)) {
tmp = x * Math.pow(z, y);
} else {
tmp = x * Math.exp((a * -b));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (y <= -3.4e+52) or not (y <= 2.2e-7): tmp = x * math.pow(z, y) else: tmp = x * math.exp((a * -b)) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((y <= -3.4e+52) || !(y <= 2.2e-7)) tmp = Float64(x * (z ^ y)); else tmp = Float64(x * exp(Float64(a * Float64(-b)))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((y <= -3.4e+52) || ~((y <= 2.2e-7))) tmp = x * (z ^ y); else tmp = x * exp((a * -b)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[y, -3.4e+52], N[Not[LessEqual[y, 2.2e-7]], $MachinePrecision]], N[(x * N[Power[z, y], $MachinePrecision]), $MachinePrecision], N[(x * N[Exp[N[(a * (-b)), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -3.4 \cdot 10^{+52} \lor \neg \left(y \leq 2.2 \cdot 10^{-7}\right):\\
\;\;\;\;x \cdot {z}^{y}\\
\mathbf{else}:\\
\;\;\;\;x \cdot e^{a \cdot \left(-b\right)}\\
\end{array}
\end{array}
if y < -3.4e52 or 2.2000000000000001e-7 < y Initial program 97.6%
fma-define98.4%
sub-neg98.4%
log1p-define98.4%
Simplified98.4%
Taylor expanded in a around 0 88.1%
Taylor expanded in t around 0 69.8%
if -3.4e52 < y < 2.2000000000000001e-7Initial program 96.2%
Taylor expanded in z around 0 99.8%
+-commutative99.8%
associate-*r*99.8%
associate-*r*99.8%
distribute-lft-out99.8%
mul-1-neg99.8%
Simplified99.8%
Taylor expanded in b around inf 78.0%
associate-*r*78.0%
mul-1-neg78.0%
Simplified78.0%
Final simplification74.0%
(FPCore (x y z t a b) :precision binary64 (if (<= t -1.35e+87) (* x (- 1.0 (* y t))) (* x (pow z y))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (t <= -1.35e+87) {
tmp = x * (1.0 - (y * t));
} else {
tmp = x * pow(z, 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 (t <= (-1.35d+87)) then
tmp = x * (1.0d0 - (y * t))
else
tmp = x * (z ** 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 (t <= -1.35e+87) {
tmp = x * (1.0 - (y * t));
} else {
tmp = x * Math.pow(z, y);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if t <= -1.35e+87: tmp = x * (1.0 - (y * t)) else: tmp = x * math.pow(z, y) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (t <= -1.35e+87) tmp = Float64(x * Float64(1.0 - Float64(y * t))); else tmp = Float64(x * (z ^ y)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (t <= -1.35e+87) tmp = x * (1.0 - (y * t)); else tmp = x * (z ^ y); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[t, -1.35e+87], N[(x * N[(1.0 - N[(y * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x * N[Power[z, y], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.35 \cdot 10^{+87}:\\
\;\;\;\;x \cdot \left(1 - y \cdot t\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot {z}^{y}\\
\end{array}
\end{array}
if t < -1.35000000000000003e87Initial program 94.3%
Taylor expanded in z around 0 94.3%
+-commutative94.3%
associate-*r*94.3%
associate-*r*94.3%
distribute-lft-out94.3%
mul-1-neg94.3%
Simplified94.3%
Taylor expanded in t around inf 89.5%
associate-*r*89.5%
neg-mul-189.5%
Simplified89.5%
Taylor expanded in t around 0 31.9%
mul-1-neg31.9%
*-commutative31.9%
unsub-neg31.9%
Simplified31.9%
if -1.35000000000000003e87 < t Initial program 97.3%
fma-define97.8%
sub-neg97.8%
log1p-define99.9%
Simplified99.9%
Taylor expanded in a around 0 70.5%
Taylor expanded in t around 0 63.0%
(FPCore (x y z t a b) :precision binary64 (if (or (<= t -4.8e+51) (not (<= t 4.3e+145))) (* x (- 1.0 (* y t))) (* b (- (/ x b) (* x a)))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((t <= -4.8e+51) || !(t <= 4.3e+145)) {
tmp = x * (1.0 - (y * t));
} else {
tmp = b * ((x / b) - (x * a));
}
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 ((t <= (-4.8d+51)) .or. (.not. (t <= 4.3d+145))) then
tmp = x * (1.0d0 - (y * t))
else
tmp = b * ((x / b) - (x * a))
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 ((t <= -4.8e+51) || !(t <= 4.3e+145)) {
tmp = x * (1.0 - (y * t));
} else {
tmp = b * ((x / b) - (x * a));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (t <= -4.8e+51) or not (t <= 4.3e+145): tmp = x * (1.0 - (y * t)) else: tmp = b * ((x / b) - (x * a)) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((t <= -4.8e+51) || !(t <= 4.3e+145)) tmp = Float64(x * Float64(1.0 - Float64(y * t))); else tmp = Float64(b * Float64(Float64(x / b) - Float64(x * a))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((t <= -4.8e+51) || ~((t <= 4.3e+145))) tmp = x * (1.0 - (y * t)); else tmp = b * ((x / b) - (x * a)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[t, -4.8e+51], N[Not[LessEqual[t, 4.3e+145]], $MachinePrecision]], N[(x * N[(1.0 - N[(y * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(b * N[(N[(x / b), $MachinePrecision] - N[(x * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -4.8 \cdot 10^{+51} \lor \neg \left(t \leq 4.3 \cdot 10^{+145}\right):\\
\;\;\;\;x \cdot \left(1 - y \cdot t\right)\\
\mathbf{else}:\\
\;\;\;\;b \cdot \left(\frac{x}{b} - x \cdot a\right)\\
\end{array}
\end{array}
if t < -4.7999999999999997e51 or 4.29999999999999998e145 < t Initial program 96.1%
Taylor expanded in z around 0 97.3%
+-commutative97.3%
associate-*r*97.3%
associate-*r*97.3%
distribute-lft-out97.3%
mul-1-neg97.3%
Simplified97.3%
Taylor expanded in t around inf 86.3%
associate-*r*86.3%
neg-mul-186.3%
Simplified86.3%
Taylor expanded in t around 0 34.2%
mul-1-neg34.2%
*-commutative34.2%
unsub-neg34.2%
Simplified34.2%
if -4.7999999999999997e51 < t < 4.29999999999999998e145Initial program 97.2%
Taylor expanded in z around 0 99.4%
+-commutative99.4%
associate-*r*99.4%
associate-*r*99.4%
distribute-lft-out99.4%
mul-1-neg99.4%
Simplified99.4%
Taylor expanded in b around inf 66.2%
associate-*r*66.2%
mul-1-neg66.2%
Simplified66.2%
Taylor expanded in a around 0 32.1%
neg-mul-132.1%
unsub-neg32.1%
Simplified32.1%
Taylor expanded in b around inf 33.1%
+-commutative33.1%
mul-1-neg33.1%
unsub-neg33.1%
*-commutative33.1%
Simplified33.1%
Final simplification33.4%
(FPCore (x y z t a b) :precision binary64 (if (or (<= t -7.6e+90) (not (<= t 2.95e+147))) (* y (* t (- x))) (* x (- 1.0 (* a b)))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((t <= -7.6e+90) || !(t <= 2.95e+147)) {
tmp = y * (t * -x);
} else {
tmp = x * (1.0 - (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 ((t <= (-7.6d+90)) .or. (.not. (t <= 2.95d+147))) then
tmp = y * (t * -x)
else
tmp = x * (1.0d0 - (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 ((t <= -7.6e+90) || !(t <= 2.95e+147)) {
tmp = y * (t * -x);
} else {
tmp = x * (1.0 - (a * b));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (t <= -7.6e+90) or not (t <= 2.95e+147): tmp = y * (t * -x) else: tmp = x * (1.0 - (a * b)) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((t <= -7.6e+90) || !(t <= 2.95e+147)) tmp = Float64(y * Float64(t * Float64(-x))); else tmp = Float64(x * Float64(1.0 - Float64(a * b))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((t <= -7.6e+90) || ~((t <= 2.95e+147))) tmp = y * (t * -x); else tmp = x * (1.0 - (a * b)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[t, -7.6e+90], N[Not[LessEqual[t, 2.95e+147]], $MachinePrecision]], N[(y * N[(t * (-x)), $MachinePrecision]), $MachinePrecision], N[(x * N[(1.0 - N[(a * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -7.6 \cdot 10^{+90} \lor \neg \left(t \leq 2.95 \cdot 10^{+147}\right):\\
\;\;\;\;y \cdot \left(t \cdot \left(-x\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(1 - a \cdot b\right)\\
\end{array}
\end{array}
if t < -7.6000000000000002e90 or 2.9500000000000001e147 < t Initial program 96.9%
Taylor expanded in z around 0 96.9%
+-commutative96.9%
associate-*r*96.9%
associate-*r*96.9%
distribute-lft-out96.9%
mul-1-neg96.9%
Simplified96.9%
Taylor expanded in t around inf 88.8%
associate-*r*88.8%
neg-mul-188.8%
Simplified88.8%
Taylor expanded in t around 0 26.0%
mul-1-neg26.0%
unsub-neg26.0%
Simplified26.0%
Taylor expanded in t around inf 27.2%
mul-1-neg27.2%
associate-*r*29.9%
*-commutative29.9%
distribute-rgt-neg-in29.9%
mul-1-neg29.9%
associate-*r*29.9%
neg-mul-129.9%
Simplified29.9%
if -7.6000000000000002e90 < t < 2.9500000000000001e147Initial program 96.9%
Taylor expanded in z around 0 99.4%
+-commutative99.4%
associate-*r*99.4%
associate-*r*99.4%
distribute-lft-out99.4%
mul-1-neg99.4%
Simplified99.4%
Taylor expanded in b around inf 66.3%
associate-*r*66.3%
mul-1-neg66.3%
Simplified66.3%
Taylor expanded in a around 0 32.2%
neg-mul-132.2%
unsub-neg32.2%
Simplified32.2%
Final simplification31.6%
(FPCore (x y z t a b) :precision binary64 (if (<= b -4.5e+31) (* x (- 1.0 (* a b))) (if (<= b 4.8e+146) (* x (- 1.0 (* y t))) (* t (* x (- y))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (b <= -4.5e+31) {
tmp = x * (1.0 - (a * b));
} else if (b <= 4.8e+146) {
tmp = x * (1.0 - (y * t));
} else {
tmp = t * (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 <= (-4.5d+31)) then
tmp = x * (1.0d0 - (a * b))
else if (b <= 4.8d+146) then
tmp = x * (1.0d0 - (y * t))
else
tmp = t * (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 <= -4.5e+31) {
tmp = x * (1.0 - (a * b));
} else if (b <= 4.8e+146) {
tmp = x * (1.0 - (y * t));
} else {
tmp = t * (x * -y);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if b <= -4.5e+31: tmp = x * (1.0 - (a * b)) elif b <= 4.8e+146: tmp = x * (1.0 - (y * t)) else: tmp = t * (x * -y) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (b <= -4.5e+31) tmp = Float64(x * Float64(1.0 - Float64(a * b))); elseif (b <= 4.8e+146) tmp = Float64(x * Float64(1.0 - Float64(y * t))); else tmp = Float64(t * Float64(x * Float64(-y))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (b <= -4.5e+31) tmp = x * (1.0 - (a * b)); elseif (b <= 4.8e+146) tmp = x * (1.0 - (y * t)); else tmp = t * (x * -y); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[b, -4.5e+31], N[(x * N[(1.0 - N[(a * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 4.8e+146], N[(x * N[(1.0 - N[(y * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t * N[(x * (-y)), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq -4.5 \cdot 10^{+31}:\\
\;\;\;\;x \cdot \left(1 - a \cdot b\right)\\
\mathbf{elif}\;b \leq 4.8 \cdot 10^{+146}:\\
\;\;\;\;x \cdot \left(1 - y \cdot t\right)\\
\mathbf{else}:\\
\;\;\;\;t \cdot \left(x \cdot \left(-y\right)\right)\\
\end{array}
\end{array}
if b < -4.4999999999999996e31Initial program 96.9%
Taylor expanded in z around 0 96.9%
+-commutative96.9%
associate-*r*96.9%
associate-*r*96.9%
distribute-lft-out96.9%
mul-1-neg96.9%
Simplified96.9%
Taylor expanded in b around inf 75.0%
associate-*r*75.0%
mul-1-neg75.0%
Simplified75.0%
Taylor expanded in a around 0 32.3%
neg-mul-132.3%
unsub-neg32.3%
Simplified32.3%
if -4.4999999999999996e31 < b < 4.8000000000000004e146Initial program 97.0%
Taylor expanded in z around 0 99.9%
+-commutative99.9%
associate-*r*99.9%
associate-*r*99.9%
distribute-lft-out99.9%
mul-1-neg99.9%
Simplified99.9%
Taylor expanded in t around inf 61.2%
associate-*r*61.2%
neg-mul-161.2%
Simplified61.2%
Taylor expanded in t around 0 33.5%
mul-1-neg33.5%
*-commutative33.5%
unsub-neg33.5%
Simplified33.5%
if 4.8000000000000004e146 < b Initial program 96.0%
Taylor expanded in z around 0 96.0%
+-commutative96.0%
associate-*r*96.0%
associate-*r*96.0%
distribute-lft-out96.0%
mul-1-neg96.0%
Simplified96.0%
Taylor expanded in t around inf 46.3%
associate-*r*46.3%
neg-mul-146.3%
Simplified46.3%
Taylor expanded in t around 0 11.2%
mul-1-neg11.2%
unsub-neg11.2%
Simplified11.2%
Taylor expanded in t around inf 30.0%
Final simplification32.9%
(FPCore (x y z t a b) :precision binary64 (if (or (<= y -1.65e+151) (not (<= y 8200.0))) (* x (* a (- b))) x))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((y <= -1.65e+151) || !(y <= 8200.0)) {
tmp = x * (a * -b);
} else {
tmp = x;
}
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.65d+151)) .or. (.not. (y <= 8200.0d0))) then
tmp = x * (a * -b)
else
tmp = x
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.65e+151) || !(y <= 8200.0)) {
tmp = x * (a * -b);
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (y <= -1.65e+151) or not (y <= 8200.0): tmp = x * (a * -b) else: tmp = x return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((y <= -1.65e+151) || !(y <= 8200.0)) tmp = Float64(x * Float64(a * Float64(-b))); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((y <= -1.65e+151) || ~((y <= 8200.0))) tmp = x * (a * -b); else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[y, -1.65e+151], N[Not[LessEqual[y, 8200.0]], $MachinePrecision]], N[(x * N[(a * (-b)), $MachinePrecision]), $MachinePrecision], x]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.65 \cdot 10^{+151} \lor \neg \left(y \leq 8200\right):\\
\;\;\;\;x \cdot \left(a \cdot \left(-b\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if y < -1.65000000000000012e151 or 8200 < y Initial program 97.0%
Taylor expanded in z around 0 97.0%
+-commutative97.0%
associate-*r*97.0%
associate-*r*97.0%
distribute-lft-out97.0%
mul-1-neg97.0%
Simplified97.0%
Taylor expanded in b around inf 36.3%
associate-*r*36.3%
mul-1-neg36.3%
Simplified36.3%
Taylor expanded in a around 0 14.8%
neg-mul-114.8%
unsub-neg14.8%
Simplified14.8%
Taylor expanded in a around inf 22.9%
mul-1-neg22.9%
distribute-rgt-neg-out22.9%
Simplified22.9%
if -1.65000000000000012e151 < y < 8200Initial program 96.8%
fma-define96.8%
sub-neg96.8%
log1p-define99.9%
Simplified99.9%
Taylor expanded in a around 0 65.8%
Taylor expanded in y around 0 29.1%
Final simplification26.7%
(FPCore (x y z t a b) :precision binary64 (if (<= y -2.1e-22) (* t (* x (- y))) (if (<= y 8200.0) x (* x (* a (- b))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (y <= -2.1e-22) {
tmp = t * (x * -y);
} else if (y <= 8200.0) {
tmp = x;
} else {
tmp = x * (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 (y <= (-2.1d-22)) then
tmp = t * (x * -y)
else if (y <= 8200.0d0) then
tmp = x
else
tmp = x * (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 (y <= -2.1e-22) {
tmp = t * (x * -y);
} else if (y <= 8200.0) {
tmp = x;
} else {
tmp = x * (a * -b);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if y <= -2.1e-22: tmp = t * (x * -y) elif y <= 8200.0: tmp = x else: tmp = x * (a * -b) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (y <= -2.1e-22) tmp = Float64(t * Float64(x * Float64(-y))); elseif (y <= 8200.0) tmp = x; else tmp = Float64(x * Float64(a * Float64(-b))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (y <= -2.1e-22) tmp = t * (x * -y); elseif (y <= 8200.0) tmp = x; else tmp = x * (a * -b); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[y, -2.1e-22], N[(t * N[(x * (-y)), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 8200.0], x, N[(x * N[(a * (-b)), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -2.1 \cdot 10^{-22}:\\
\;\;\;\;t \cdot \left(x \cdot \left(-y\right)\right)\\
\mathbf{elif}\;y \leq 8200:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(a \cdot \left(-b\right)\right)\\
\end{array}
\end{array}
if y < -2.10000000000000008e-22Initial program 97.3%
Taylor expanded in z around 0 98.6%
+-commutative98.6%
associate-*r*98.6%
associate-*r*98.6%
distribute-lft-out98.6%
mul-1-neg98.6%
Simplified98.6%
Taylor expanded in t around inf 55.8%
associate-*r*55.8%
neg-mul-155.8%
Simplified55.8%
Taylor expanded in t around 0 18.0%
mul-1-neg18.0%
unsub-neg18.0%
Simplified18.0%
Taylor expanded in t around inf 18.9%
if -2.10000000000000008e-22 < y < 8200Initial program 96.6%
fma-define96.6%
sub-neg96.6%
log1p-define99.9%
Simplified99.9%
Taylor expanded in a around 0 58.4%
Taylor expanded in y around 0 38.4%
if 8200 < y Initial program 96.9%
Taylor expanded in z around 0 96.9%
+-commutative96.9%
associate-*r*96.9%
associate-*r*96.9%
distribute-lft-out96.9%
mul-1-neg96.9%
Simplified96.9%
Taylor expanded in b around inf 36.2%
associate-*r*36.2%
mul-1-neg36.2%
Simplified36.2%
Taylor expanded in a around 0 13.7%
neg-mul-113.7%
unsub-neg13.7%
Simplified13.7%
Taylor expanded in a around inf 25.3%
mul-1-neg25.3%
distribute-rgt-neg-out25.3%
Simplified25.3%
Final simplification29.2%
(FPCore (x y z t a b) :precision binary64 (if (<= y -2.3e-81) (* y (* t (- x))) (if (<= y 8200.0) x (* x (* a (- b))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (y <= -2.3e-81) {
tmp = y * (t * -x);
} else if (y <= 8200.0) {
tmp = x;
} else {
tmp = x * (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 (y <= (-2.3d-81)) then
tmp = y * (t * -x)
else if (y <= 8200.0d0) then
tmp = x
else
tmp = x * (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 (y <= -2.3e-81) {
tmp = y * (t * -x);
} else if (y <= 8200.0) {
tmp = x;
} else {
tmp = x * (a * -b);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if y <= -2.3e-81: tmp = y * (t * -x) elif y <= 8200.0: tmp = x else: tmp = x * (a * -b) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (y <= -2.3e-81) tmp = Float64(y * Float64(t * Float64(-x))); elseif (y <= 8200.0) tmp = x; else tmp = Float64(x * Float64(a * Float64(-b))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (y <= -2.3e-81) tmp = y * (t * -x); elseif (y <= 8200.0) tmp = x; else tmp = x * (a * -b); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[y, -2.3e-81], N[(y * N[(t * (-x)), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 8200.0], x, N[(x * N[(a * (-b)), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -2.3 \cdot 10^{-81}:\\
\;\;\;\;y \cdot \left(t \cdot \left(-x\right)\right)\\
\mathbf{elif}\;y \leq 8200:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(a \cdot \left(-b\right)\right)\\
\end{array}
\end{array}
if y < -2.29999999999999991e-81Initial program 97.7%
Taylor expanded in z around 0 98.8%
+-commutative98.8%
associate-*r*98.8%
associate-*r*98.8%
distribute-lft-out98.8%
mul-1-neg98.8%
Simplified98.8%
Taylor expanded in t around inf 55.7%
associate-*r*55.7%
neg-mul-155.7%
Simplified55.7%
Taylor expanded in t around 0 19.2%
mul-1-neg19.2%
unsub-neg19.2%
Simplified19.2%
Taylor expanded in t around inf 19.0%
mul-1-neg19.0%
associate-*r*16.8%
*-commutative16.8%
distribute-rgt-neg-in16.8%
mul-1-neg16.8%
associate-*r*16.8%
neg-mul-116.8%
Simplified16.8%
if -2.29999999999999991e-81 < y < 8200Initial program 96.2%
fma-define96.2%
sub-neg96.2%
log1p-define99.9%
Simplified99.9%
Taylor expanded in a around 0 58.8%
Taylor expanded in y around 0 40.0%
if 8200 < y Initial program 96.9%
Taylor expanded in z around 0 96.9%
+-commutative96.9%
associate-*r*96.9%
associate-*r*96.9%
distribute-lft-out96.9%
mul-1-neg96.9%
Simplified96.9%
Taylor expanded in b around inf 36.2%
associate-*r*36.2%
mul-1-neg36.2%
Simplified36.2%
Taylor expanded in a around 0 13.7%
neg-mul-113.7%
unsub-neg13.7%
Simplified13.7%
Taylor expanded in a around inf 25.3%
mul-1-neg25.3%
distribute-rgt-neg-out25.3%
Simplified25.3%
Final simplification28.2%
(FPCore (x y z t a b) :precision binary64 x)
double code(double x, double y, double z, double t, double a, double b) {
return x;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
code = x
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return x;
}
def code(x, y, z, t, a, b): return x
function code(x, y, z, t, a, b) return x end
function tmp = code(x, y, z, t, a, b) tmp = x; end
code[x_, y_, z_, t_, a_, b_] := x
\begin{array}{l}
\\
x
\end{array}
Initial program 96.9%
fma-define97.3%
sub-neg97.3%
log1p-define99.1%
Simplified99.1%
Taylor expanded in a around 0 73.2%
Taylor expanded in y around 0 19.3%
herbie shell --seed 2024172
(FPCore (x y z t a b)
:name "Numeric.SpecFunctions:incompleteBetaApprox from math-functions-0.1.5.2, B"
:precision binary64
(* x (exp (+ (* y (- (log z) t)) (* a (- (log (- 1.0 z)) b))))))