Average Error: 11.4 → 2.1
Time: 48.4s
Precision: 64
Internal Precision: 384
\[\frac{x \cdot \left(y - z\right)}{t - z}\]
\[\begin{array}{l} \mathbf{if}\;z \le -6.328658816588737 \cdot 10^{-51}:\\ \;\;\;\;\frac{x}{1} \cdot \frac{y - z}{t - z}\\ \mathbf{if}\;z \le -5.630417899394863 \cdot 10^{-287}:\\ \;\;\;\;\frac{1}{\frac{\frac{t - z}{y - z}}{x}}\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{\frac{t - z}{y - z}}\\ \end{array}\]

Error

Bits error versus x

Bits error versus y

Bits error versus z

Bits error versus t

Target

Original11.4
Target2.0
Herbie2.1
\[\frac{x}{\frac{t - z}{y - z}}\]

Derivation

  1. Split input into 3 regimes
  2. if z < -6.328658816588737e-51

    1. Initial program 14.5

      \[\frac{x \cdot \left(y - z\right)}{t - z}\]
    2. Using strategy rm
    3. Applied *-un-lft-identity14.5

      \[\leadsto \frac{x \cdot \left(y - z\right)}{\color{blue}{1 \cdot \left(t - z\right)}}\]
    4. Applied times-frac0.3

      \[\leadsto \color{blue}{\frac{x}{1} \cdot \frac{y - z}{t - z}}\]

    if -6.328658816588737e-51 < z < -5.630417899394863e-287

    1. Initial program 5.6

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

      \[\leadsto \frac{\color{blue}{y \cdot x - z \cdot x}}{t - z}\]
    3. Applied simplify4.7

      \[\leadsto \color{blue}{\frac{x}{\frac{t - z}{y - z}}}\]
    4. Using strategy rm
    5. Applied clear-num5.1

      \[\leadsto \color{blue}{\frac{1}{\frac{\frac{t - z}{y - z}}{x}}}\]

    if -5.630417899394863e-287 < z

    1. Initial program 11.6

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

      \[\leadsto \frac{\color{blue}{y \cdot x - z \cdot x}}{t - z}\]
    3. Applied simplify2.0

      \[\leadsto \color{blue}{\frac{x}{\frac{t - z}{y - z}}}\]
  3. Recombined 3 regimes into one program.
  4. Removed slow pow expressions.

Runtime

Time bar (total: 48.4s)Debug log

herbie shell --seed '#(1567391828 2030694642 2833800258 828025724 3004380912 3532991858)' +o setup:early-exit
(FPCore (x y z t)
  :name "Graphics.Rendering.Chart.Plot.AreaSpots:renderAreaSpots4D from Chart-1.5.3"

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

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