Average Error: 24.1 → 1.6
Time: 1.7m
Precision: 64
Internal precision: 128
\[\frac{x \cdot e^{\left(y \cdot \log z + \left(t - 1.0\right) \cdot \log a\right) - b}}{y}\]
⬇
\[\begin{array}{l}
\mathbf{if}\;y \le -6.408792807834615 \cdot 10^{+52}:\\
\;\;\;\;\frac{\frac{{z}^{y} \cdot x}{y \cdot a}}{\left(1 + b\right) - t \cdot \log a}\\
\mathbf{if}\;y \le -69.525409230544:\\
\;\;\;\;\frac{\frac{x}{y} + \left(x \cdot \log z + \frac{1}{2} \cdot \left(y \cdot \left(x \cdot {\left(\log z\right)}^2\right)\right)\right)}{e^{b - \log a \cdot \left(t - 1.0\right)}}\\
\mathbf{if}\;y \le 1.4591773572605082 \cdot 10^{-06}:\\
\;\;\;\;\frac{{z}^{y} \cdot x}{e^{b - \log a \cdot \left(t - 1.0\right)} \cdot y}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{{z}^{y} \cdot x}{y \cdot a}}{\left(1 + b\right) - t \cdot \log a}\\
\end{array}\]
Derivation
- Split input into 3 regimes.
-
if y < -6.408792807834615e+52 or 1.4591773572605082e-06 < y
Initial program 36.4
\[\frac{x \cdot e^{\left(y \cdot \log z + \left(t - 1.0\right) \cdot \log a\right) - b}}{y}\]
Applied simplify 27.1
\[\leadsto \color{blue}{\frac{{z}^{y} \cdot \frac{x}{y}}{\frac{e^{b}}{{a}^{\left(t - 1.0\right)}}}}\]
Applied taylor 1.6
\[\leadsto \frac{{z}^{y} \cdot \frac{x}{y}}{\left(a + b \cdot a\right) - t \cdot \left(\log a \cdot a\right)}\]
Taylor expanded around 0 1.6
\[\leadsto \frac{{z}^{y} \cdot \frac{x}{y}}{\color{blue}{\left(a + b \cdot a\right) - t \cdot \left(\log a \cdot a\right)}}\]
Applied simplify 0.1
\[\leadsto \color{blue}{\frac{\frac{{z}^{y} \cdot x}{y \cdot a}}{\left(1 + b\right) - t \cdot \log a}}\]
if -6.408792807834615e+52 < y < -69.525409230544
Initial program 23.4
\[\frac{x \cdot e^{\left(y \cdot \log z + \left(t - 1.0\right) \cdot \log a\right) - b}}{y}\]
Applied simplify 45.3
\[\leadsto \color{blue}{\frac{{z}^{y} \cdot \frac{x}{y}}{\frac{e^{b}}{{a}^{\left(t - 1.0\right)}}}}\]
- Using strategy
rm
Applied pow-to-exp 45.3
\[\leadsto \frac{{z}^{y} \cdot \frac{x}{y}}{\frac{e^{b}}{\color{blue}{e^{\log a \cdot \left(t - 1.0\right)}}}}\]
Applied div-exp 41.9
\[\leadsto \frac{{z}^{y} \cdot \frac{x}{y}}{\color{blue}{e^{b - \log a \cdot \left(t - 1.0\right)}}}\]
Applied taylor 5.8
\[\leadsto \frac{\frac{x}{y} + \left(x \cdot \log z + \frac{1}{2} \cdot \left(y \cdot \left(x \cdot {\left(\log z\right)}^2\right)\right)\right)}{e^{b - \log a \cdot \left(t - 1.0\right)}}\]
Taylor expanded around 0 5.8
\[\leadsto \frac{\color{blue}{\frac{x}{y} + \left(x \cdot \log z + \frac{1}{2} \cdot \left(y \cdot \left(x \cdot {\left(\log z\right)}^2\right)\right)\right)}}{e^{b - \log a \cdot \left(t - 1.0\right)}}\]
if -69.525409230544 < y < 1.4591773572605082e-06
Initial program 3.6
\[\frac{x \cdot e^{\left(y \cdot \log z + \left(t - 1.0\right) \cdot \log a\right) - b}}{y}\]
Applied simplify 18.4
\[\leadsto \color{blue}{\frac{{z}^{y} \cdot \frac{x}{y}}{\frac{e^{b}}{{a}^{\left(t - 1.0\right)}}}}\]
- Using strategy
rm
Applied associate-*r/ 18.4
\[\leadsto \frac{\color{blue}{\frac{{z}^{y} \cdot x}{y}}}{\frac{e^{b}}{{a}^{\left(t - 1.0\right)}}}\]
Applied associate-/l/ 9.5
\[\leadsto \color{blue}{\frac{{z}^{y} \cdot x}{\frac{e^{b}}{{a}^{\left(t - 1.0\right)}} \cdot y}}\]
- Using strategy
rm
Applied pow-to-exp 10.8
\[\leadsto \frac{{z}^{y} \cdot x}{\frac{e^{b}}{\color{blue}{e^{\log a \cdot \left(t - 1.0\right)}}} \cdot y}\]
Applied div-exp 3.8
\[\leadsto \frac{{z}^{y} \cdot x}{\color{blue}{e^{b - \log a \cdot \left(t - 1.0\right)}} \cdot y}\]
- Recombined 3 regimes into one program.
- Removed slow pow expressions
Runtime
Please include this information when filing a bug report:
herbie --seed '#(3483362936 519828621 3026289779 470622841 1282952580 3724100236)'
(FPCore (x y z t a b)
:name "Numeric.SpecFunctions:incompleteBetaWorker from math-functions-0.1.5.2"
(/ (* x (exp (- (+ (* y (log z)) (* (- t 1.0) (log a))) b))) y))