Average Error: 0.1 → 0.2
Time: 17.6s
Precision: 64
Internal precision: 128
\[1.0 + \frac{4.0 \cdot \left(\left(x + y \cdot 0.25\right) - z\right)}{y}\]
\[1.0 + \frac{4.0}{\frac{y}{\left(x + y \cdot 0.25\right) - z}}\]

Error

Bits error versus x

Bits error versus y

Bits error versus z

Target

Original0.1
Comparison0.1
Herbie0.2
\[ 1.0 + \frac{4.0 \cdot \left(\left(x + y \cdot 0.25\right) - z\right)}{y} \]

Derivation

  1. Initial program 0.1

    \[1.0 + \frac{4.0 \cdot \left(\left(x + y \cdot 0.25\right) - z\right)}{y}\]
  2. Using strategy rm
  3. Applied associate-/l* 0.2

    \[\leadsto 1.0 + \color{blue}{\frac{4.0}{\frac{y}{\left(x + y \cdot 0.25\right) - z}}}\]
  4. Removed slow pow expressions

Runtime

Time bar (total: 17.6s) Debug log

Please include this information when filing a bug report:

herbie --seed '#(1191672985 1582882820 1644507870 3310841444 351026708 751546345)'
(FPCore (x y z)
  :name "Data.Array.Repa.Algorithms.ColorRamp:rampColorHotToCold from repa-algorithms-3.4.0.1, C"

  :target
  (+ 1.0 (/ (* 4.0 (- (+ x (* y 0.25)) z)) y))

  (+ 1.0 (/ (* 4.0 (- (+ x (* y 0.25)) z)) y)))