Average Error: 2.0 → 1.2
Time: 14.9s
Precision: binary64
\[\frac{x \cdot e^{\left(y \cdot \log z + \left(t - 1\right) \cdot \log a\right) - b}}{y}\]
\[\begin{array}{l} \mathbf{if}\;x \le -1.4817987582222575 \cdot 10^{-82} \lor \neg \left(x \le 3.03265561868898219 \cdot 10^{-10}\right):\\ \;\;\;\;\left(\sqrt[3]{\frac{x \cdot e^{\left(y \cdot \log z + \left(t - 1\right) \cdot \log a\right) - b}}{y}} \cdot \sqrt[3]{\frac{x \cdot e^{\left(y \cdot \log z + \left(t - 1\right) \cdot \log a\right) - b}}{y}}\right) \cdot \sqrt[3]{\frac{x \cdot e^{\left(y \cdot \log z + \left(t - 1\right) \cdot \log a\right) - b}}{y}}\\ \mathbf{else}:\\ \;\;\;\;\frac{{\left(\frac{1}{a}\right)}^{1} \cdot {1}^{\left(t + y\right)}}{\frac{y}{x}} \cdot \frac{{1}^{1} \cdot e^{-\left(b + \left(\log \left(\frac{1}{z}\right) \cdot y + \log \left(\frac{1}{a}\right) \cdot t\right)\right)}}{1}\\ \end{array}\]

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
Target11.4
Herbie1.2
\[\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. Split input into 2 regimes
  2. if x < -1.4817987582222575e-82 or 3.03265561868898219e-10 < x

    1. Initial program 0.9

      \[\frac{x \cdot e^{\left(y \cdot \log z + \left(t - 1\right) \cdot \log a\right) - b}}{y}\]
    2. Using strategy rm
    3. Applied add-cube-cbrt0.9

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

    if -1.4817987582222575e-82 < x < 3.03265561868898219e-10

    1. Initial program 3.4

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

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

      \[\leadsto \color{blue}{\frac{{\left(\frac{1}{a}\right)}^{1} \cdot {1}^{\left(t + y\right)}}{\frac{y}{x}} \cdot \frac{{1}^{1} \cdot e^{-\left(b + \left(\log \left(\frac{1}{z}\right) \cdot y + \log \left(\frac{1}{a}\right) \cdot t\right)\right)}}{1}}\]
  3. Recombined 2 regimes into one program.
  4. Final simplification1.2

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \le -1.4817987582222575 \cdot 10^{-82} \lor \neg \left(x \le 3.03265561868898219 \cdot 10^{-10}\right):\\ \;\;\;\;\left(\sqrt[3]{\frac{x \cdot e^{\left(y \cdot \log z + \left(t - 1\right) \cdot \log a\right) - b}}{y}} \cdot \sqrt[3]{\frac{x \cdot e^{\left(y \cdot \log z + \left(t - 1\right) \cdot \log a\right) - b}}{y}}\right) \cdot \sqrt[3]{\frac{x \cdot e^{\left(y \cdot \log z + \left(t - 1\right) \cdot \log a\right) - b}}{y}}\\ \mathbf{else}:\\ \;\;\;\;\frac{{\left(\frac{1}{a}\right)}^{1} \cdot {1}^{\left(t + y\right)}}{\frac{y}{x}} \cdot \frac{{1}^{1} \cdot e^{-\left(b + \left(\log \left(\frac{1}{z}\right) \cdot y + \log \left(\frac{1}{a}\right) \cdot t\right)\right)}}{1}\\ \end{array}\]

Reproduce

herbie shell --seed 2020152 
(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.0)) y)) (- (+ b 1.0) (* y (log z)))) (if (< t 852031.2288374073) (/ (* (/ x y) (pow a (- t 1.0))) (exp (- b (* (log z) y)))) (/ (* x (/ (pow a (- t 1.0)) y)) (- (+ b 1.0) (* y (log z))))))

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