Average Error: 1.6 → 0.5
Time: 22.7s
Precision: 64
Internal Precision: 128
\[\left|\frac{x + 4}{y} - \frac{x}{y} \cdot z\right|\]
\[\begin{array}{l} \mathbf{if}\;x \le -5.276323614966944 \cdot 10^{+69}:\\ \;\;\;\;\left|\frac{4 + x}{y} - \frac{z}{\frac{y}{x}}\right|\\ \mathbf{elif}\;x \le 2.3331813960458443 \cdot 10^{+116}:\\ \;\;\;\;\left|\frac{4 + x}{y} - \frac{z \cdot x}{y}\right|\\ \mathbf{else}:\\ \;\;\;\;\left|\frac{4 + x}{y} - \frac{1}{\frac{\frac{y}{z}}{x}}\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 < -5.276323614966944e+69

    1. Initial program 0.1

      \[\left|\frac{x + 4}{y} - \frac{x}{y} \cdot z\right|\]
    2. Using strategy rm
    3. Applied add-sqr-sqrt29.9

      \[\leadsto \left|\color{blue}{\sqrt{\frac{x + 4}{y}} \cdot \sqrt{\frac{x + 4}{y}}} - \frac{x}{y} \cdot z\right|\]
    4. Applied prod-diff29.9

      \[\leadsto \left|\color{blue}{(\left(\sqrt{\frac{x + 4}{y}}\right) \cdot \left(\sqrt{\frac{x + 4}{y}}\right) + \left(-z \cdot \frac{x}{y}\right))_* + (\left(-z\right) \cdot \left(\frac{x}{y}\right) + \left(z \cdot \frac{x}{y}\right))_*}\right|\]
    5. Simplified0.1

      \[\leadsto \left|\color{blue}{\left(\frac{4 + x}{y} - \frac{z}{\frac{y}{x}}\right)} + (\left(-z\right) \cdot \left(\frac{x}{y}\right) + \left(z \cdot \frac{x}{y}\right))_*\right|\]
    6. Simplified0.1

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

    if -5.276323614966944e+69 < x < 2.3331813960458443e+116

    1. Initial program 2.1

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

      \[\leadsto \left|\frac{4 + x}{y} - \frac{x}{\frac{y}{z}}\right|\]
    3. Taylor expanded around inf 0.6

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

    if 2.3331813960458443e+116 < x

    1. Initial program 0.1

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

      \[\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|\]
  3. Recombined 3 regimes into one program.
  4. Final simplification0.5

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \le -5.276323614966944 \cdot 10^{+69}:\\ \;\;\;\;\left|\frac{4 + x}{y} - \frac{z}{\frac{y}{x}}\right|\\ \mathbf{elif}\;x \le 2.3331813960458443 \cdot 10^{+116}:\\ \;\;\;\;\left|\frac{4 + x}{y} - \frac{z \cdot x}{y}\right|\\ \mathbf{else}:\\ \;\;\;\;\left|\frac{4 + x}{y} - \frac{1}{\frac{\frac{y}{z}}{x}}\right|\\ \end{array}\]

Runtime

Time bar (total: 22.7s)Debug logProfile

BaselineHerbieOracleSpan%
Regimes1.70.50.01.772.2%
herbie shell --seed 2018352 +o rules:numerics
(FPCore (x y z)
  :name "fabs fraction 1"
  (fabs (- (/ (+ x 4) y) (* (/ x y) z))))