Average Error: 1.6 → 0.4
Time: 30.3s
Precision: 64
Internal Precision: 576
\[\left|\frac{x + 4}{y} - \frac{x}{y} \cdot z\right|\]
\[\begin{array}{l} \mathbf{if}\;x \le -2.156678237515378 \cdot 10^{-86}:\\ \;\;\;\;\left|\frac{x + 4}{y} - \frac{x}{y} \cdot z\right|\\ \mathbf{if}\;x \le 4.0600333681532524 \cdot 10^{-97}:\\ \;\;\;\;\left|\frac{\left(x + 4\right) - x \cdot z}{y}\right|\\ \mathbf{else}:\\ \;\;\;\;\left|\frac{4 + x}{y} - \frac{z}{\frac{y}{x}}\right|\\ \end{array}\]

Error

Bits error versus x

Bits error versus y

Bits error versus z

Derivation

  1. Split input into 3 regimes
  2. if x < -2.156678237515378e-86

    1. Initial program 0.5

      \[\left|\frac{x + 4}{y} - \frac{x}{y} \cdot z\right|\]

    if -2.156678237515378e-86 < x < 4.0600333681532524e-97

    1. Initial program 2.8

      \[\left|\frac{x + 4}{y} - \frac{x}{y} \cdot z\right|\]
    2. Using strategy rm
    3. Applied associate-*l/0.1

      \[\leadsto \left|\frac{x + 4}{y} - \color{blue}{\frac{x \cdot z}{y}}\right|\]
    4. Applied sub-div0.1

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

    if 4.0600333681532524e-97 < x

    1. Initial program 0.8

      \[\left|\frac{x + 4}{y} - \frac{x}{y} \cdot z\right|\]
    2. Using strategy rm
    3. Applied add-cube-cbrt2.0

      \[\leadsto \left|\color{blue}{\left(\sqrt[3]{\frac{x + 4}{y} - \frac{x}{y} \cdot z} \cdot \sqrt[3]{\frac{x + 4}{y} - \frac{x}{y} \cdot z}\right) \cdot \sqrt[3]{\frac{x + 4}{y} - \frac{x}{y} \cdot z}}\right|\]
    4. Taylor expanded around 0 7.2

      \[\leadsto \left|\left(\sqrt[3]{\frac{x + 4}{y} - \frac{x}{y} \cdot z} \cdot \sqrt[3]{\frac{x + 4}{y} - \color{blue}{\frac{z \cdot x}{y}}}\right) \cdot \sqrt[3]{\frac{x + 4}{y} - \frac{x}{y} \cdot z}\right|\]
    5. Applied simplify1.0

      \[\leadsto \color{blue}{\left|\frac{4 + x}{y} - \frac{z}{\frac{y}{x}}\right|}\]
  3. Recombined 3 regimes into one program.

Runtime

Time bar (total: 30.3s)Debug logProfile

herbie shell --seed '#(1071119240 1686926585 3481876196 78132896 2080707795 3185793749)' 
(FPCore (x y z)
  :name "fabs fraction 1"
  (fabs (- (/ (+ x 4) y) (* (/ x y) z))))