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

Error

Bits error versus x

Bits error versus y

Bits error versus z

Target

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

Derivation

  1. Initial program 0.2

    \[1.0 + \frac{4.0 \cdot \left(\left(x + y \cdot 0.75\right) - z\right)}{y}\]
  2. Applied taylor 0.0

    \[\leadsto 1.0 + \left(\left(4.0 \cdot \frac{x}{y} + 3.0\right) - 4.0 \cdot \frac{z}{y}\right)\]
  3. Taylor expanded around 0 0.0

    \[\leadsto 1.0 + \color{blue}{\left(\left(4.0 \cdot \frac{x}{y} + 3.0\right) - 4.0 \cdot \frac{z}{y}\right)}\]
  4. Applied simplify 0.2

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

Runtime

Time bar (total: 32.8s) Debug log

Please include this information when filing a bug report:

herbie --seed '#(2408369136 76760254 3791324381 2666266571 2128017693 2801803130)'
(FPCore (x y z)
  :name "Data.Array.Repa.Algorithms.ColorRamp:rampColorHotToCold from repa-algorithms-3.4.0.1, A"

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

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