
(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 11 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 (- (* 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.5%
Taylor expanded in z around 0 99.9%
associate-*r*99.9%
associate-*r*99.9%
distribute-lft-out99.9%
mul-1-neg99.9%
Simplified99.9%
Final simplification99.9%
(FPCore (x y z t a b) :precision binary64 (if (or (<= y -9e-20) (not (<= y 6.4e+52))) (* x (exp (* y (- (log z) t)))) (* x (exp (* a (- (- b) z))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((y <= -9e-20) || !(y <= 6.4e+52)) {
tmp = x * exp((y * (log(z) - t)));
} else {
tmp = x * exp((a * (-b - 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 ((y <= (-9d-20)) .or. (.not. (y <= 6.4d+52))) then
tmp = x * exp((y * (log(z) - t)))
else
tmp = x * exp((a * (-b - 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 ((y <= -9e-20) || !(y <= 6.4e+52)) {
tmp = x * Math.exp((y * (Math.log(z) - t)));
} else {
tmp = x * Math.exp((a * (-b - z)));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (y <= -9e-20) or not (y <= 6.4e+52): tmp = x * math.exp((y * (math.log(z) - t))) else: tmp = x * math.exp((a * (-b - z))) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((y <= -9e-20) || !(y <= 6.4e+52)) tmp = Float64(x * exp(Float64(y * Float64(log(z) - t)))); else tmp = Float64(x * exp(Float64(a * Float64(Float64(-b) - z)))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((y <= -9e-20) || ~((y <= 6.4e+52))) tmp = x * exp((y * (log(z) - t))); else tmp = x * exp((a * (-b - z))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[y, -9e-20], N[Not[LessEqual[y, 6.4e+52]], $MachinePrecision]], N[(x * N[Exp[N[(y * N[(N[Log[z], $MachinePrecision] - t), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(x * N[Exp[N[(a * N[((-b) - z), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -9 \cdot 10^{-20} \lor \neg \left(y \leq 6.4 \cdot 10^{+52}\right):\\
\;\;\;\;x \cdot e^{y \cdot \left(\log z - t\right)}\\
\mathbf{else}:\\
\;\;\;\;x \cdot e^{a \cdot \left(\left(-b\right) - z\right)}\\
\end{array}
\end{array}
if y < -9.0000000000000003e-20 or 6.4e52 < y Initial program 100.0%
Taylor expanded in a around 0 94.9%
if -9.0000000000000003e-20 < y < 6.4e52Initial program 93.6%
Taylor expanded in z around 0 99.9%
associate-*r*99.9%
associate-*r*99.9%
distribute-lft-out99.9%
mul-1-neg99.9%
Simplified99.9%
Taylor expanded in y around 0 91.5%
mul-1-neg91.5%
+-commutative91.5%
distribute-lft-neg-in91.5%
+-commutative91.5%
Simplified91.5%
Final simplification93.0%
(FPCore (x y z t a b) :precision binary64 (if (or (<= y -16500000000000.0) (not (<= y 4e+60))) (* x (pow z y)) (* x (exp (* a (- (- b) z))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((y <= -16500000000000.0) || !(y <= 4e+60)) {
tmp = x * pow(z, y);
} else {
tmp = x * exp((a * (-b - 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 ((y <= (-16500000000000.0d0)) .or. (.not. (y <= 4d+60))) then
tmp = x * (z ** y)
else
tmp = x * exp((a * (-b - 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 ((y <= -16500000000000.0) || !(y <= 4e+60)) {
tmp = x * Math.pow(z, y);
} else {
tmp = x * Math.exp((a * (-b - z)));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (y <= -16500000000000.0) or not (y <= 4e+60): tmp = x * math.pow(z, y) else: tmp = x * math.exp((a * (-b - z))) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((y <= -16500000000000.0) || !(y <= 4e+60)) tmp = Float64(x * (z ^ y)); else tmp = Float64(x * exp(Float64(a * Float64(Float64(-b) - z)))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((y <= -16500000000000.0) || ~((y <= 4e+60))) tmp = x * (z ^ y); else tmp = x * exp((a * (-b - z))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[y, -16500000000000.0], N[Not[LessEqual[y, 4e+60]], $MachinePrecision]], N[(x * N[Power[z, y], $MachinePrecision]), $MachinePrecision], N[(x * N[Exp[N[(a * N[((-b) - z), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -16500000000000 \lor \neg \left(y \leq 4 \cdot 10^{+60}\right):\\
\;\;\;\;x \cdot {z}^{y}\\
\mathbf{else}:\\
\;\;\;\;x \cdot e^{a \cdot \left(\left(-b\right) - z\right)}\\
\end{array}
\end{array}
if y < -1.65e13 or 3.9999999999999998e60 < y Initial program 100.0%
Taylor expanded in a around 0 95.4%
Taylor expanded in t around 0 78.8%
*-commutative78.8%
Simplified78.8%
if -1.65e13 < y < 3.9999999999999998e60Initial program 94.0%
Taylor expanded in z around 0 99.9%
associate-*r*99.9%
associate-*r*99.9%
distribute-lft-out99.9%
mul-1-neg99.9%
Simplified99.9%
Taylor expanded in y around 0 88.3%
mul-1-neg88.3%
+-commutative88.3%
distribute-lft-neg-in88.3%
+-commutative88.3%
Simplified88.3%
Final simplification84.3%
(FPCore (x y z t a b) :precision binary64 (if (or (<= y -16000000000000.0) (not (<= y 7.2e+60))) (* 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 <= -16000000000000.0) || !(y <= 7.2e+60)) {
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 <= (-16000000000000.0d0)) .or. (.not. (y <= 7.2d+60))) 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 <= -16000000000000.0) || !(y <= 7.2e+60)) {
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 <= -16000000000000.0) or not (y <= 7.2e+60): 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 <= -16000000000000.0) || !(y <= 7.2e+60)) 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 <= -16000000000000.0) || ~((y <= 7.2e+60))) 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, -16000000000000.0], N[Not[LessEqual[y, 7.2e+60]], $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 -16000000000000 \lor \neg \left(y \leq 7.2 \cdot 10^{+60}\right):\\
\;\;\;\;x \cdot {z}^{y}\\
\mathbf{else}:\\
\;\;\;\;x \cdot e^{a \cdot \left(-b\right)}\\
\end{array}
\end{array}
if y < -1.6e13 or 7.19999999999999935e60 < y Initial program 100.0%
Taylor expanded in a around 0 95.4%
Taylor expanded in t around 0 78.8%
*-commutative78.8%
Simplified78.8%
if -1.6e13 < y < 7.19999999999999935e60Initial program 94.0%
Taylor expanded in z around 0 99.9%
associate-*r*99.9%
associate-*r*99.9%
distribute-lft-out99.9%
mul-1-neg99.9%
Simplified99.9%
Taylor expanded in b around inf 82.4%
associate-*r*82.4%
mul-1-neg82.4%
Simplified82.4%
Final simplification80.9%
(FPCore (x y z t a b) :precision binary64 (if (or (<= y -5e-21) (not (<= y 6.4e+52))) (* x (pow z y)) (* x (- 1.0 (* a (+ z b))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((y <= -5e-21) || !(y <= 6.4e+52)) {
tmp = x * pow(z, y);
} else {
tmp = x * (1.0 - (a * (z + 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 <= (-5d-21)) .or. (.not. (y <= 6.4d+52))) then
tmp = x * (z ** y)
else
tmp = x * (1.0d0 - (a * (z + 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 <= -5e-21) || !(y <= 6.4e+52)) {
tmp = x * Math.pow(z, y);
} else {
tmp = x * (1.0 - (a * (z + b)));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (y <= -5e-21) or not (y <= 6.4e+52): tmp = x * math.pow(z, y) else: tmp = x * (1.0 - (a * (z + b))) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((y <= -5e-21) || !(y <= 6.4e+52)) tmp = Float64(x * (z ^ y)); else tmp = Float64(x * Float64(1.0 - Float64(a * Float64(z + b)))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((y <= -5e-21) || ~((y <= 6.4e+52))) tmp = x * (z ^ y); else tmp = x * (1.0 - (a * (z + b))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[y, -5e-21], N[Not[LessEqual[y, 6.4e+52]], $MachinePrecision]], N[(x * N[Power[z, y], $MachinePrecision]), $MachinePrecision], N[(x * N[(1.0 - N[(a * N[(z + b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -5 \cdot 10^{-21} \lor \neg \left(y \leq 6.4 \cdot 10^{+52}\right):\\
\;\;\;\;x \cdot {z}^{y}\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(1 - a \cdot \left(z + b\right)\right)\\
\end{array}
\end{array}
if y < -4.99999999999999973e-21 or 6.4e52 < y Initial program 100.0%
Taylor expanded in a around 0 95.0%
Taylor expanded in t around 0 74.9%
*-commutative74.9%
Simplified74.9%
if -4.99999999999999973e-21 < y < 6.4e52Initial program 93.6%
Taylor expanded in z around 0 99.9%
associate-*r*99.9%
associate-*r*99.9%
distribute-lft-out99.9%
mul-1-neg99.9%
Simplified99.9%
Taylor expanded in y around 0 91.4%
mul-1-neg91.4%
+-commutative91.4%
distribute-lft-neg-in91.4%
+-commutative91.4%
Simplified91.4%
Taylor expanded in a around 0 44.1%
mul-1-neg44.1%
unsub-neg44.1%
Simplified44.1%
Final simplification58.2%
(FPCore (x y z t a b) :precision binary64 (if (or (<= y -0.00066) (not (<= y 6.6e-29))) (* a (* x (- b))) x))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((y <= -0.00066) || !(y <= 6.6e-29)) {
tmp = a * (x * -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 <= (-0.00066d0)) .or. (.not. (y <= 6.6d-29))) then
tmp = a * (x * -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 <= -0.00066) || !(y <= 6.6e-29)) {
tmp = a * (x * -b);
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (y <= -0.00066) or not (y <= 6.6e-29): tmp = a * (x * -b) else: tmp = x return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((y <= -0.00066) || !(y <= 6.6e-29)) tmp = Float64(a * Float64(x * Float64(-b))); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((y <= -0.00066) || ~((y <= 6.6e-29))) tmp = a * (x * -b); else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[y, -0.00066], N[Not[LessEqual[y, 6.6e-29]], $MachinePrecision]], N[(a * N[(x * (-b)), $MachinePrecision]), $MachinePrecision], x]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -0.00066 \lor \neg \left(y \leq 6.6 \cdot 10^{-29}\right):\\
\;\;\;\;a \cdot \left(x \cdot \left(-b\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if y < -6.6e-4 or 6.60000000000000055e-29 < y Initial program 100.0%
Taylor expanded in z around 0 100.0%
associate-*r*100.0%
associate-*r*100.0%
distribute-lft-out100.0%
mul-1-neg100.0%
Simplified100.0%
Taylor expanded in b around inf 37.2%
associate-*r*37.2%
mul-1-neg37.2%
Simplified37.2%
Taylor expanded in a around 0 13.0%
mul-1-neg13.0%
unsub-neg13.0%
Simplified13.0%
Taylor expanded in a around inf 26.4%
neg-mul-126.4%
distribute-lft-neg-in26.4%
Simplified26.4%
if -6.6e-4 < y < 6.60000000000000055e-29Initial program 92.8%
Taylor expanded in a around 0 49.5%
Taylor expanded in y around 0 34.9%
Final simplification30.5%
(FPCore (x y z t a b) :precision binary64 (if (or (<= y -0.00082) (not (<= y 2.45e-42))) (* (* x a) (- b)) x))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((y <= -0.00082) || !(y <= 2.45e-42)) {
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 <= (-0.00082d0)) .or. (.not. (y <= 2.45d-42))) 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 <= -0.00082) || !(y <= 2.45e-42)) {
tmp = (x * a) * -b;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (y <= -0.00082) or not (y <= 2.45e-42): tmp = (x * a) * -b else: tmp = x return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((y <= -0.00082) || !(y <= 2.45e-42)) tmp = Float64(Float64(x * 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 <= -0.00082) || ~((y <= 2.45e-42))) tmp = (x * a) * -b; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[y, -0.00082], N[Not[LessEqual[y, 2.45e-42]], $MachinePrecision]], N[(N[(x * a), $MachinePrecision] * (-b)), $MachinePrecision], x]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -0.00082 \lor \neg \left(y \leq 2.45 \cdot 10^{-42}\right):\\
\;\;\;\;\left(x \cdot a\right) \cdot \left(-b\right)\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if y < -8.1999999999999998e-4 or 2.45e-42 < y Initial program 100.0%
Taylor expanded in z around 0 100.0%
associate-*r*100.0%
associate-*r*100.0%
distribute-lft-out100.0%
mul-1-neg100.0%
Simplified100.0%
Taylor expanded in b around inf 37.2%
associate-*r*37.2%
mul-1-neg37.2%
Simplified37.2%
Taylor expanded in a around 0 13.0%
mul-1-neg13.0%
unsub-neg13.0%
Simplified13.0%
Taylor expanded in a around inf 26.4%
neg-mul-126.4%
*-commutative26.4%
associate-*r*28.5%
distribute-rgt-neg-in28.5%
Simplified28.5%
if -8.1999999999999998e-4 < y < 2.45e-42Initial program 92.8%
Taylor expanded in a around 0 49.5%
Taylor expanded in y around 0 34.9%
Final simplification31.6%
(FPCore (x y z t a b) :precision binary64 (if (<= y 4e-28) (* x (- 1.0 (* a (+ z b)))) (* (* x a) (- b))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (y <= 4e-28) {
tmp = x * (1.0 - (a * (z + b)));
} 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 <= 4d-28) then
tmp = x * (1.0d0 - (a * (z + b)))
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 <= 4e-28) {
tmp = x * (1.0 - (a * (z + b)));
} else {
tmp = (x * a) * -b;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if y <= 4e-28: tmp = x * (1.0 - (a * (z + b))) else: tmp = (x * a) * -b return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (y <= 4e-28) tmp = Float64(x * Float64(1.0 - Float64(a * Float64(z + b)))); else tmp = Float64(Float64(x * a) * Float64(-b)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (y <= 4e-28) tmp = x * (1.0 - (a * (z + b))); else tmp = (x * a) * -b; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[y, 4e-28], N[(x * N[(1.0 - N[(a * N[(z + b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x * a), $MachinePrecision] * (-b)), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq 4 \cdot 10^{-28}:\\
\;\;\;\;x \cdot \left(1 - a \cdot \left(z + b\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(x \cdot a\right) \cdot \left(-b\right)\\
\end{array}
\end{array}
if y < 3.99999999999999988e-28Initial program 95.0%
Taylor expanded in z around 0 99.9%
associate-*r*99.9%
associate-*r*99.9%
distribute-lft-out99.9%
mul-1-neg99.9%
Simplified99.9%
Taylor expanded in y around 0 75.8%
mul-1-neg75.8%
+-commutative75.8%
distribute-lft-neg-in75.8%
+-commutative75.8%
Simplified75.8%
Taylor expanded in a around 0 36.5%
mul-1-neg36.5%
unsub-neg36.5%
Simplified36.5%
if 3.99999999999999988e-28 < y Initial program 100.0%
Taylor expanded in z around 0 100.0%
associate-*r*100.0%
associate-*r*100.0%
distribute-lft-out100.0%
mul-1-neg100.0%
Simplified100.0%
Taylor expanded in b around inf 37.9%
associate-*r*37.9%
mul-1-neg37.9%
Simplified37.9%
Taylor expanded in a around 0 10.0%
mul-1-neg10.0%
unsub-neg10.0%
Simplified10.0%
Taylor expanded in a around inf 30.2%
neg-mul-130.2%
*-commutative30.2%
associate-*r*33.9%
distribute-rgt-neg-in33.9%
Simplified33.9%
Final simplification35.7%
(FPCore (x y z t a b) :precision binary64 (if (<= y 4e-28) (* x (- 1.0 (* a b))) (* (* x a) (- b))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (y <= 4e-28) {
tmp = x * (1.0 - (a * b));
} 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 <= 4d-28) then
tmp = x * (1.0d0 - (a * b))
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 <= 4e-28) {
tmp = x * (1.0 - (a * b));
} else {
tmp = (x * a) * -b;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if y <= 4e-28: tmp = x * (1.0 - (a * b)) else: tmp = (x * a) * -b return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (y <= 4e-28) tmp = Float64(x * Float64(1.0 - Float64(a * b))); else tmp = Float64(Float64(x * a) * Float64(-b)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (y <= 4e-28) tmp = x * (1.0 - (a * b)); else tmp = (x * a) * -b; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[y, 4e-28], N[(x * N[(1.0 - N[(a * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x * a), $MachinePrecision] * (-b)), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq 4 \cdot 10^{-28}:\\
\;\;\;\;x \cdot \left(1 - a \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;\left(x \cdot a\right) \cdot \left(-b\right)\\
\end{array}
\end{array}
if y < 3.99999999999999988e-28Initial program 95.0%
Taylor expanded in z around 0 99.9%
associate-*r*99.9%
associate-*r*99.9%
distribute-lft-out99.9%
mul-1-neg99.9%
Simplified99.9%
Taylor expanded in b around inf 69.3%
associate-*r*69.3%
mul-1-neg69.3%
Simplified69.3%
Taylor expanded in a around 0 35.9%
mul-1-neg35.9%
unsub-neg35.9%
Simplified35.9%
if 3.99999999999999988e-28 < y Initial program 100.0%
Taylor expanded in z around 0 100.0%
associate-*r*100.0%
associate-*r*100.0%
distribute-lft-out100.0%
mul-1-neg100.0%
Simplified100.0%
Taylor expanded in b around inf 37.9%
associate-*r*37.9%
mul-1-neg37.9%
Simplified37.9%
Taylor expanded in a around 0 10.0%
mul-1-neg10.0%
unsub-neg10.0%
Simplified10.0%
Taylor expanded in a around inf 30.2%
neg-mul-130.2%
*-commutative30.2%
associate-*r*33.9%
distribute-rgt-neg-in33.9%
Simplified33.9%
Final simplification35.3%
(FPCore (x y z t a b) :precision binary64 (if (<= y 4e-28) (- x (* x (* a b))) (* (* x a) (- b))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (y <= 4e-28) {
tmp = x - (x * (a * b));
} 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 <= 4d-28) then
tmp = x - (x * (a * b))
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 <= 4e-28) {
tmp = x - (x * (a * b));
} else {
tmp = (x * a) * -b;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if y <= 4e-28: tmp = x - (x * (a * b)) else: tmp = (x * a) * -b return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (y <= 4e-28) tmp = Float64(x - Float64(x * Float64(a * b))); else tmp = Float64(Float64(x * a) * Float64(-b)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (y <= 4e-28) tmp = x - (x * (a * b)); else tmp = (x * a) * -b; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[y, 4e-28], N[(x - N[(x * N[(a * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x * a), $MachinePrecision] * (-b)), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq 4 \cdot 10^{-28}:\\
\;\;\;\;x - x \cdot \left(a \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;\left(x \cdot a\right) \cdot \left(-b\right)\\
\end{array}
\end{array}
if y < 3.99999999999999988e-28Initial program 95.0%
Taylor expanded in z around 0 99.9%
associate-*r*99.9%
associate-*r*99.9%
distribute-lft-out99.9%
mul-1-neg99.9%
Simplified99.9%
Taylor expanded in b around inf 69.3%
associate-*r*69.3%
mul-1-neg69.3%
Simplified69.3%
Taylor expanded in a around 0 33.8%
mul-1-neg33.8%
unsub-neg33.8%
associate-*r*35.9%
Simplified35.9%
if 3.99999999999999988e-28 < y Initial program 100.0%
Taylor expanded in z around 0 100.0%
associate-*r*100.0%
associate-*r*100.0%
distribute-lft-out100.0%
mul-1-neg100.0%
Simplified100.0%
Taylor expanded in b around inf 37.9%
associate-*r*37.9%
mul-1-neg37.9%
Simplified37.9%
Taylor expanded in a around 0 10.0%
mul-1-neg10.0%
unsub-neg10.0%
Simplified10.0%
Taylor expanded in a around inf 30.2%
neg-mul-130.2%
*-commutative30.2%
associate-*r*33.9%
distribute-rgt-neg-in33.9%
Simplified33.9%
Final simplification35.3%
(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.5%
Taylor expanded in a around 0 69.4%
Taylor expanded in y around 0 19.1%
Final simplification19.1%
herbie shell --seed 2024066
(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))))))