Average Error: 1.9 → 0.3
Time: 26.6s
Precision: 64
Internal precision: 128
\[x - \frac{y - z}{\frac{\left(t - z\right) + 1.0}{a}}\]
\[x - \frac{\frac{y - z}{\left(t - z\right) + 1.0}}{\frac{1}{a}}\]

Error

Bits error versus x

Bits error versus y

Bits error versus z

Bits error versus t

Bits error versus a

Target

Original1.9
Comparison0.2
Herbie0.3
\[ x - \frac{y - z}{\left(t - z\right) + 1.0} \cdot a \]

Derivation

  1. Initial program 1.9

    \[x - \frac{y - z}{\frac{\left(t - z\right) + 1.0}{a}}\]
  2. Using strategy rm
  3. Applied div-inv 2.0

    \[\leadsto x - \frac{y - z}{\color{blue}{\left(\left(t - z\right) + 1.0\right) \cdot \frac{1}{a}}}\]
  4. Applied associate-/r* 0.3

    \[\leadsto x - \color{blue}{\frac{\frac{y - z}{\left(t - z\right) + 1.0}}{\frac{1}{a}}}\]
  5. Removed slow pow expressions

Runtime

Time bar (total: 26.6s) Debug log

Please include this information when filing a bug report:

herbie --seed '#(3392384659 2906141649 3737947471 1525718599 1029982718 2656375350)'
(FPCore (x y z t a)
  :name "Graphics.Rendering.Chart.SparkLine:renderSparkLine from Chart-1.5.3"

  :target
  (- x (* (/ (- y z) (+ (- t z) 1.0)) a))

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