Average Error: 1.4 → 0.1
Time: 44.1s
Precision: 64
Internal Precision: 576
\[\left|\frac{x + 4}{y} - \frac{x}{y} \cdot z\right|\]
\[\begin{array}{l} \mathbf{if}\;\left(4 + x\right) - z \cdot x \le -5.6393187622857715 \cdot 10^{+187}:\\ \;\;\;\;\left|\frac{x + 4}{y} - x \cdot \frac{z}{y}\right|\\ \mathbf{if}\;\left(4 + x\right) - z \cdot x \le 1.2848827157438108 \cdot 10^{+278}:\\ \;\;\;\;\left|\frac{x + 4}{y} - \frac{x \cdot z}{y}\right|\\ \mathbf{else}:\\ \;\;\;\;\left|\left(x + 4\right) \cdot \frac{1}{y} - \frac{x}{y} \cdot z\right|\\ \end{array}\]

Error

Bits error versus x

Bits error versus y

Bits error versus z

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Derivation

  1. Split input into 3 regimes
  2. if (- (+ 4 x) (* z x)) < -5.6393187622857715e+187

    1. Initial program 0.4

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

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

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

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

    if -5.6393187622857715e+187 < (- (+ 4 x) (* z x)) < 1.2848827157438108e+278

    1. Initial program 1.6

      \[\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|\]

    if 1.2848827157438108e+278 < (- (+ 4 x) (* z x))

    1. Initial program 0.2

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

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

Runtime

Time bar (total: 44.1s)Debug logProfile

herbie shell --seed 2019053 
(FPCore (x y z)
  :name "fabs fraction 1"
  (fabs (- (/ (+ x 4) y) (* (/ x y) z))))