Average Error: 1.7 → 0.1
Time: 53.3s
Precision: 64
Internal Precision: 576
\[\left|\frac{x + 4}{y} - \frac{x}{y} \cdot z\right|\]
\[\begin{array}{l} \mathbf{if}\;\left(x + 4\right) - x \cdot z \le -9.691416588521538 \cdot 10^{+289}:\\ \;\;\;\;\left|\frac{x + 4}{y} - x \cdot \frac{z}{y}\right|\\ \mathbf{if}\;\left(x + 4\right) - x \cdot z \le 3.1412149248979447 \cdot 10^{+273}:\\ \;\;\;\;\left|\frac{\left(x + 4\right) - 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 (- (+ x 4) (* x z)) < -9.691416588521538e+289

    1. Initial program 0.3

      \[\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*0.3

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

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

    if -9.691416588521538e+289 < (- (+ x 4) (* x z)) < 3.1412149248979447e+273

    1. Initial program 1.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 3.1412149248979447e+273 < (- (+ x 4) (* x z))

    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|\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: 53.3s)Debug logProfile

herbie shell --seed '#(1072967564 1937075727 894099792 790700740 1036514779 1027793188)' 
(FPCore (x y z)
  :name "fabs fraction 1"
  (fabs (- (/ (+ x 4) y) (* (/ x y) z))))