Average Error: 9.6 → 0.0
Time: 36.0s
Precision: 64
Internal Precision: 384
\[\frac{x + y \cdot \left(z - x\right)}{z}\]
\[\left(y + \frac{x}{z}\right) - \frac{y}{\frac{z}{x}}\]

Error

Bits error versus x

Bits error versus y

Bits error versus z

Target

Original9.6
Target0.0
Herbie0.0
\[\left(y + \frac{x}{z}\right) - \frac{y}{\frac{z}{x}}\]

Derivation

  1. Initial program 9.6

    \[\frac{x + y \cdot \left(z - x\right)}{z}\]
  2. Taylor expanded around 0 3.3

    \[\leadsto \color{blue}{\left(y + \frac{x}{z}\right) - \frac{y \cdot x}{z}}\]
  3. Using strategy rm
  4. Applied associate-/l*0.0

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

Runtime

Time bar (total: 36.0s)Debug log

herbie shell --seed '#(1567391828 2030694642 2833800258 828025724 3004380912 3532991858)' +o setup:early-exit
(FPCore (x y z)
  :name "Diagrams.Backend.Rasterific:rasterificRadialGradient from diagrams-rasterific-1.3.1.3"

  :herbie-target
  (- (+ y (/ x z)) (/ y (/ z x)))

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