
(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 (* (exp (+ (* (- (log (- 1.0 z)) b) a) (* (- (log z) t) y))) x))
double code(double x, double y, double z, double t, double a, double b) {
return exp((((log((1.0 - z)) - b) * a) + ((log(z) - t) * 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 = exp((((log((1.0d0 - z)) - b) * a) + ((log(z) - t) * y))) * x
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return Math.exp((((Math.log((1.0 - z)) - b) * a) + ((Math.log(z) - t) * y))) * x;
}
def code(x, y, z, t, a, b): return math.exp((((math.log((1.0 - z)) - b) * a) + ((math.log(z) - t) * y))) * x
function code(x, y, z, t, a, b) return Float64(exp(Float64(Float64(Float64(log(Float64(1.0 - z)) - b) * a) + Float64(Float64(log(z) - t) * y))) * x) end
function tmp = code(x, y, z, t, a, b) tmp = exp((((log((1.0 - z)) - b) * a) + ((log(z) - t) * y))) * x; end
code[x_, y_, z_, t_, a_, b_] := N[(N[Exp[N[(N[(N[(N[Log[N[(1.0 - z), $MachinePrecision]], $MachinePrecision] - b), $MachinePrecision] * a), $MachinePrecision] + N[(N[(N[Log[z], $MachinePrecision] - t), $MachinePrecision] * y), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * x), $MachinePrecision]
\begin{array}{l}
\\
e^{\left(\log \left(1 - z\right) - b\right) \cdot a + \left(\log z - t\right) \cdot y} \cdot x
\end{array}
Initial program 98.0%
Final simplification98.0%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (+ (* (- (log (- 1.0 z)) b) a) (* (- (log z) t) y)))
(t_2 (fma (* b a) (- x) x)))
(if (<= t_1 -50.0)
(* (log1p (- z)) (* a x))
(if (<= t_1 1e-7)
t_2
(if (<= t_1 1e+249)
(fma
(fma
(- x)
b
(*
(*
(* (fma -0.3333333333333333 x (/ (fma 0.5 x (/ x z)) (- z))) z)
z)
z))
a
x)
t_2)))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = ((log((1.0 - z)) - b) * a) + ((log(z) - t) * y);
double t_2 = fma((b * a), -x, x);
double tmp;
if (t_1 <= -50.0) {
tmp = log1p(-z) * (a * x);
} else if (t_1 <= 1e-7) {
tmp = t_2;
} else if (t_1 <= 1e+249) {
tmp = fma(fma(-x, b, (((fma(-0.3333333333333333, x, (fma(0.5, x, (x / z)) / -z)) * z) * z) * z)), a, x);
} else {
tmp = t_2;
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = Float64(Float64(Float64(log(Float64(1.0 - z)) - b) * a) + Float64(Float64(log(z) - t) * y)) t_2 = fma(Float64(b * a), Float64(-x), x) tmp = 0.0 if (t_1 <= -50.0) tmp = Float64(log1p(Float64(-z)) * Float64(a * x)); elseif (t_1 <= 1e-7) tmp = t_2; elseif (t_1 <= 1e+249) tmp = fma(fma(Float64(-x), b, Float64(Float64(Float64(fma(-0.3333333333333333, x, Float64(fma(0.5, x, Float64(x / z)) / Float64(-z))) * z) * z) * z)), a, x); else tmp = t_2; end return tmp end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(N[(N[Log[N[(1.0 - z), $MachinePrecision]], $MachinePrecision] - b), $MachinePrecision] * a), $MachinePrecision] + N[(N[(N[Log[z], $MachinePrecision] - t), $MachinePrecision] * y), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(b * a), $MachinePrecision] * (-x) + x), $MachinePrecision]}, If[LessEqual[t$95$1, -50.0], N[(N[Log[1 + (-z)], $MachinePrecision] * N[(a * x), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 1e-7], t$95$2, If[LessEqual[t$95$1, 1e+249], N[(N[((-x) * b + N[(N[(N[(N[(-0.3333333333333333 * x + N[(N[(0.5 * x + N[(x / z), $MachinePrecision]), $MachinePrecision] / (-z)), $MachinePrecision]), $MachinePrecision] * z), $MachinePrecision] * z), $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision] * a + x), $MachinePrecision], t$95$2]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(\log \left(1 - z\right) - b\right) \cdot a + \left(\log z - t\right) \cdot y\\
t_2 := \mathsf{fma}\left(b \cdot a, -x, x\right)\\
\mathbf{if}\;t\_1 \leq -50:\\
\;\;\;\;\mathsf{log1p}\left(-z\right) \cdot \left(a \cdot x\right)\\
\mathbf{elif}\;t\_1 \leq 10^{-7}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;t\_1 \leq 10^{+249}:\\
\;\;\;\;\mathsf{fma}\left(\mathsf{fma}\left(-x, b, \left(\left(\mathsf{fma}\left(-0.3333333333333333, x, \frac{\mathsf{fma}\left(0.5, x, \frac{x}{z}\right)}{-z}\right) \cdot z\right) \cdot z\right) \cdot z\right), a, x\right)\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if (+.f64 (*.f64 y (-.f64 (log.f64 z) t)) (*.f64 a (-.f64 (log.f64 (-.f64 #s(literal 1 binary64) z)) b))) < -50Initial program 97.9%
Taylor expanded in a around 0
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
distribute-rgt-outN/A
lower-*.f64N/A
*-commutativeN/A
exp-prodN/A
lower-pow.f64N/A
exp-diffN/A
rem-exp-logN/A
lower-/.f64N/A
lower-exp.f64N/A
lower-fma.f64N/A
Applied rewrites59.3%
Taylor expanded in y around 0
Applied rewrites3.8%
Taylor expanded in b around 0
Applied rewrites4.4%
Taylor expanded in a around inf
Applied rewrites26.8%
if -50 < (+.f64 (*.f64 y (-.f64 (log.f64 z) t)) (*.f64 a (-.f64 (log.f64 (-.f64 #s(literal 1 binary64) z)) b))) < 9.9999999999999995e-8 or 9.9999999999999992e248 < (+.f64 (*.f64 y (-.f64 (log.f64 z) t)) (*.f64 a (-.f64 (log.f64 (-.f64 #s(literal 1 binary64) z)) b))) Initial program 98.9%
Taylor expanded in a around 0
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
distribute-rgt-outN/A
lower-*.f64N/A
*-commutativeN/A
exp-prodN/A
lower-pow.f64N/A
exp-diffN/A
rem-exp-logN/A
lower-/.f64N/A
lower-exp.f64N/A
lower-fma.f64N/A
Applied rewrites60.1%
Taylor expanded in y around 0
Applied rewrites67.0%
Taylor expanded in a around inf
Applied rewrites61.1%
Taylor expanded in z around 0
Applied rewrites73.1%
if 9.9999999999999995e-8 < (+.f64 (*.f64 y (-.f64 (log.f64 z) t)) (*.f64 a (-.f64 (log.f64 (-.f64 #s(literal 1 binary64) z)) b))) < 9.9999999999999992e248Initial program 97.0%
Taylor expanded in a around 0
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
distribute-rgt-outN/A
lower-*.f64N/A
*-commutativeN/A
exp-prodN/A
lower-pow.f64N/A
exp-diffN/A
rem-exp-logN/A
lower-/.f64N/A
lower-exp.f64N/A
lower-fma.f64N/A
Applied rewrites71.4%
Taylor expanded in y around 0
Applied rewrites15.2%
Taylor expanded in z around 0
Applied rewrites15.2%
Taylor expanded in z around -inf
Applied rewrites27.5%
Final simplification44.0%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (+ (* (- (log (- 1.0 z)) b) a) (* (- (log z) t) y)))
(t_2 (fma (* b a) (- x) x)))
(if (<= t_1 -1e-8)
(* (/ x a) a)
(if (<= t_1 1e-7)
t_2
(if (<= t_1 1e+252)
(fma
(fma
(- x)
b
(*
(*
(* (fma -0.3333333333333333 x (/ (fma 0.5 x (/ x z)) (- z))) z)
z)
z))
a
x)
t_2)))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = ((log((1.0 - z)) - b) * a) + ((log(z) - t) * y);
double t_2 = fma((b * a), -x, x);
double tmp;
if (t_1 <= -1e-8) {
tmp = (x / a) * a;
} else if (t_1 <= 1e-7) {
tmp = t_2;
} else if (t_1 <= 1e+252) {
tmp = fma(fma(-x, b, (((fma(-0.3333333333333333, x, (fma(0.5, x, (x / z)) / -z)) * z) * z) * z)), a, x);
} else {
tmp = t_2;
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = Float64(Float64(Float64(log(Float64(1.0 - z)) - b) * a) + Float64(Float64(log(z) - t) * y)) t_2 = fma(Float64(b * a), Float64(-x), x) tmp = 0.0 if (t_1 <= -1e-8) tmp = Float64(Float64(x / a) * a); elseif (t_1 <= 1e-7) tmp = t_2; elseif (t_1 <= 1e+252) tmp = fma(fma(Float64(-x), b, Float64(Float64(Float64(fma(-0.3333333333333333, x, Float64(fma(0.5, x, Float64(x / z)) / Float64(-z))) * z) * z) * z)), a, x); else tmp = t_2; end return tmp end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(N[(N[Log[N[(1.0 - z), $MachinePrecision]], $MachinePrecision] - b), $MachinePrecision] * a), $MachinePrecision] + N[(N[(N[Log[z], $MachinePrecision] - t), $MachinePrecision] * y), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(b * a), $MachinePrecision] * (-x) + x), $MachinePrecision]}, If[LessEqual[t$95$1, -1e-8], N[(N[(x / a), $MachinePrecision] * a), $MachinePrecision], If[LessEqual[t$95$1, 1e-7], t$95$2, If[LessEqual[t$95$1, 1e+252], N[(N[((-x) * b + N[(N[(N[(N[(-0.3333333333333333 * x + N[(N[(0.5 * x + N[(x / z), $MachinePrecision]), $MachinePrecision] / (-z)), $MachinePrecision]), $MachinePrecision] * z), $MachinePrecision] * z), $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision] * a + x), $MachinePrecision], t$95$2]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(\log \left(1 - z\right) - b\right) \cdot a + \left(\log z - t\right) \cdot y\\
t_2 := \mathsf{fma}\left(b \cdot a, -x, x\right)\\
\mathbf{if}\;t\_1 \leq -1 \cdot 10^{-8}:\\
\;\;\;\;\frac{x}{a} \cdot a\\
\mathbf{elif}\;t\_1 \leq 10^{-7}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;t\_1 \leq 10^{+252}:\\
\;\;\;\;\mathsf{fma}\left(\mathsf{fma}\left(-x, b, \left(\left(\mathsf{fma}\left(-0.3333333333333333, x, \frac{\mathsf{fma}\left(0.5, x, \frac{x}{z}\right)}{-z}\right) \cdot z\right) \cdot z\right) \cdot z\right), a, x\right)\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if (+.f64 (*.f64 y (-.f64 (log.f64 z) t)) (*.f64 a (-.f64 (log.f64 (-.f64 #s(literal 1 binary64) z)) b))) < -1e-8Initial program 98.0%
Taylor expanded in a around 0
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
distribute-rgt-outN/A
lower-*.f64N/A
*-commutativeN/A
exp-prodN/A
lower-pow.f64N/A
exp-diffN/A
rem-exp-logN/A
lower-/.f64N/A
lower-exp.f64N/A
lower-fma.f64N/A
Applied rewrites58.7%
Taylor expanded in y around 0
Applied rewrites4.4%
Taylor expanded in a around inf
Applied rewrites5.3%
Taylor expanded in a around 0
Applied rewrites18.5%
if -1e-8 < (+.f64 (*.f64 y (-.f64 (log.f64 z) t)) (*.f64 a (-.f64 (log.f64 (-.f64 #s(literal 1 binary64) z)) b))) < 9.9999999999999995e-8 or 1.0000000000000001e252 < (+.f64 (*.f64 y (-.f64 (log.f64 z) t)) (*.f64 a (-.f64 (log.f64 (-.f64 #s(literal 1 binary64) z)) b))) Initial program 98.8%
Taylor expanded in a around 0
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
distribute-rgt-outN/A
lower-*.f64N/A
*-commutativeN/A
exp-prodN/A
lower-pow.f64N/A
exp-diffN/A
rem-exp-logN/A
lower-/.f64N/A
lower-exp.f64N/A
lower-fma.f64N/A
Applied rewrites60.9%
Taylor expanded in y around 0
Applied rewrites68.5%
Taylor expanded in a around inf
Applied rewrites62.4%
Taylor expanded in z around 0
Applied rewrites74.8%
if 9.9999999999999995e-8 < (+.f64 (*.f64 y (-.f64 (log.f64 z) t)) (*.f64 a (-.f64 (log.f64 (-.f64 #s(literal 1 binary64) z)) b))) < 1.0000000000000001e252Initial program 97.1%
Taylor expanded in a around 0
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
distribute-rgt-outN/A
lower-*.f64N/A
*-commutativeN/A
exp-prodN/A
lower-pow.f64N/A
exp-diffN/A
rem-exp-logN/A
lower-/.f64N/A
lower-exp.f64N/A
lower-fma.f64N/A
Applied rewrites70.8%
Taylor expanded in y around 0
Applied rewrites14.8%
Taylor expanded in z around 0
Applied rewrites14.8%
Taylor expanded in z around -inf
Applied rewrites26.8%
Final simplification40.7%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (+ (* (- (log (- 1.0 z)) b) a) (* (- (log z) t) y))))
(if (<= t_1 -5e+26)
(* (* (- x) b) a)
(if (<= t_1 1e+88) (fma (* (- x) z) a x) (* (* (- b) a) x)))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = ((log((1.0 - z)) - b) * a) + ((log(z) - t) * y);
double tmp;
if (t_1 <= -5e+26) {
tmp = (-x * b) * a;
} else if (t_1 <= 1e+88) {
tmp = fma((-x * z), a, x);
} else {
tmp = (-b * a) * x;
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = Float64(Float64(Float64(log(Float64(1.0 - z)) - b) * a) + Float64(Float64(log(z) - t) * y)) tmp = 0.0 if (t_1 <= -5e+26) tmp = Float64(Float64(Float64(-x) * b) * a); elseif (t_1 <= 1e+88) tmp = fma(Float64(Float64(-x) * z), a, x); else tmp = Float64(Float64(Float64(-b) * a) * x); end return tmp end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(N[(N[Log[N[(1.0 - z), $MachinePrecision]], $MachinePrecision] - b), $MachinePrecision] * a), $MachinePrecision] + N[(N[(N[Log[z], $MachinePrecision] - t), $MachinePrecision] * y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, -5e+26], N[(N[((-x) * b), $MachinePrecision] * a), $MachinePrecision], If[LessEqual[t$95$1, 1e+88], N[(N[((-x) * z), $MachinePrecision] * a + x), $MachinePrecision], N[(N[((-b) * a), $MachinePrecision] * x), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(\log \left(1 - z\right) - b\right) \cdot a + \left(\log z - t\right) \cdot y\\
\mathbf{if}\;t\_1 \leq -5 \cdot 10^{+26}:\\
\;\;\;\;\left(\left(-x\right) \cdot b\right) \cdot a\\
\mathbf{elif}\;t\_1 \leq 10^{+88}:\\
\;\;\;\;\mathsf{fma}\left(\left(-x\right) \cdot z, a, x\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\left(-b\right) \cdot a\right) \cdot x\\
\end{array}
\end{array}
if (+.f64 (*.f64 y (-.f64 (log.f64 z) t)) (*.f64 a (-.f64 (log.f64 (-.f64 #s(literal 1 binary64) z)) b))) < -5.0000000000000001e26Initial program 97.8%
Taylor expanded in a around 0
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
distribute-rgt-outN/A
lower-*.f64N/A
*-commutativeN/A
exp-prodN/A
lower-pow.f64N/A
exp-diffN/A
rem-exp-logN/A
lower-/.f64N/A
lower-exp.f64N/A
lower-fma.f64N/A
Applied rewrites62.0%
Taylor expanded in y around 0
Applied rewrites3.9%
Taylor expanded in b around inf
Applied rewrites17.9%
if -5.0000000000000001e26 < (+.f64 (*.f64 y (-.f64 (log.f64 z) t)) (*.f64 a (-.f64 (log.f64 (-.f64 #s(literal 1 binary64) z)) b))) < 9.99999999999999959e87Initial program 99.9%
Taylor expanded in a around 0
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
distribute-rgt-outN/A
lower-*.f64N/A
*-commutativeN/A
exp-prodN/A
lower-pow.f64N/A
exp-diffN/A
rem-exp-logN/A
lower-/.f64N/A
lower-exp.f64N/A
lower-fma.f64N/A
Applied rewrites59.2%
Taylor expanded in y around 0
Applied rewrites62.1%
Taylor expanded in b around 0
Applied rewrites62.5%
Taylor expanded in z around 0
Applied rewrites63.8%
if 9.99999999999999959e87 < (+.f64 (*.f64 y (-.f64 (log.f64 z) t)) (*.f64 a (-.f64 (log.f64 (-.f64 #s(literal 1 binary64) z)) b))) Initial program 96.6%
Taylor expanded in a around 0
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
distribute-rgt-outN/A
lower-*.f64N/A
*-commutativeN/A
exp-prodN/A
lower-pow.f64N/A
exp-diffN/A
rem-exp-logN/A
lower-/.f64N/A
lower-exp.f64N/A
lower-fma.f64N/A
Applied rewrites66.3%
Taylor expanded in y around 0
Applied rewrites28.6%
Taylor expanded in b around inf
Applied rewrites27.0%
Applied rewrites30.2%
Final simplification35.9%
(FPCore (x y z t a b) :precision binary64 (if (<= (+ (* (- (log (- 1.0 z)) b) a) (* (- (log z) t) y)) -1e-8) (* (/ x a) a) (fma (* b a) (- x) x)))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((((log((1.0 - z)) - b) * a) + ((log(z) - t) * y)) <= -1e-8) {
tmp = (x / a) * a;
} else {
tmp = fma((b * a), -x, x);
}
return tmp;
}
function code(x, y, z, t, a, b) tmp = 0.0 if (Float64(Float64(Float64(log(Float64(1.0 - z)) - b) * a) + Float64(Float64(log(z) - t) * y)) <= -1e-8) tmp = Float64(Float64(x / a) * a); else tmp = fma(Float64(b * a), Float64(-x), x); end return tmp end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[N[(N[(N[(N[Log[N[(1.0 - z), $MachinePrecision]], $MachinePrecision] - b), $MachinePrecision] * a), $MachinePrecision] + N[(N[(N[Log[z], $MachinePrecision] - t), $MachinePrecision] * y), $MachinePrecision]), $MachinePrecision], -1e-8], N[(N[(x / a), $MachinePrecision] * a), $MachinePrecision], N[(N[(b * a), $MachinePrecision] * (-x) + x), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\left(\log \left(1 - z\right) - b\right) \cdot a + \left(\log z - t\right) \cdot y \leq -1 \cdot 10^{-8}:\\
\;\;\;\;\frac{x}{a} \cdot a\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(b \cdot a, -x, x\right)\\
\end{array}
\end{array}
if (+.f64 (*.f64 y (-.f64 (log.f64 z) t)) (*.f64 a (-.f64 (log.f64 (-.f64 #s(literal 1 binary64) z)) b))) < -1e-8Initial program 98.0%
Taylor expanded in a around 0
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
distribute-rgt-outN/A
lower-*.f64N/A
*-commutativeN/A
exp-prodN/A
lower-pow.f64N/A
exp-diffN/A
rem-exp-logN/A
lower-/.f64N/A
lower-exp.f64N/A
lower-fma.f64N/A
Applied rewrites58.7%
Taylor expanded in y around 0
Applied rewrites4.4%
Taylor expanded in a around inf
Applied rewrites5.3%
Taylor expanded in a around 0
Applied rewrites18.5%
if -1e-8 < (+.f64 (*.f64 y (-.f64 (log.f64 z) t)) (*.f64 a (-.f64 (log.f64 (-.f64 #s(literal 1 binary64) z)) b))) Initial program 98.1%
Taylor expanded in a around 0
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
distribute-rgt-outN/A
lower-*.f64N/A
*-commutativeN/A
exp-prodN/A
lower-pow.f64N/A
exp-diffN/A
rem-exp-logN/A
lower-/.f64N/A
lower-exp.f64N/A
lower-fma.f64N/A
Applied rewrites65.1%
Taylor expanded in y around 0
Applied rewrites45.7%
Taylor expanded in a around inf
Applied rewrites45.3%
Taylor expanded in z around 0
Applied rewrites48.2%
Final simplification36.8%
(FPCore (x y z t a b) :precision binary64 (if (<= (+ (* (- (log (- 1.0 z)) b) a) (* (- (log z) t) y)) -5e+16) (* (* (- x) b) a) (fma (* b a) (- x) x)))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((((log((1.0 - z)) - b) * a) + ((log(z) - t) * y)) <= -5e+16) {
tmp = (-x * b) * a;
} else {
tmp = fma((b * a), -x, x);
}
return tmp;
}
function code(x, y, z, t, a, b) tmp = 0.0 if (Float64(Float64(Float64(log(Float64(1.0 - z)) - b) * a) + Float64(Float64(log(z) - t) * y)) <= -5e+16) tmp = Float64(Float64(Float64(-x) * b) * a); else tmp = fma(Float64(b * a), Float64(-x), x); end return tmp end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[N[(N[(N[(N[Log[N[(1.0 - z), $MachinePrecision]], $MachinePrecision] - b), $MachinePrecision] * a), $MachinePrecision] + N[(N[(N[Log[z], $MachinePrecision] - t), $MachinePrecision] * y), $MachinePrecision]), $MachinePrecision], -5e+16], N[(N[((-x) * b), $MachinePrecision] * a), $MachinePrecision], N[(N[(b * a), $MachinePrecision] * (-x) + x), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\left(\log \left(1 - z\right) - b\right) \cdot a + \left(\log z - t\right) \cdot y \leq -5 \cdot 10^{+16}:\\
\;\;\;\;\left(\left(-x\right) \cdot b\right) \cdot a\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(b \cdot a, -x, x\right)\\
\end{array}
\end{array}
if (+.f64 (*.f64 y (-.f64 (log.f64 z) t)) (*.f64 a (-.f64 (log.f64 (-.f64 #s(literal 1 binary64) z)) b))) < -5e16Initial program 97.9%
Taylor expanded in a around 0
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
distribute-rgt-outN/A
lower-*.f64N/A
*-commutativeN/A
exp-prodN/A
lower-pow.f64N/A
exp-diffN/A
rem-exp-logN/A
lower-/.f64N/A
lower-exp.f64N/A
lower-fma.f64N/A
Applied rewrites61.8%
Taylor expanded in y around 0
Applied rewrites3.9%
Taylor expanded in b around inf
Applied rewrites17.6%
if -5e16 < (+.f64 (*.f64 y (-.f64 (log.f64 z) t)) (*.f64 a (-.f64 (log.f64 (-.f64 #s(literal 1 binary64) z)) b))) Initial program 98.1%
Taylor expanded in a around 0
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
distribute-rgt-outN/A
lower-*.f64N/A
*-commutativeN/A
exp-prodN/A
lower-pow.f64N/A
exp-diffN/A
rem-exp-logN/A
lower-/.f64N/A
lower-exp.f64N/A
lower-fma.f64N/A
Applied rewrites63.2%
Taylor expanded in y around 0
Applied rewrites44.7%
Taylor expanded in a around inf
Applied rewrites44.3%
Taylor expanded in z around 0
Applied rewrites47.1%
Final simplification36.4%
(FPCore (x y z t a b) :precision binary64 (if (<= (+ (* (- (log (- 1.0 z)) b) a) (* (- (log z) t) y)) 5e+207) (* (* (- x) b) a) (* (* (- b) a) x)))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((((log((1.0 - z)) - b) * a) + ((log(z) - t) * y)) <= 5e+207) {
tmp = (-x * b) * a;
} else {
tmp = (-b * a) * 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 ((((log((1.0d0 - z)) - b) * a) + ((log(z) - t) * y)) <= 5d+207) then
tmp = (-x * b) * a
else
tmp = (-b * a) * 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 ((((Math.log((1.0 - z)) - b) * a) + ((Math.log(z) - t) * y)) <= 5e+207) {
tmp = (-x * b) * a;
} else {
tmp = (-b * a) * x;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (((math.log((1.0 - z)) - b) * a) + ((math.log(z) - t) * y)) <= 5e+207: tmp = (-x * b) * a else: tmp = (-b * a) * x return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (Float64(Float64(Float64(log(Float64(1.0 - z)) - b) * a) + Float64(Float64(log(z) - t) * y)) <= 5e+207) tmp = Float64(Float64(Float64(-x) * b) * a); else tmp = Float64(Float64(Float64(-b) * a) * x); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((((log((1.0 - z)) - b) * a) + ((log(z) - t) * y)) <= 5e+207) tmp = (-x * b) * a; else tmp = (-b * a) * x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[N[(N[(N[(N[Log[N[(1.0 - z), $MachinePrecision]], $MachinePrecision] - b), $MachinePrecision] * a), $MachinePrecision] + N[(N[(N[Log[z], $MachinePrecision] - t), $MachinePrecision] * y), $MachinePrecision]), $MachinePrecision], 5e+207], N[(N[((-x) * b), $MachinePrecision] * a), $MachinePrecision], N[(N[((-b) * a), $MachinePrecision] * x), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\left(\log \left(1 - z\right) - b\right) \cdot a + \left(\log z - t\right) \cdot y \leq 5 \cdot 10^{+207}:\\
\;\;\;\;\left(\left(-x\right) \cdot b\right) \cdot a\\
\mathbf{else}:\\
\;\;\;\;\left(\left(-b\right) \cdot a\right) \cdot x\\
\end{array}
\end{array}
if (+.f64 (*.f64 y (-.f64 (log.f64 z) t)) (*.f64 a (-.f64 (log.f64 (-.f64 #s(literal 1 binary64) z)) b))) < 4.9999999999999999e207Initial program 98.0%
Taylor expanded in a around 0
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
distribute-rgt-outN/A
lower-*.f64N/A
*-commutativeN/A
exp-prodN/A
lower-pow.f64N/A
exp-diffN/A
rem-exp-logN/A
lower-/.f64N/A
lower-exp.f64N/A
lower-fma.f64N/A
Applied rewrites62.3%
Taylor expanded in y around 0
Applied rewrites29.0%
Taylor expanded in b around inf
Applied rewrites12.8%
if 4.9999999999999999e207 < (+.f64 (*.f64 y (-.f64 (log.f64 z) t)) (*.f64 a (-.f64 (log.f64 (-.f64 #s(literal 1 binary64) z)) b))) Initial program 98.2%
Taylor expanded in a around 0
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
distribute-rgt-outN/A
lower-*.f64N/A
*-commutativeN/A
exp-prodN/A
lower-pow.f64N/A
exp-diffN/A
rem-exp-logN/A
lower-/.f64N/A
lower-exp.f64N/A
lower-fma.f64N/A
Applied rewrites63.9%
Taylor expanded in y around 0
Applied rewrites33.2%
Taylor expanded in b around inf
Applied rewrites30.9%
Applied rewrites39.4%
Final simplification18.5%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* (exp (* (- (log z) t) y)) x)))
(if (<= y -2.9e-123)
t_1
(if (<= y 5.1e-15) (* (exp (* (- (- z) b) a)) x) t_1))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = exp(((log(z) - t) * y)) * x;
double tmp;
if (y <= -2.9e-123) {
tmp = t_1;
} else if (y <= 5.1e-15) {
tmp = exp(((-z - b) * a)) * 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(((log(z) - t) * y)) * x
if (y <= (-2.9d-123)) then
tmp = t_1
else if (y <= 5.1d-15) then
tmp = exp(((-z - b) * a)) * 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(((Math.log(z) - t) * y)) * x;
double tmp;
if (y <= -2.9e-123) {
tmp = t_1;
} else if (y <= 5.1e-15) {
tmp = Math.exp(((-z - b) * a)) * x;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = math.exp(((math.log(z) - t) * y)) * x tmp = 0 if y <= -2.9e-123: tmp = t_1 elif y <= 5.1e-15: tmp = math.exp(((-z - b) * a)) * x else: tmp = t_1 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(exp(Float64(Float64(log(z) - t) * y)) * x) tmp = 0.0 if (y <= -2.9e-123) tmp = t_1; elseif (y <= 5.1e-15) tmp = Float64(exp(Float64(Float64(Float64(-z) - b) * a)) * x); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = exp(((log(z) - t) * y)) * x; tmp = 0.0; if (y <= -2.9e-123) tmp = t_1; elseif (y <= 5.1e-15) tmp = exp(((-z - b) * a)) * 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[(N[Log[z], $MachinePrecision] - t), $MachinePrecision] * y), $MachinePrecision]], $MachinePrecision] * x), $MachinePrecision]}, If[LessEqual[y, -2.9e-123], t$95$1, If[LessEqual[y, 5.1e-15], N[(N[Exp[N[(N[((-z) - b), $MachinePrecision] * a), $MachinePrecision]], $MachinePrecision] * x), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := e^{\left(\log z - t\right) \cdot y} \cdot x\\
\mathbf{if}\;y \leq -2.9 \cdot 10^{-123}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq 5.1 \cdot 10^{-15}:\\
\;\;\;\;e^{\left(\left(-z\right) - b\right) \cdot a} \cdot x\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y < -2.90000000000000004e-123 or 5.1e-15 < y Initial program 97.4%
Taylor expanded in a around 0
*-commutativeN/A
lower-*.f64N/A
lower--.f64N/A
lower-log.f6486.2
Applied rewrites86.2%
if -2.90000000000000004e-123 < y < 5.1e-15Initial program 99.0%
Taylor expanded in a around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f64N/A
sub-negN/A
lower-log1p.f64N/A
lower-neg.f6488.8
Applied rewrites88.8%
Taylor expanded in z around 0
Applied rewrites88.8%
Final simplification87.3%
(FPCore (x y z t a b) :precision binary64 (let* ((t_1 (* (exp (* (log z) y)) x))) (if (<= y -42000.0) t_1 (if (<= y 2.4) (* (exp (* (- (- z) b) a)) x) t_1))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = exp((log(z) * y)) * x;
double tmp;
if (y <= -42000.0) {
tmp = t_1;
} else if (y <= 2.4) {
tmp = exp(((-z - b) * a)) * 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((log(z) * y)) * x
if (y <= (-42000.0d0)) then
tmp = t_1
else if (y <= 2.4d0) then
tmp = exp(((-z - b) * a)) * 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((Math.log(z) * y)) * x;
double tmp;
if (y <= -42000.0) {
tmp = t_1;
} else if (y <= 2.4) {
tmp = Math.exp(((-z - b) * a)) * x;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = math.exp((math.log(z) * y)) * x tmp = 0 if y <= -42000.0: tmp = t_1 elif y <= 2.4: tmp = math.exp(((-z - b) * a)) * x else: tmp = t_1 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(exp(Float64(log(z) * y)) * x) tmp = 0.0 if (y <= -42000.0) tmp = t_1; elseif (y <= 2.4) tmp = Float64(exp(Float64(Float64(Float64(-z) - b) * a)) * x); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = exp((log(z) * y)) * x; tmp = 0.0; if (y <= -42000.0) tmp = t_1; elseif (y <= 2.4) tmp = exp(((-z - b) * a)) * 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[Log[z], $MachinePrecision] * y), $MachinePrecision]], $MachinePrecision] * x), $MachinePrecision]}, If[LessEqual[y, -42000.0], t$95$1, If[LessEqual[y, 2.4], N[(N[Exp[N[(N[((-z) - b), $MachinePrecision] * a), $MachinePrecision]], $MachinePrecision] * x), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := e^{\log z \cdot y} \cdot x\\
\mathbf{if}\;y \leq -42000:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq 2.4:\\
\;\;\;\;e^{\left(\left(-z\right) - b\right) \cdot a} \cdot x\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y < -42000 or 2.39999999999999991 < y Initial program 96.9%
Taylor expanded in a around 0
*-commutativeN/A
lower-*.f64N/A
lower--.f64N/A
lower-log.f6488.5
Applied rewrites88.5%
Taylor expanded in t around 0
Applied rewrites74.6%
if -42000 < y < 2.39999999999999991Initial program 99.2%
Taylor expanded in a around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f64N/A
sub-negN/A
lower-log1p.f64N/A
lower-neg.f6485.5
Applied rewrites85.5%
Taylor expanded in z around 0
Applied rewrites85.5%
Final simplification80.0%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* (exp (* (- t) y)) x)))
(if (<= t -1.12e+24)
t_1
(if (<= t 3.1e-47) (* (exp (* (- (- z) b) a)) x) t_1))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = exp((-t * y)) * x;
double tmp;
if (t <= -1.12e+24) {
tmp = t_1;
} else if (t <= 3.1e-47) {
tmp = exp(((-z - b) * a)) * 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((-t * y)) * x
if (t <= (-1.12d+24)) then
tmp = t_1
else if (t <= 3.1d-47) then
tmp = exp(((-z - b) * a)) * 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((-t * y)) * x;
double tmp;
if (t <= -1.12e+24) {
tmp = t_1;
} else if (t <= 3.1e-47) {
tmp = Math.exp(((-z - b) * a)) * x;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = math.exp((-t * y)) * x tmp = 0 if t <= -1.12e+24: tmp = t_1 elif t <= 3.1e-47: tmp = math.exp(((-z - b) * a)) * x else: tmp = t_1 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(exp(Float64(Float64(-t) * y)) * x) tmp = 0.0 if (t <= -1.12e+24) tmp = t_1; elseif (t <= 3.1e-47) tmp = Float64(exp(Float64(Float64(Float64(-z) - b) * a)) * x); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = exp((-t * y)) * x; tmp = 0.0; if (t <= -1.12e+24) tmp = t_1; elseif (t <= 3.1e-47) tmp = exp(((-z - b) * a)) * 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[((-t) * y), $MachinePrecision]], $MachinePrecision] * x), $MachinePrecision]}, If[LessEqual[t, -1.12e+24], t$95$1, If[LessEqual[t, 3.1e-47], N[(N[Exp[N[(N[((-z) - b), $MachinePrecision] * a), $MachinePrecision]], $MachinePrecision] * x), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := e^{\left(-t\right) \cdot y} \cdot x\\
\mathbf{if}\;t \leq -1.12 \cdot 10^{+24}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 3.1 \cdot 10^{-47}:\\
\;\;\;\;e^{\left(\left(-z\right) - b\right) \cdot a} \cdot x\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t < -1.12e24 or 3.0999999999999998e-47 < t Initial program 98.5%
Taylor expanded in t around inf
associate-*r*N/A
mul-1-negN/A
lower-*.f64N/A
lower-neg.f6483.2
Applied rewrites83.2%
if -1.12e24 < t < 3.0999999999999998e-47Initial program 97.5%
Taylor expanded in a around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f64N/A
sub-negN/A
lower-log1p.f64N/A
lower-neg.f6474.6
Applied rewrites74.6%
Taylor expanded in z around 0
Applied rewrites74.6%
Final simplification79.1%
(FPCore (x y z t a b) :precision binary64 (let* ((t_1 (* (exp (* (- t) y)) x))) (if (<= t -1.12e+24) t_1 (if (<= t 2.9e-47) (* (exp (* (- b) a)) x) t_1))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = exp((-t * y)) * x;
double tmp;
if (t <= -1.12e+24) {
tmp = t_1;
} else if (t <= 2.9e-47) {
tmp = exp((-b * a)) * 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((-t * y)) * x
if (t <= (-1.12d+24)) then
tmp = t_1
else if (t <= 2.9d-47) then
tmp = exp((-b * a)) * 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((-t * y)) * x;
double tmp;
if (t <= -1.12e+24) {
tmp = t_1;
} else if (t <= 2.9e-47) {
tmp = Math.exp((-b * a)) * x;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = math.exp((-t * y)) * x tmp = 0 if t <= -1.12e+24: tmp = t_1 elif t <= 2.9e-47: tmp = math.exp((-b * a)) * x else: tmp = t_1 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(exp(Float64(Float64(-t) * y)) * x) tmp = 0.0 if (t <= -1.12e+24) tmp = t_1; elseif (t <= 2.9e-47) tmp = Float64(exp(Float64(Float64(-b) * a)) * x); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = exp((-t * y)) * x; tmp = 0.0; if (t <= -1.12e+24) tmp = t_1; elseif (t <= 2.9e-47) tmp = exp((-b * a)) * 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[((-t) * y), $MachinePrecision]], $MachinePrecision] * x), $MachinePrecision]}, If[LessEqual[t, -1.12e+24], t$95$1, If[LessEqual[t, 2.9e-47], N[(N[Exp[N[((-b) * a), $MachinePrecision]], $MachinePrecision] * x), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := e^{\left(-t\right) \cdot y} \cdot x\\
\mathbf{if}\;t \leq -1.12 \cdot 10^{+24}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 2.9 \cdot 10^{-47}:\\
\;\;\;\;e^{\left(-b\right) \cdot a} \cdot x\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t < -1.12e24 or 2.9e-47 < t Initial program 98.5%
Taylor expanded in t around inf
associate-*r*N/A
mul-1-negN/A
lower-*.f64N/A
lower-neg.f6483.2
Applied rewrites83.2%
if -1.12e24 < t < 2.9e-47Initial program 97.5%
Taylor expanded in b around inf
mul-1-negN/A
*-commutativeN/A
distribute-lft-neg-inN/A
lower-*.f64N/A
lower-neg.f6469.8
Applied rewrites69.8%
Final simplification76.8%
(FPCore (x y z t a b) :precision binary64 (* (exp (* (- b) a)) x))
double code(double x, double y, double z, double t, double a, double b) {
return exp((-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((-b * a)) * x
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return Math.exp((-b * a)) * x;
}
def code(x, y, z, t, a, b): return math.exp((-b * a)) * x
function code(x, y, z, t, a, b) return Float64(exp(Float64(Float64(-b) * a)) * x) end
function tmp = code(x, y, z, t, a, b) tmp = exp((-b * a)) * x; end
code[x_, y_, z_, t_, a_, b_] := N[(N[Exp[N[((-b) * a), $MachinePrecision]], $MachinePrecision] * x), $MachinePrecision]
\begin{array}{l}
\\
e^{\left(-b\right) \cdot a} \cdot x
\end{array}
Initial program 98.0%
Taylor expanded in b around inf
mul-1-negN/A
*-commutativeN/A
distribute-lft-neg-inN/A
lower-*.f64N/A
lower-neg.f6461.3
Applied rewrites61.3%
Final simplification61.3%
(FPCore (x y z t a b) :precision binary64 (* (* (- x) b) a))
double code(double x, double y, double z, double t, double a, double b) {
return (-x * b) * a;
}
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 * b) * a
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return (-x * b) * a;
}
def code(x, y, z, t, a, b): return (-x * b) * a
function code(x, y, z, t, a, b) return Float64(Float64(Float64(-x) * b) * a) end
function tmp = code(x, y, z, t, a, b) tmp = (-x * b) * a; end
code[x_, y_, z_, t_, a_, b_] := N[(N[((-x) * b), $MachinePrecision] * a), $MachinePrecision]
\begin{array}{l}
\\
\left(\left(-x\right) \cdot b\right) \cdot a
\end{array}
Initial program 98.0%
Taylor expanded in a around 0
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
distribute-rgt-outN/A
lower-*.f64N/A
*-commutativeN/A
exp-prodN/A
lower-pow.f64N/A
exp-diffN/A
rem-exp-logN/A
lower-/.f64N/A
lower-exp.f64N/A
lower-fma.f64N/A
Applied rewrites62.7%
Taylor expanded in y around 0
Applied rewrites29.9%
Taylor expanded in b around inf
Applied rewrites16.7%
Final simplification16.7%
herbie shell --seed 2024255
(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))))))