Average Error: 1.8 → 0.2
Time: 16.6s
Precision: 64
Internal Precision: 576
\[\left|\frac{x + 4}{y} - \frac{x}{y} \cdot z\right|\]
\[\begin{array}{l} \mathbf{if}\;x \le -1.4785778211902016 \cdot 10^{+72} \lor \neg \left(x \le 4.825419353971 \cdot 10^{-22}\right):\\ \;\;\;\;\left|\frac{4 + x}{y} - x \cdot \frac{z}{y}\right|\\ \mathbf{else}:\\ \;\;\;\;\left|\frac{\left(4 + x\right) - z \cdot x}{y}\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 2 regimes
  2. if x < -1.4785778211902016e+72 or 4.825419353971e-22 < x

    1. Initial program 0.2

      \[\left|\frac{x + 4}{y} - \frac{x}{y} \cdot z\right|\]
    2. Initial simplification0.1

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

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

      \[\leadsto \left|\frac{4 + x}{y} - \color{blue}{\frac{\frac{x}{y}}{\frac{1}{z}}}\right|\]
    6. Using strategy rm
    7. Applied div-inv0.2

      \[\leadsto \left|\frac{4 + x}{y} - \frac{\frac{x}{y}}{\color{blue}{1 \cdot \frac{1}{z}}}\right|\]
    8. Applied div-inv0.2

      \[\leadsto \left|\frac{4 + x}{y} - \frac{\color{blue}{x \cdot \frac{1}{y}}}{1 \cdot \frac{1}{z}}\right|\]
    9. Applied times-frac0.2

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

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

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

    if -1.4785778211902016e+72 < x < 4.825419353971e-22

    1. Initial program 2.7

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \le -1.4785778211902016 \cdot 10^{+72} \lor \neg \left(x \le 4.825419353971 \cdot 10^{-22}\right):\\ \;\;\;\;\left|\frac{4 + x}{y} - x \cdot \frac{z}{y}\right|\\ \mathbf{else}:\\ \;\;\;\;\left|\frac{\left(4 + x\right) - z \cdot x}{y}\right|\\ \end{array}\]

Runtime

Time bar (total: 16.6s)Debug logProfile

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