Average Error: 1.6 → 0.1
Time: 33.2s
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} - \frac{1}{\frac{y}{x \cdot z}} \le -8.521434971536245 \cdot 10^{+303}:\\ \;\;\;\;\left|\frac{x + 4}{y} - x \cdot \frac{z}{y}\right|\\ \mathbf{if}\;\frac{x + 4}{y} - \frac{1}{\frac{y}{x \cdot z}} \le 2.9705020639640208 \cdot 10^{+130}:\\ \;\;\;\;\left|\frac{x + 4}{y} - \frac{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

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Derivation

  1. Split input into 3 regimes
  2. if (- (/ (+ x 4) y) (/ 1 (/ y (* x z)))) < -8.521434971536245e+303

    1. Initial program 0.2

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

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

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

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

    if -8.521434971536245e+303 < (- (/ (+ x 4) y) (/ 1 (/ y (* x z)))) < 2.9705020639640208e+130

    1. Initial program 2.0

      \[\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 2.9705020639640208e+130 < (- (/ (+ x 4) y) (/ 1 (/ y (* x z))))

    1. Initial program 0.1

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

Runtime

Time bar (total: 33.2s)Debug logProfile

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