Average Error: 7.6 → 7.6
Time: 17.2s
Precision: 64
Internal precision: 128
\[\frac{x + y}{1.0 - \frac{y}{z}}\]
\[\frac{x + y}{1.0 - \frac{y}{z}}\]

Error

Bits error versus x

Bits error versus y

Bits error versus z

Target

Original7.6
Comparison4.1
Herbie7.6
\[ \begin{array}{l} \mathbf{if}\;y \lt -3.7429310762689856 \cdot 10^{+171}:\\ \;\;\;\;\frac{y + x}{-y} \cdot z\\ \mathbf{if}\;y \lt 3.5534662456086734 \cdot 10^{+168}:\\ \;\;\;\;\frac{x + y}{1.0 - \frac{y}{z}}\\ \mathbf{else}:\\ \;\;\;\;\frac{y + x}{-y} \cdot z\\ \end{array} \]

Derivation

  1. Initial program 7.6

    \[\frac{x + y}{1.0 - \frac{y}{z}}\]
  2. Removed slow pow expressions

Runtime

Time bar (total: 17.2s) Debug log

Please include this information when filing a bug report:

herbie --seed '#(3462826599 4231367352 3924214817 2012097776 1502945623 657697453)'
(FPCore (x y z)
  :name "Graphics.Rendering.Chart.Backend.Diagrams:calcFontMetrics from Chart-diagrams-1.5.1, A"

  :target
  (if (< y -3.7429310762689856e+171) (* (/ (+ y x) (- y)) z) (if (< y 3.5534662456086734e+168) (/ (+ x y) (- 1.0 (/ y z))) (* (/ (+ y x) (- y)) z)))

  (/ (+ x y) (- 1.0 (/ y z))))