Average Error: 2.0 → 1.0
Time: 23.5s
Precision: 64
\[\frac{x \cdot e^{\left(y \cdot \log z + \left(t - 1\right) \cdot \log a\right) - b}}{y}\]
\[\frac{\sqrt{\frac{{\left(\frac{1}{a}\right)}^{1}}{e^{\mathsf{fma}\left(y, \log \left(\frac{1}{z}\right), \mathsf{fma}\left(\log \left(\frac{1}{a}\right), t, b\right)\right)}}}}{y} \cdot \left(\sqrt{\frac{{\left(\frac{1}{a}\right)}^{1}}{e^{\mathsf{fma}\left(y, \log \left(\frac{1}{z}\right), \mathsf{fma}\left(\log \left(\frac{1}{a}\right), t, b\right)\right)}}} \cdot x\right)\]
\frac{x \cdot e^{\left(y \cdot \log z + \left(t - 1\right) \cdot \log a\right) - b}}{y}
\frac{\sqrt{\frac{{\left(\frac{1}{a}\right)}^{1}}{e^{\mathsf{fma}\left(y, \log \left(\frac{1}{z}\right), \mathsf{fma}\left(\log \left(\frac{1}{a}\right), t, b\right)\right)}}}}{y} \cdot \left(\sqrt{\frac{{\left(\frac{1}{a}\right)}^{1}}{e^{\mathsf{fma}\left(y, \log \left(\frac{1}{z}\right), \mathsf{fma}\left(\log \left(\frac{1}{a}\right), t, b\right)\right)}}} \cdot x\right)
double f(double x, double y, double z, double t, double a, double b) {
        double r419822 = x;
        double r419823 = y;
        double r419824 = z;
        double r419825 = log(r419824);
        double r419826 = r419823 * r419825;
        double r419827 = t;
        double r419828 = 1.0;
        double r419829 = r419827 - r419828;
        double r419830 = a;
        double r419831 = log(r419830);
        double r419832 = r419829 * r419831;
        double r419833 = r419826 + r419832;
        double r419834 = b;
        double r419835 = r419833 - r419834;
        double r419836 = exp(r419835);
        double r419837 = r419822 * r419836;
        double r419838 = r419837 / r419823;
        return r419838;
}

double f(double x, double y, double z, double t, double a, double b) {
        double r419839 = 1.0;
        double r419840 = a;
        double r419841 = r419839 / r419840;
        double r419842 = 1.0;
        double r419843 = pow(r419841, r419842);
        double r419844 = y;
        double r419845 = z;
        double r419846 = r419839 / r419845;
        double r419847 = log(r419846);
        double r419848 = log(r419841);
        double r419849 = t;
        double r419850 = b;
        double r419851 = fma(r419848, r419849, r419850);
        double r419852 = fma(r419844, r419847, r419851);
        double r419853 = exp(r419852);
        double r419854 = r419843 / r419853;
        double r419855 = sqrt(r419854);
        double r419856 = r419855 / r419844;
        double r419857 = x;
        double r419858 = r419855 * r419857;
        double r419859 = r419856 * r419858;
        return r419859;
}

Error

Bits error versus x

Bits error versus y

Bits error versus z

Bits error versus t

Bits error versus a

Bits error versus b

Target

Original2.0
Target10.6
Herbie1.0
\[\begin{array}{l} \mathbf{if}\;t \lt -0.88458485041274715:\\ \;\;\;\;\frac{x \cdot \frac{{a}^{\left(t - 1\right)}}{y}}{\left(b + 1\right) - y \cdot \log z}\\ \mathbf{elif}\;t \lt 852031.22883740731:\\ \;\;\;\;\frac{\frac{x}{y} \cdot {a}^{\left(t - 1\right)}}{e^{b - \log z \cdot y}}\\ \mathbf{else}:\\ \;\;\;\;\frac{x \cdot \frac{{a}^{\left(t - 1\right)}}{y}}{\left(b + 1\right) - y \cdot \log z}\\ \end{array}\]

Derivation

  1. Initial program 2.0

    \[\frac{x \cdot e^{\left(y \cdot \log z + \left(t - 1\right) \cdot \log a\right) - b}}{y}\]
  2. Taylor expanded around inf 2.0

    \[\leadsto \color{blue}{\frac{x \cdot e^{1 \cdot \log \left(\frac{1}{a}\right) - \left(y \cdot \log \left(\frac{1}{z}\right) + \left(\log \left(\frac{1}{a}\right) \cdot t + b\right)\right)}}{y}}\]
  3. Simplified5.8

    \[\leadsto \color{blue}{\frac{\frac{{\left(\frac{1}{a}\right)}^{1}}{e^{\mathsf{fma}\left(y, \log \left(\frac{1}{z}\right), \mathsf{fma}\left(\log \left(\frac{1}{a}\right), t, b\right)\right)}}}{\frac{y}{x}}}\]
  4. Using strategy rm
  5. Applied div-inv5.8

    \[\leadsto \frac{\frac{{\left(\frac{1}{a}\right)}^{1}}{e^{\mathsf{fma}\left(y, \log \left(\frac{1}{z}\right), \mathsf{fma}\left(\log \left(\frac{1}{a}\right), t, b\right)\right)}}}{\color{blue}{y \cdot \frac{1}{x}}}\]
  6. Applied add-sqr-sqrt5.8

    \[\leadsto \frac{\color{blue}{\sqrt{\frac{{\left(\frac{1}{a}\right)}^{1}}{e^{\mathsf{fma}\left(y, \log \left(\frac{1}{z}\right), \mathsf{fma}\left(\log \left(\frac{1}{a}\right), t, b\right)\right)}}} \cdot \sqrt{\frac{{\left(\frac{1}{a}\right)}^{1}}{e^{\mathsf{fma}\left(y, \log \left(\frac{1}{z}\right), \mathsf{fma}\left(\log \left(\frac{1}{a}\right), t, b\right)\right)}}}}}{y \cdot \frac{1}{x}}\]
  7. Applied times-frac1.0

    \[\leadsto \color{blue}{\frac{\sqrt{\frac{{\left(\frac{1}{a}\right)}^{1}}{e^{\mathsf{fma}\left(y, \log \left(\frac{1}{z}\right), \mathsf{fma}\left(\log \left(\frac{1}{a}\right), t, b\right)\right)}}}}{y} \cdot \frac{\sqrt{\frac{{\left(\frac{1}{a}\right)}^{1}}{e^{\mathsf{fma}\left(y, \log \left(\frac{1}{z}\right), \mathsf{fma}\left(\log \left(\frac{1}{a}\right), t, b\right)\right)}}}}{\frac{1}{x}}}\]
  8. Simplified1.0

    \[\leadsto \frac{\sqrt{\frac{{\left(\frac{1}{a}\right)}^{1}}{e^{\mathsf{fma}\left(y, \log \left(\frac{1}{z}\right), \mathsf{fma}\left(\log \left(\frac{1}{a}\right), t, b\right)\right)}}}}{y} \cdot \color{blue}{\left(\sqrt{\frac{{\left(\frac{1}{a}\right)}^{1}}{e^{\mathsf{fma}\left(y, \log \left(\frac{1}{z}\right), \mathsf{fma}\left(\log \left(\frac{1}{a}\right), t, b\right)\right)}}} \cdot x\right)}\]
  9. Final simplification1.0

    \[\leadsto \frac{\sqrt{\frac{{\left(\frac{1}{a}\right)}^{1}}{e^{\mathsf{fma}\left(y, \log \left(\frac{1}{z}\right), \mathsf{fma}\left(\log \left(\frac{1}{a}\right), t, b\right)\right)}}}}{y} \cdot \left(\sqrt{\frac{{\left(\frac{1}{a}\right)}^{1}}{e^{\mathsf{fma}\left(y, \log \left(\frac{1}{z}\right), \mathsf{fma}\left(\log \left(\frac{1}{a}\right), t, b\right)\right)}}} \cdot x\right)\]

Reproduce

herbie shell --seed 2020035 +o rules:numerics
(FPCore (x y z t a b)
  :name "Numeric.SpecFunctions:incompleteBetaWorker from math-functions-0.1.5.2, A"
  :precision binary64

  :herbie-target
  (if (< t -0.8845848504127471) (/ (* x (/ (pow a (- t 1)) y)) (- (+ b 1) (* y (log z)))) (if (< t 852031.2288374073) (/ (* (/ x y) (pow a (- t 1))) (exp (- b (* (log z) y)))) (/ (* x (/ (pow a (- t 1)) y)) (- (+ b 1) (* y (log z))))))

  (/ (* x (exp (- (+ (* y (log z)) (* (- t 1) (log a))) b))) y))