Average Error: 1.6 → 0.4
Time: 38.8s
Precision: 64
Internal Precision: 576
\[\left|\frac{x + 4}{y} - \frac{x}{y} \cdot z\right|\]
\[\begin{array}{l} \mathbf{if}\;\frac{x + 4}{y} - \left(x \cdot z\right) \cdot \frac{1}{y} \le -3.514064186078261 \cdot 10^{+303}:\\ \;\;\;\;\left|\frac{1}{\frac{y}{x + 4}} - \frac{x}{y} \cdot z\right|\\ \mathbf{if}\;\frac{x + 4}{y} - \left(x \cdot z\right) \cdot \frac{1}{y} \le 4.1850764650754865 \cdot 10^{-127}:\\ \;\;\;\;\left|\frac{x + 4}{y} - \left(x \cdot z\right) \cdot \frac{1}{y}\right|\\ \mathbf{else}:\\ \;\;\;\;\left|\frac{1}{\frac{y}{x + 4}} - \frac{x}{y} \cdot z\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 4) y) (* (* x z) (/ 1 y))) < -3.514064186078261e+303

    1. Initial program 0.2

      \[\left|\frac{x + 4}{y} - \frac{x}{y} \cdot z\right|\]
    2. Using strategy rm
    3. Applied clear-num0.2

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

    if -3.514064186078261e+303 < (- (/ (+ x 4) y) (* (* x z) (/ 1 y))) < 4.1850764650754865e-127

    1. Initial program 2.2

      \[\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. Using strategy rm
    5. Applied div-inv0.1

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

    if 4.1850764650754865e-127 < (- (/ (+ x 4) y) (* (* x z) (/ 1 y)))

    1. Initial program 0.9

      \[\left|\frac{x + 4}{y} - \frac{x}{y} \cdot z\right|\]
    2. Using strategy rm
    3. Applied clear-num0.9

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

Runtime

Time bar (total: 38.8s)Debug logProfile

herbie shell --seed '#(1071373924 2949776965 1885069702 3247780810 90874544 2263903749)' 
(FPCore (x y z)
  :name "fabs fraction 1"
  (fabs (- (/ (+ x 4) y) (* (/ x y) z))))