Average Error: 1.4 → 0.5
Time: 14.8s
Precision: 64
Internal Precision: 384
\[\left|\frac{x + 4}{y} - \frac{x}{y} \cdot z\right|\]
\[\begin{array}{l} \mathbf{if}\;x \le -4.216271692580594 \cdot 10^{+82}:\\ \;\;\;\;\left|\frac{x + 4}{y} - x \cdot \frac{z}{y}\right|\\ \mathbf{if}\;x \le 6.8886177998792506 \cdot 10^{-127}:\\ \;\;\;\;\left|\frac{\left(x + 4\right) - x \cdot z}{y}\right|\\ \mathbf{else}:\\ \;\;\;\;\left|\frac{x + 4}{y} - \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.216271692580594e+82

    1. Initial program 0.1

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

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

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

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

    if -4.216271692580594e+82 < x < 6.8886177998792506e-127

    1. Initial program 2.1

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

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

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

    if 6.8886177998792506e-127 < x

    1. Initial program 0.9

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

Runtime

Time bar (total: 14.8s)Debug logProfile

herbie shell --seed '#(1064397287 3527694221 3797617954 1138343853 2854031332 1153838279)' 
(FPCore (x y z)
  :name "fabs fraction 1"
  (fabs (- (/ (+ x 4) y) (* (/ x y) z))))