
(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 8 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) (* (- t (log z)) y))) x))
double code(double x, double y, double z, double t, double a, double b) {
return exp((((log((1.0 - z)) - b) * a) - ((t - log(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 = exp((((log((1.0d0 - z)) - b) * a) - ((t - log(z)) * 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) - ((t - Math.log(z)) * y))) * x;
}
def code(x, y, z, t, a, b): return math.exp((((math.log((1.0 - z)) - b) * a) - ((t - math.log(z)) * 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(t - log(z)) * y))) * x) end
function tmp = code(x, y, z, t, a, b) tmp = exp((((log((1.0 - z)) - b) * a) - ((t - log(z)) * 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[(t - N[Log[z], $MachinePrecision]), $MachinePrecision] * y), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * x), $MachinePrecision]
\begin{array}{l}
\\
e^{\left(\log \left(1 - z\right) - b\right) \cdot a - \left(t - \log z\right) \cdot y} \cdot x
\end{array}
Initial program 96.2%
Final simplification96.2%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* (* (* t y) x) 1.0)))
(if (<= (- (* (- (log (- 1.0 z)) b) a) (* (- t (log z)) y)) -1e+21)
(/ (- (* (* 1.0 x) (* 1.0 x)) (* t_1 t_1)) (+ t_1 (* 1.0 x)))
(fma 1.0 x (* (* (* (- t) y) x) 1.0)))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = ((t * y) * x) * 1.0;
double tmp;
if ((((log((1.0 - z)) - b) * a) - ((t - log(z)) * y)) <= -1e+21) {
tmp = (((1.0 * x) * (1.0 * x)) - (t_1 * t_1)) / (t_1 + (1.0 * x));
} else {
tmp = fma(1.0, x, (((-t * y) * x) * 1.0));
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = Float64(Float64(Float64(t * y) * x) * 1.0) tmp = 0.0 if (Float64(Float64(Float64(log(Float64(1.0 - z)) - b) * a) - Float64(Float64(t - log(z)) * y)) <= -1e+21) tmp = Float64(Float64(Float64(Float64(1.0 * x) * Float64(1.0 * x)) - Float64(t_1 * t_1)) / Float64(t_1 + Float64(1.0 * x))); else tmp = fma(1.0, x, Float64(Float64(Float64(Float64(-t) * y) * x) * 1.0)); end return tmp end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(N[(t * y), $MachinePrecision] * x), $MachinePrecision] * 1.0), $MachinePrecision]}, If[LessEqual[N[(N[(N[(N[Log[N[(1.0 - z), $MachinePrecision]], $MachinePrecision] - b), $MachinePrecision] * a), $MachinePrecision] - N[(N[(t - N[Log[z], $MachinePrecision]), $MachinePrecision] * y), $MachinePrecision]), $MachinePrecision], -1e+21], N[(N[(N[(N[(1.0 * x), $MachinePrecision] * N[(1.0 * x), $MachinePrecision]), $MachinePrecision] - N[(t$95$1 * t$95$1), $MachinePrecision]), $MachinePrecision] / N[(t$95$1 + N[(1.0 * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 * x + N[(N[(N[((-t) * y), $MachinePrecision] * x), $MachinePrecision] * 1.0), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(\left(t \cdot y\right) \cdot x\right) \cdot 1\\
\mathbf{if}\;\left(\log \left(1 - z\right) - b\right) \cdot a - \left(t - \log z\right) \cdot y \leq -1 \cdot 10^{+21}:\\
\;\;\;\;\frac{\left(1 \cdot x\right) \cdot \left(1 \cdot x\right) - t\_1 \cdot t\_1}{t\_1 + 1 \cdot x}\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(1, x, \left(\left(\left(-t\right) \cdot y\right) \cdot x\right) \cdot 1\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))) < -1e21Initial program 99.1%
Taylor expanded in t around 0
+-commutativeN/A
mul-1-negN/A
unsub-negN/A
associate-*r*N/A
associate-*r*N/A
distribute-rgt-out--N/A
lower-*.f64N/A
Applied rewrites64.8%
Taylor expanded in a around 0
Applied rewrites31.0%
Taylor expanded in y around 0
Applied rewrites3.0%
Applied rewrites13.1%
if -1e21 < (+.f64 (*.f64 y (-.f64 (log.f64 z) t)) (*.f64 a (-.f64 (log.f64 (-.f64 #s(literal 1 binary64) z)) b))) Initial program 93.9%
Taylor expanded in t around 0
+-commutativeN/A
mul-1-negN/A
unsub-negN/A
associate-*r*N/A
associate-*r*N/A
distribute-rgt-out--N/A
lower-*.f64N/A
Applied rewrites66.3%
Taylor expanded in a around 0
Applied rewrites43.9%
Taylor expanded in y around 0
Applied rewrites38.9%
Applied rewrites40.4%
Final simplification28.4%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* (exp (* (- (log z) t) y)) x)))
(if (<= y -2.75e+51)
t_1
(if (<= y 6.5e+71) (* (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.75e+51) {
tmp = t_1;
} else if (y <= 6.5e+71) {
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.75d+51)) then
tmp = t_1
else if (y <= 6.5d+71) 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.75e+51) {
tmp = t_1;
} else if (y <= 6.5e+71) {
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.75e+51: tmp = t_1 elif y <= 6.5e+71: 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.75e+51) tmp = t_1; elseif (y <= 6.5e+71) 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.75e+51) tmp = t_1; elseif (y <= 6.5e+71) 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.75e+51], t$95$1, If[LessEqual[y, 6.5e+71], 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.75 \cdot 10^{+51}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq 6.5 \cdot 10^{+71}:\\
\;\;\;\;e^{\left(\left(-z\right) - b\right) \cdot a} \cdot x\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y < -2.75e51 or 6.49999999999999954e71 < y Initial program 99.1%
Taylor expanded in a around 0
*-commutativeN/A
lower-*.f64N/A
lower--.f64N/A
lower-log.f6490.7
Applied rewrites90.7%
if -2.75e51 < y < 6.49999999999999954e71Initial program 93.7%
Taylor expanded in a around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f64N/A
sub-negN/A
lower-log1p.f64N/A
lower-neg.f6484.5
Applied rewrites84.5%
Taylor expanded in z around 0
Applied rewrites84.5%
Final simplification87.3%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* (exp (* (- t) y)) x)))
(if (<= t -1.3e+56)
t_1
(if (<= t 2.7e+149) (* (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.3e+56) {
tmp = t_1;
} else if (t <= 2.7e+149) {
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.3d+56)) then
tmp = t_1
else if (t <= 2.7d+149) 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.3e+56) {
tmp = t_1;
} else if (t <= 2.7e+149) {
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.3e+56: tmp = t_1 elif t <= 2.7e+149: 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.3e+56) tmp = t_1; elseif (t <= 2.7e+149) 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.3e+56) tmp = t_1; elseif (t <= 2.7e+149) 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.3e+56], t$95$1, If[LessEqual[t, 2.7e+149], 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.3 \cdot 10^{+56}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 2.7 \cdot 10^{+149}:\\
\;\;\;\;e^{\left(\left(-z\right) - b\right) \cdot a} \cdot x\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t < -1.30000000000000005e56 or 2.7000000000000001e149 < t Initial program 98.8%
Taylor expanded in t around inf
associate-*r*N/A
mul-1-negN/A
lower-*.f64N/A
lower-neg.f6487.3
Applied rewrites87.3%
if -1.30000000000000005e56 < t < 2.7000000000000001e149Initial program 94.9%
Taylor expanded in a around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f64N/A
sub-negN/A
lower-log1p.f64N/A
lower-neg.f6472.7
Applied rewrites72.7%
Taylor expanded in z around 0
Applied rewrites72.7%
Final simplification77.6%
(FPCore (x y z t a b) :precision binary64 (let* ((t_1 (* (exp (* (- t) y)) x))) (if (<= t -6e+59) t_1 (if (<= t 2.7e+149) (* (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 <= -6e+59) {
tmp = t_1;
} else if (t <= 2.7e+149) {
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 <= (-6d+59)) then
tmp = t_1
else if (t <= 2.7d+149) 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 <= -6e+59) {
tmp = t_1;
} else if (t <= 2.7e+149) {
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 <= -6e+59: tmp = t_1 elif t <= 2.7e+149: 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 <= -6e+59) tmp = t_1; elseif (t <= 2.7e+149) 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 <= -6e+59) tmp = t_1; elseif (t <= 2.7e+149) 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, -6e+59], t$95$1, If[LessEqual[t, 2.7e+149], 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 -6 \cdot 10^{+59}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 2.7 \cdot 10^{+149}:\\
\;\;\;\;e^{\left(-b\right) \cdot a} \cdot x\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t < -6.0000000000000001e59 or 2.7000000000000001e149 < t Initial program 98.7%
Taylor expanded in t around inf
associate-*r*N/A
mul-1-negN/A
lower-*.f64N/A
lower-neg.f6487.9
Applied rewrites87.9%
if -6.0000000000000001e59 < t < 2.7000000000000001e149Initial program 95.0%
Taylor expanded in b around inf
mul-1-negN/A
*-commutativeN/A
distribute-lft-neg-inN/A
lower-*.f64N/A
lower-neg.f6466.8
Applied rewrites66.8%
Final simplification73.6%
(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 96.2%
Taylor expanded in b around inf
mul-1-negN/A
*-commutativeN/A
distribute-lft-neg-inN/A
lower-*.f64N/A
lower-neg.f6458.0
Applied rewrites58.0%
Final simplification58.0%
(FPCore (x y z t a b) :precision binary64 (fma 1.0 x (* (* (* (- t) y) x) 1.0)))
double code(double x, double y, double z, double t, double a, double b) {
return fma(1.0, x, (((-t * y) * x) * 1.0));
}
function code(x, y, z, t, a, b) return fma(1.0, x, Float64(Float64(Float64(Float64(-t) * y) * x) * 1.0)) end
code[x_, y_, z_, t_, a_, b_] := N[(1.0 * x + N[(N[(N[((-t) * y), $MachinePrecision] * x), $MachinePrecision] * 1.0), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\mathsf{fma}\left(1, x, \left(\left(\left(-t\right) \cdot y\right) \cdot x\right) \cdot 1\right)
\end{array}
Initial program 96.2%
Taylor expanded in t around 0
+-commutativeN/A
mul-1-negN/A
unsub-negN/A
associate-*r*N/A
associate-*r*N/A
distribute-rgt-out--N/A
lower-*.f64N/A
Applied rewrites65.6%
Taylor expanded in a around 0
Applied rewrites38.2%
Taylor expanded in y around 0
Applied rewrites23.2%
Applied rewrites24.0%
Final simplification24.0%
(FPCore (x y z t a b) :precision binary64 (* (- x (* (* t x) y)) 1.0))
double code(double x, double y, double z, double t, double a, double b) {
return (x - ((t * x) * y)) * 1.0;
}
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 - ((t * x) * y)) * 1.0d0
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return (x - ((t * x) * y)) * 1.0;
}
def code(x, y, z, t, a, b): return (x - ((t * x) * y)) * 1.0
function code(x, y, z, t, a, b) return Float64(Float64(x - Float64(Float64(t * x) * y)) * 1.0) end
function tmp = code(x, y, z, t, a, b) tmp = (x - ((t * x) * y)) * 1.0; end
code[x_, y_, z_, t_, a_, b_] := N[(N[(x - N[(N[(t * x), $MachinePrecision] * y), $MachinePrecision]), $MachinePrecision] * 1.0), $MachinePrecision]
\begin{array}{l}
\\
\left(x - \left(t \cdot x\right) \cdot y\right) \cdot 1
\end{array}
Initial program 96.2%
Taylor expanded in t around 0
+-commutativeN/A
mul-1-negN/A
unsub-negN/A
associate-*r*N/A
associate-*r*N/A
distribute-rgt-out--N/A
lower-*.f64N/A
Applied rewrites65.6%
Taylor expanded in a around 0
Applied rewrites38.2%
Taylor expanded in y around 0
Applied rewrites23.2%
Final simplification23.2%
herbie shell --seed 2024249
(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))))))