Average Error: 1.6 → 0.2
Time: 20.6s
Precision: 64
Internal Precision: 128
\[\left|\frac{x + 4}{y} - \frac{x}{y} \cdot z\right|\]
\[\begin{array}{l} \mathbf{if}\;x \le -1.5784118019019932 \cdot 10^{+61} \lor \neg \left(x \le 1.8536541451637802 \cdot 10^{+24}\right):\\ \;\;\;\;\left|\frac{4 + x}{y} - \frac{\frac{x}{y}}{\frac{1}{z}}\right|\\ \mathbf{else}:\\ \;\;\;\;\left|\frac{4 + x}{y} - \frac{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.5784118019019932e+61 or 1.8536541451637802e+24 < x

    1. Initial program 0.1

      \[\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.1

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

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

    if -1.5784118019019932e+61 < x < 1.8536541451637802e+24

    1. Initial program 2.3

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

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

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

      \[\leadsto \left|\frac{4 + x}{y} - \color{blue}{\frac{\frac{x}{y}}{\frac{1}{z}}}\right|\]
    6. Taylor expanded around -inf 0.3

      \[\leadsto \left|\frac{4 + x}{y} - \color{blue}{\frac{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.5784118019019932 \cdot 10^{+61} \lor \neg \left(x \le 1.8536541451637802 \cdot 10^{+24}\right):\\ \;\;\;\;\left|\frac{4 + x}{y} - \frac{\frac{x}{y}}{\frac{1}{z}}\right|\\ \mathbf{else}:\\ \;\;\;\;\left|\frac{4 + x}{y} - \frac{z \cdot x}{y}\right|\\ \end{array}\]

Runtime

Time bar (total: 20.6s)Debug logProfile

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