Average Error: 1.6 → 0.1
Time: 11.1s
Precision: 64
Internal Precision: 576
\[\left|\frac{x + 4}{y} - \frac{x}{y} \cdot z\right|\]
\[\begin{array}{l} \mathbf{if}\;x \le -1.0986873089252876 \cdot 10^{+41}:\\ \;\;\;\;\left|\frac{4 + x}{y} - \frac{1}{\frac{\frac{y}{z}}{x}}\right|\\ \mathbf{elif}\;x \le 5.707205910123564 \cdot 10^{+21}:\\ \;\;\;\;\left|\frac{4 + x}{y} - \frac{x \cdot z}{y}\right|\\ \mathbf{else}:\\ \;\;\;\;\left|\frac{4 + x}{y} - z \cdot \frac{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 3 regimes
  2. if x < -1.0986873089252876e+41

    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 clear-num0.2

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

    if -1.0986873089252876e+41 < x < 5.707205910123564e+21

    1. Initial program 2.4

      \[\left|\frac{x + 4}{y} - \frac{x}{y} \cdot z\right|\]
    2. Taylor expanded around 0 0.2

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

    if 5.707205910123564e+21 < x

    1. Initial program 0.1

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \le -1.0986873089252876 \cdot 10^{+41}:\\ \;\;\;\;\left|\frac{4 + x}{y} - \frac{1}{\frac{\frac{y}{z}}{x}}\right|\\ \mathbf{elif}\;x \le 5.707205910123564 \cdot 10^{+21}:\\ \;\;\;\;\left|\frac{4 + x}{y} - \frac{x \cdot z}{y}\right|\\ \mathbf{else}:\\ \;\;\;\;\left|\frac{4 + x}{y} - z \cdot \frac{x}{y}\right|\\ \end{array}\]

Runtime

Time bar (total: 11.1s)Debug logProfile

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