Average Error: 14.7 → 0.0
Time: 25.8s
Precision: 64
Internal Precision: 128
\[\frac{x}{x \cdot x + 1}\]
\[\begin{array}{l} \mathbf{if}\;x \le -7.057615605098667 \cdot 10^{+42} \lor \neg \left(x \le 794.865895601048\right):\\ \;\;\;\;\left(\frac{1}{x} + \frac{1}{{x}^{5}}\right) - \frac{1}{{x}^{3}}\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{x \cdot x + 1}\\ \end{array}\]

Error

Bits error versus x

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Target

Original14.7
Target0.1
Herbie0.0
\[\frac{1}{x + \frac{1}{x}}\]

Derivation

  1. Split input into 2 regimes
  2. if x < -7.057615605098667e+42 or 794.865895601048 < x

    1. Initial program 32.3

      \[\frac{x}{x \cdot x + 1}\]
    2. Initial simplification32.3

      \[\leadsto \frac{x}{x \cdot x + 1}\]
    3. Using strategy rm
    4. Applied add-sqr-sqrt32.3

      \[\leadsto \frac{x}{\color{blue}{\sqrt{x \cdot x + 1} \cdot \sqrt{x \cdot x + 1}}}\]
    5. Applied associate-/r*32.1

      \[\leadsto \color{blue}{\frac{\frac{x}{\sqrt{x \cdot x + 1}}}{\sqrt{x \cdot x + 1}}}\]
    6. Using strategy rm
    7. Applied *-un-lft-identity32.1

      \[\leadsto \frac{\frac{x}{\sqrt{x \cdot x + 1}}}{\color{blue}{1 \cdot \sqrt{x \cdot x + 1}}}\]
    8. Applied flip3-+56.3

      \[\leadsto \frac{\frac{x}{\sqrt{\color{blue}{\frac{{\left(x \cdot x\right)}^{3} + {1}^{3}}{\left(x \cdot x\right) \cdot \left(x \cdot x\right) + \left(1 \cdot 1 - \left(x \cdot x\right) \cdot 1\right)}}}}}{1 \cdot \sqrt{x \cdot x + 1}}\]
    9. Applied sqrt-div56.3

      \[\leadsto \frac{\frac{x}{\color{blue}{\frac{\sqrt{{\left(x \cdot x\right)}^{3} + {1}^{3}}}{\sqrt{\left(x \cdot x\right) \cdot \left(x \cdot x\right) + \left(1 \cdot 1 - \left(x \cdot x\right) \cdot 1\right)}}}}}{1 \cdot \sqrt{x \cdot x + 1}}\]
    10. Applied associate-/r/56.3

      \[\leadsto \frac{\color{blue}{\frac{x}{\sqrt{{\left(x \cdot x\right)}^{3} + {1}^{3}}} \cdot \sqrt{\left(x \cdot x\right) \cdot \left(x \cdot x\right) + \left(1 \cdot 1 - \left(x \cdot x\right) \cdot 1\right)}}}{1 \cdot \sqrt{x \cdot x + 1}}\]
    11. Applied times-frac56.4

      \[\leadsto \color{blue}{\frac{\frac{x}{\sqrt{{\left(x \cdot x\right)}^{3} + {1}^{3}}}}{1} \cdot \frac{\sqrt{\left(x \cdot x\right) \cdot \left(x \cdot x\right) + \left(1 \cdot 1 - \left(x \cdot x\right) \cdot 1\right)}}{\sqrt{x \cdot x + 1}}}\]
    12. Simplified56.4

      \[\leadsto \color{blue}{\frac{x}{\sqrt{1 + {x}^{6}}}} \cdot \frac{\sqrt{\left(x \cdot x\right) \cdot \left(x \cdot x\right) + \left(1 \cdot 1 - \left(x \cdot x\right) \cdot 1\right)}}{\sqrt{x \cdot x + 1}}\]
    13. Simplified56.4

      \[\leadsto \frac{x}{\sqrt{1 + {x}^{6}}} \cdot \color{blue}{\frac{\sqrt{\left(1 + {x}^{4}\right) - x \cdot x}}{\sqrt{1 + x \cdot x}}}\]
    14. Taylor expanded around -inf 0.0

      \[\leadsto \color{blue}{\left(\frac{1}{{x}^{5}} + \frac{1}{x}\right) - \frac{1}{{x}^{3}}}\]

    if -7.057615605098667e+42 < x < 794.865895601048

    1. Initial program 0.0

      \[\frac{x}{x \cdot x + 1}\]
    2. Initial simplification0.0

      \[\leadsto \frac{x}{x \cdot x + 1}\]
  3. Recombined 2 regimes into one program.
  4. Final simplification0.0

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \le -7.057615605098667 \cdot 10^{+42} \lor \neg \left(x \le 794.865895601048\right):\\ \;\;\;\;\left(\frac{1}{x} + \frac{1}{{x}^{5}}\right) - \frac{1}{{x}^{3}}\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{x \cdot x + 1}\\ \end{array}\]

Runtime

Time bar (total: 25.8s)Debug logProfile

BaselineHerbieOracleSpan%
Regimes14.60.00.014.699.9%
herbie shell --seed 2018352 
(FPCore (x)
  :name "x / (x^2 + 1)"

  :herbie-target
  (/ 1 (+ x (/ 1 x)))

  (/ x (+ (* x x) 1)))