Average Error: 13.9 → 3.6
Time: 56.3s
Precision: 64
Internal Precision: 384
\[\frac{x \cdot y}{\left(z \cdot z\right) \cdot \left(z + 1.0\right)}\]
\[\begin{array}{l} \mathbf{if}\;x \le 2.2502306453381415 \cdot 10^{-36}:\\ \;\;\;\;\frac{y \cdot \frac{x}{z}}{z \cdot \left(z + 1.0\right)}\\ \mathbf{else}:\\ \;\;\;\;\left(\frac{\frac{y}{z}}{z} \cdot \left(\sqrt[3]{\frac{x}{1.0 + z}} \cdot \sqrt[3]{\frac{x}{1.0 + z}}\right)\right) \cdot \sqrt[3]{\frac{x}{1.0 + z}}\\ \end{array}\]

Error

Bits error versus x

Bits error versus y

Bits error versus z

Target

Original13.9
Target4.0
Herbie3.6
\[\begin{array}{l} \mathbf{if}\;z \lt 249.6182814532307:\\ \;\;\;\;\frac{y \cdot \frac{x}{z}}{z + z \cdot z}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{\frac{y}{z}}{1 + z} \cdot x}{z}\\ \end{array}\]

Derivation

  1. Split input into 2 regimes
  2. if x < 2.2502306453381415e-36

    1. Initial program 13.4

      \[\frac{x \cdot y}{\left(z \cdot z\right) \cdot \left(z + 1.0\right)}\]
    2. Taylor expanded around 0 23.1

      \[\leadsto \frac{x \cdot y}{\color{blue}{1.0 \cdot {z}^{2} + {z}^{3}}}\]
    3. Applied simplify6.4

      \[\leadsto \color{blue}{\frac{\frac{y}{z}}{z} \cdot \frac{x}{1.0 + z}}\]
    4. Using strategy rm
    5. Applied div-inv6.4

      \[\leadsto \color{blue}{\left(\frac{y}{z} \cdot \frac{1}{z}\right)} \cdot \frac{x}{1.0 + z}\]
    6. Applied associate-*l*3.3

      \[\leadsto \color{blue}{\frac{y}{z} \cdot \left(\frac{1}{z} \cdot \frac{x}{1.0 + z}\right)}\]
    7. Applied simplify3.2

      \[\leadsto \frac{y}{z} \cdot \color{blue}{\frac{\frac{x}{z}}{z + 1.0}}\]
    8. Using strategy rm
    9. Applied frac-times3.8

      \[\leadsto \color{blue}{\frac{y \cdot \frac{x}{z}}{z \cdot \left(z + 1.0\right)}}\]

    if 2.2502306453381415e-36 < x

    1. Initial program 15.7

      \[\frac{x \cdot y}{\left(z \cdot z\right) \cdot \left(z + 1.0\right)}\]
    2. Taylor expanded around 0 25.1

      \[\leadsto \frac{x \cdot y}{\color{blue}{1.0 \cdot {z}^{2} + {z}^{3}}}\]
    3. Applied simplify2.4

      \[\leadsto \color{blue}{\frac{\frac{y}{z}}{z} \cdot \frac{x}{1.0 + z}}\]
    4. Using strategy rm
    5. Applied add-cube-cbrt2.9

      \[\leadsto \frac{\frac{y}{z}}{z} \cdot \color{blue}{\left(\left(\sqrt[3]{\frac{x}{1.0 + z}} \cdot \sqrt[3]{\frac{x}{1.0 + z}}\right) \cdot \sqrt[3]{\frac{x}{1.0 + z}}\right)}\]
    6. Applied associate-*r*2.9

      \[\leadsto \color{blue}{\left(\frac{\frac{y}{z}}{z} \cdot \left(\sqrt[3]{\frac{x}{1.0 + z}} \cdot \sqrt[3]{\frac{x}{1.0 + z}}\right)\right) \cdot \sqrt[3]{\frac{x}{1.0 + z}}}\]
  3. Recombined 2 regimes into one program.
  4. Removed slow pow expressions.

Runtime

Time bar (total: 56.3s)Debug log

herbie shell --seed '#(1567391828 2030694642 2833800258 828025724 3004380912 3532991858)' +o setup:early-exit +o reduce:binary-search
(FPCore (x y z)
  :name "Statistics.Distribution.Beta:$cvariance from math-functions-0.1.5.2"

  :herbie-target
  (if (< z 249.6182814532307) (/ (* y (/ x z)) (+ z (* z z))) (/ (* (/ (/ y z) (+ 1 z)) x) z))

  (/ (* x y) (* (* z z) (+ z 1.0))))