
(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 9 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 (* (exp (+ (* (- (log z) t) y) (* (- (log (- 1.0 z)) b) a))) x))
double code(double x, double y, double z, double t, double a, double b) {
return exp((((log(z) - t) * y) + ((log((1.0 - z)) - b) * a))) * 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 = exp((((log(z) - t) * y) + ((log((1.0d0 - z)) - b) * a))) * x
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return Math.exp((((Math.log(z) - t) * y) + ((Math.log((1.0 - z)) - b) * a))) * x;
}
def code(x, y, z, t, a, b): return math.exp((((math.log(z) - t) * y) + ((math.log((1.0 - z)) - b) * a))) * x
function code(x, y, z, t, a, b) return Float64(exp(Float64(Float64(Float64(log(z) - t) * y) + Float64(Float64(log(Float64(1.0 - z)) - b) * a))) * x) end
function tmp = code(x, y, z, t, a, b) tmp = exp((((log(z) - t) * y) + ((log((1.0 - z)) - b) * a))) * x; end
code[x_, y_, z_, t_, a_, b_] := N[(N[Exp[N[(N[(N[(N[Log[z], $MachinePrecision] - t), $MachinePrecision] * y), $MachinePrecision] + N[(N[(N[Log[N[(1.0 - z), $MachinePrecision]], $MachinePrecision] - b), $MachinePrecision] * a), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * x), $MachinePrecision]
\begin{array}{l}
\\
e^{\left(\log z - t\right) \cdot y + \left(\log \left(1 - z\right) - b\right) \cdot a} \cdot x
\end{array}
Initial program 96.8%
Final simplification96.8%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* (exp (* (- (- z) b) a)) x)))
(if (<= a -1.32e+116)
t_1
(if (<= a 5.5e+139)
(* (pow (exp 2.0) (* 0.5 (* (- (log z) t) y))) x)
t_1))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = exp(((-z - b) * a)) * x;
double tmp;
if (a <= -1.32e+116) {
tmp = t_1;
} else if (a <= 5.5e+139) {
tmp = pow(exp(2.0), (0.5 * ((log(z) - t) * y))) * x;
} 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 = exp(((-z - b) * a)) * x
if (a <= (-1.32d+116)) then
tmp = t_1
else if (a <= 5.5d+139) then
tmp = (exp(2.0d0) ** (0.5d0 * ((log(z) - t) * y))) * x
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 = Math.exp(((-z - b) * a)) * x;
double tmp;
if (a <= -1.32e+116) {
tmp = t_1;
} else if (a <= 5.5e+139) {
tmp = Math.pow(Math.exp(2.0), (0.5 * ((Math.log(z) - t) * y))) * x;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = math.exp(((-z - b) * a)) * x tmp = 0 if a <= -1.32e+116: tmp = t_1 elif a <= 5.5e+139: tmp = math.pow(math.exp(2.0), (0.5 * ((math.log(z) - t) * y))) * x else: tmp = t_1 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(exp(Float64(Float64(Float64(-z) - b) * a)) * x) tmp = 0.0 if (a <= -1.32e+116) tmp = t_1; elseif (a <= 5.5e+139) tmp = Float64((exp(2.0) ^ Float64(0.5 * Float64(Float64(log(z) - t) * y))) * x); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = exp(((-z - b) * a)) * x; tmp = 0.0; if (a <= -1.32e+116) tmp = t_1; elseif (a <= 5.5e+139) tmp = (exp(2.0) ^ (0.5 * ((log(z) - t) * y))) * x; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[Exp[N[(N[((-z) - b), $MachinePrecision] * a), $MachinePrecision]], $MachinePrecision] * x), $MachinePrecision]}, If[LessEqual[a, -1.32e+116], t$95$1, If[LessEqual[a, 5.5e+139], N[(N[Power[N[Exp[2.0], $MachinePrecision], N[(0.5 * N[(N[(N[Log[z], $MachinePrecision] - t), $MachinePrecision] * y), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * x), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := e^{\left(\left(-z\right) - b\right) \cdot a} \cdot x\\
\mathbf{if}\;a \leq -1.32 \cdot 10^{+116}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;a \leq 5.5 \cdot 10^{+139}:\\
\;\;\;\;{\left(e^{2}\right)}^{\left(0.5 \cdot \left(\left(\log z - t\right) \cdot y\right)\right)} \cdot x\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if a < -1.32000000000000002e116 or 5.4999999999999996e139 < a Initial program 91.1%
Taylor expanded in a around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f64N/A
sub-negN/A
lower-log1p.f64N/A
lower-neg.f6492.4
Applied rewrites92.4%
Taylor expanded in z around 0
Applied rewrites92.4%
if -1.32000000000000002e116 < a < 5.4999999999999996e139Initial program 99.3%
Taylor expanded in a around 0
*-commutativeN/A
exp-prodN/A
lower-pow.f64N/A
exp-diffN/A
rem-exp-logN/A
lower-/.f64N/A
lower-exp.f6483.4
Applied rewrites83.4%
Applied rewrites83.4%
Applied rewrites91.0%
Final simplification91.4%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* (exp (* (- (- z) b) a)) x)))
(if (<= a -1.32e+116)
t_1
(if (<= a 5.5e+139) (* (exp (* (- (log z) t) y)) x) t_1))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = exp(((-z - b) * a)) * x;
double tmp;
if (a <= -1.32e+116) {
tmp = t_1;
} else if (a <= 5.5e+139) {
tmp = exp(((log(z) - t) * y)) * x;
} 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 = exp(((-z - b) * a)) * x
if (a <= (-1.32d+116)) then
tmp = t_1
else if (a <= 5.5d+139) then
tmp = exp(((log(z) - t) * y)) * x
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 = Math.exp(((-z - b) * a)) * x;
double tmp;
if (a <= -1.32e+116) {
tmp = t_1;
} else if (a <= 5.5e+139) {
tmp = Math.exp(((Math.log(z) - t) * y)) * x;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = math.exp(((-z - b) * a)) * x tmp = 0 if a <= -1.32e+116: tmp = t_1 elif a <= 5.5e+139: tmp = math.exp(((math.log(z) - t) * y)) * x else: tmp = t_1 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(exp(Float64(Float64(Float64(-z) - b) * a)) * x) tmp = 0.0 if (a <= -1.32e+116) tmp = t_1; elseif (a <= 5.5e+139) tmp = Float64(exp(Float64(Float64(log(z) - t) * y)) * x); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = exp(((-z - b) * a)) * x; tmp = 0.0; if (a <= -1.32e+116) tmp = t_1; elseif (a <= 5.5e+139) tmp = exp(((log(z) - t) * y)) * x; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[Exp[N[(N[((-z) - b), $MachinePrecision] * a), $MachinePrecision]], $MachinePrecision] * x), $MachinePrecision]}, If[LessEqual[a, -1.32e+116], t$95$1, If[LessEqual[a, 5.5e+139], N[(N[Exp[N[(N[(N[Log[z], $MachinePrecision] - t), $MachinePrecision] * y), $MachinePrecision]], $MachinePrecision] * x), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := e^{\left(\left(-z\right) - b\right) \cdot a} \cdot x\\
\mathbf{if}\;a \leq -1.32 \cdot 10^{+116}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;a \leq 5.5 \cdot 10^{+139}:\\
\;\;\;\;e^{\left(\log z - t\right) \cdot y} \cdot x\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if a < -1.32000000000000002e116 or 5.4999999999999996e139 < a Initial program 91.1%
Taylor expanded in a around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f64N/A
sub-negN/A
lower-log1p.f64N/A
lower-neg.f6492.4
Applied rewrites92.4%
Taylor expanded in z around 0
Applied rewrites92.4%
if -1.32000000000000002e116 < a < 5.4999999999999996e139Initial program 99.3%
Taylor expanded in a around 0
*-commutativeN/A
lower-*.f64N/A
lower--.f64N/A
lower-log.f6491.0
Applied rewrites91.0%
Final simplification91.4%
(FPCore (x y z t a b) :precision binary64 (let* ((t_1 (* (exp (* (- (- z) b) a)) x))) (if (<= a -0.88) t_1 (if (<= a 6.8e-17) (* (exp (* (- t) y)) x) t_1))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = exp(((-z - b) * a)) * x;
double tmp;
if (a <= -0.88) {
tmp = t_1;
} else if (a <= 6.8e-17) {
tmp = exp((-t * y)) * x;
} 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 = exp(((-z - b) * a)) * x
if (a <= (-0.88d0)) then
tmp = t_1
else if (a <= 6.8d-17) then
tmp = exp((-t * y)) * x
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 = Math.exp(((-z - b) * a)) * x;
double tmp;
if (a <= -0.88) {
tmp = t_1;
} else if (a <= 6.8e-17) {
tmp = Math.exp((-t * y)) * x;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = math.exp(((-z - b) * a)) * x tmp = 0 if a <= -0.88: tmp = t_1 elif a <= 6.8e-17: tmp = math.exp((-t * y)) * x else: tmp = t_1 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(exp(Float64(Float64(Float64(-z) - b) * a)) * x) tmp = 0.0 if (a <= -0.88) tmp = t_1; elseif (a <= 6.8e-17) tmp = Float64(exp(Float64(Float64(-t) * y)) * x); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = exp(((-z - b) * a)) * x; tmp = 0.0; if (a <= -0.88) tmp = t_1; elseif (a <= 6.8e-17) tmp = exp((-t * y)) * x; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[Exp[N[(N[((-z) - b), $MachinePrecision] * a), $MachinePrecision]], $MachinePrecision] * x), $MachinePrecision]}, If[LessEqual[a, -0.88], t$95$1, If[LessEqual[a, 6.8e-17], N[(N[Exp[N[((-t) * y), $MachinePrecision]], $MachinePrecision] * x), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := e^{\left(\left(-z\right) - b\right) \cdot a} \cdot x\\
\mathbf{if}\;a \leq -0.88:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;a \leq 6.8 \cdot 10^{-17}:\\
\;\;\;\;e^{\left(-t\right) \cdot y} \cdot x\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if a < -0.880000000000000004 or 6.7999999999999996e-17 < a Initial program 94.1%
Taylor expanded in a around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f64N/A
sub-negN/A
lower-log1p.f64N/A
lower-neg.f6481.1
Applied rewrites81.1%
Taylor expanded in z around 0
Applied rewrites81.1%
if -0.880000000000000004 < a < 6.7999999999999996e-17Initial program 99.8%
Taylor expanded in t around inf
associate-*r*N/A
mul-1-negN/A
lower-*.f64N/A
lower-neg.f6476.7
Applied rewrites76.7%
Final simplification79.0%
(FPCore (x y z t a b) :precision binary64 (let* ((t_1 (* (exp (* (- b) a)) x))) (if (<= a -0.88) t_1 (if (<= a 6.8e-17) (* (exp (* (- t) y)) x) t_1))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = exp((-b * a)) * x;
double tmp;
if (a <= -0.88) {
tmp = t_1;
} else if (a <= 6.8e-17) {
tmp = exp((-t * y)) * x;
} 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 = exp((-b * a)) * x
if (a <= (-0.88d0)) then
tmp = t_1
else if (a <= 6.8d-17) then
tmp = exp((-t * y)) * x
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 = Math.exp((-b * a)) * x;
double tmp;
if (a <= -0.88) {
tmp = t_1;
} else if (a <= 6.8e-17) {
tmp = Math.exp((-t * y)) * x;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = math.exp((-b * a)) * x tmp = 0 if a <= -0.88: tmp = t_1 elif a <= 6.8e-17: tmp = math.exp((-t * y)) * x else: tmp = t_1 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(exp(Float64(Float64(-b) * a)) * x) tmp = 0.0 if (a <= -0.88) tmp = t_1; elseif (a <= 6.8e-17) tmp = Float64(exp(Float64(Float64(-t) * y)) * x); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = exp((-b * a)) * x; tmp = 0.0; if (a <= -0.88) tmp = t_1; elseif (a <= 6.8e-17) tmp = exp((-t * y)) * x; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[Exp[N[((-b) * a), $MachinePrecision]], $MachinePrecision] * x), $MachinePrecision]}, If[LessEqual[a, -0.88], t$95$1, If[LessEqual[a, 6.8e-17], N[(N[Exp[N[((-t) * y), $MachinePrecision]], $MachinePrecision] * x), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := e^{\left(-b\right) \cdot a} \cdot x\\
\mathbf{if}\;a \leq -0.88:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;a \leq 6.8 \cdot 10^{-17}:\\
\;\;\;\;e^{\left(-t\right) \cdot y} \cdot x\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if a < -0.880000000000000004 or 6.7999999999999996e-17 < a Initial program 94.1%
Taylor expanded in b around inf
mul-1-negN/A
*-commutativeN/A
distribute-lft-neg-inN/A
lower-*.f64N/A
lower-neg.f6474.7
Applied rewrites74.7%
if -0.880000000000000004 < a < 6.7999999999999996e-17Initial program 99.8%
Taylor expanded in t around inf
associate-*r*N/A
mul-1-negN/A
lower-*.f64N/A
lower-neg.f6476.7
Applied rewrites76.7%
Final simplification75.6%
(FPCore (x y z t a b) :precision binary64 (let* ((t_1 (* (exp (* (- b) a)) x))) (if (<= a -0.0011) t_1 (if (<= a 5.2e-14) (* (pow z y) x) t_1))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = exp((-b * a)) * x;
double tmp;
if (a <= -0.0011) {
tmp = t_1;
} else if (a <= 5.2e-14) {
tmp = pow(z, y) * x;
} 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 = exp((-b * a)) * x
if (a <= (-0.0011d0)) then
tmp = t_1
else if (a <= 5.2d-14) then
tmp = (z ** y) * x
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 = Math.exp((-b * a)) * x;
double tmp;
if (a <= -0.0011) {
tmp = t_1;
} else if (a <= 5.2e-14) {
tmp = Math.pow(z, y) * x;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = math.exp((-b * a)) * x tmp = 0 if a <= -0.0011: tmp = t_1 elif a <= 5.2e-14: tmp = math.pow(z, y) * x else: tmp = t_1 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(exp(Float64(Float64(-b) * a)) * x) tmp = 0.0 if (a <= -0.0011) tmp = t_1; elseif (a <= 5.2e-14) tmp = Float64((z ^ y) * x); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = exp((-b * a)) * x; tmp = 0.0; if (a <= -0.0011) tmp = t_1; elseif (a <= 5.2e-14) tmp = (z ^ y) * x; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[Exp[N[((-b) * a), $MachinePrecision]], $MachinePrecision] * x), $MachinePrecision]}, If[LessEqual[a, -0.0011], t$95$1, If[LessEqual[a, 5.2e-14], N[(N[Power[z, y], $MachinePrecision] * x), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := e^{\left(-b\right) \cdot a} \cdot x\\
\mathbf{if}\;a \leq -0.0011:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;a \leq 5.2 \cdot 10^{-14}:\\
\;\;\;\;{z}^{y} \cdot x\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if a < -0.00110000000000000007 or 5.19999999999999993e-14 < a Initial program 94.1%
Taylor expanded in b around inf
mul-1-negN/A
*-commutativeN/A
distribute-lft-neg-inN/A
lower-*.f64N/A
lower-neg.f6474.7
Applied rewrites74.7%
if -0.00110000000000000007 < a < 5.19999999999999993e-14Initial program 99.8%
Taylor expanded in a around 0
*-commutativeN/A
exp-prodN/A
lower-pow.f64N/A
exp-diffN/A
rem-exp-logN/A
lower-/.f64N/A
lower-exp.f6486.6
Applied rewrites86.6%
Taylor expanded in t around 0
Applied rewrites70.8%
Final simplification72.9%
(FPCore (x y z t a b) :precision binary64 (let* ((t_1 (* (exp (* (- a) z)) x))) (if (<= a -5.2e+99) t_1 (if (<= a 2.3e+128) (* (pow z y) x) t_1))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = exp((-a * z)) * x;
double tmp;
if (a <= -5.2e+99) {
tmp = t_1;
} else if (a <= 2.3e+128) {
tmp = pow(z, y) * x;
} 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 = exp((-a * z)) * x
if (a <= (-5.2d+99)) then
tmp = t_1
else if (a <= 2.3d+128) then
tmp = (z ** y) * x
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 = Math.exp((-a * z)) * x;
double tmp;
if (a <= -5.2e+99) {
tmp = t_1;
} else if (a <= 2.3e+128) {
tmp = Math.pow(z, y) * x;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = math.exp((-a * z)) * x tmp = 0 if a <= -5.2e+99: tmp = t_1 elif a <= 2.3e+128: tmp = math.pow(z, y) * x else: tmp = t_1 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(exp(Float64(Float64(-a) * z)) * x) tmp = 0.0 if (a <= -5.2e+99) tmp = t_1; elseif (a <= 2.3e+128) tmp = Float64((z ^ y) * x); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = exp((-a * z)) * x; tmp = 0.0; if (a <= -5.2e+99) tmp = t_1; elseif (a <= 2.3e+128) tmp = (z ^ y) * x; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[Exp[N[((-a) * z), $MachinePrecision]], $MachinePrecision] * x), $MachinePrecision]}, If[LessEqual[a, -5.2e+99], t$95$1, If[LessEqual[a, 2.3e+128], N[(N[Power[z, y], $MachinePrecision] * x), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := e^{\left(-a\right) \cdot z} \cdot x\\
\mathbf{if}\;a \leq -5.2 \cdot 10^{+99}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;a \leq 2.3 \cdot 10^{+128}:\\
\;\;\;\;{z}^{y} \cdot x\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if a < -5.1999999999999999e99 or 2.29999999999999998e128 < a Initial program 91.6%
Taylor expanded in a around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f64N/A
sub-negN/A
lower-log1p.f64N/A
lower-neg.f6490.4
Applied rewrites90.4%
Taylor expanded in z around 0
Applied rewrites90.4%
Taylor expanded in b around 0
Applied rewrites48.0%
if -5.1999999999999999e99 < a < 2.29999999999999998e128Initial program 99.3%
Taylor expanded in a around 0
*-commutativeN/A
exp-prodN/A
lower-pow.f64N/A
exp-diffN/A
rem-exp-logN/A
lower-/.f64N/A
lower-exp.f6482.9
Applied rewrites82.9%
Taylor expanded in t around 0
Applied rewrites65.3%
Final simplification59.7%
(FPCore (x y z t a b) :precision binary64 (* (pow z y) x))
double code(double x, double y, double z, double t, double a, double b) {
return pow(z, y) * 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 = (z ** y) * x
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return Math.pow(z, y) * x;
}
def code(x, y, z, t, a, b): return math.pow(z, y) * x
function code(x, y, z, t, a, b) return Float64((z ^ y) * x) end
function tmp = code(x, y, z, t, a, b) tmp = (z ^ y) * x; end
code[x_, y_, z_, t_, a_, b_] := N[(N[Power[z, y], $MachinePrecision] * x), $MachinePrecision]
\begin{array}{l}
\\
{z}^{y} \cdot x
\end{array}
Initial program 96.8%
Taylor expanded in a around 0
*-commutativeN/A
exp-prodN/A
lower-pow.f64N/A
exp-diffN/A
rem-exp-logN/A
lower-/.f64N/A
lower-exp.f6470.1
Applied rewrites70.1%
Taylor expanded in t around 0
Applied rewrites51.4%
Final simplification51.4%
(FPCore (x y z t a b) :precision binary64 (* 1.0 x))
double code(double x, double y, double z, double t, double a, double b) {
return 1.0 * 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 = 1.0d0 * x
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return 1.0 * x;
}
def code(x, y, z, t, a, b): return 1.0 * x
function code(x, y, z, t, a, b) return Float64(1.0 * x) end
function tmp = code(x, y, z, t, a, b) tmp = 1.0 * x; end
code[x_, y_, z_, t_, a_, b_] := N[(1.0 * x), $MachinePrecision]
\begin{array}{l}
\\
1 \cdot x
\end{array}
Initial program 96.8%
Taylor expanded in a around 0
*-commutativeN/A
exp-prodN/A
lower-pow.f64N/A
exp-diffN/A
rem-exp-logN/A
lower-/.f64N/A
lower-exp.f6470.1
Applied rewrites70.1%
Taylor expanded in y around 0
Applied rewrites18.3%
Final simplification18.3%
herbie shell --seed 2024268
(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))))))