Average Error: 11.5 → 2.4
Time: 3.4s
Precision: binary64
\[\frac{x \cdot \left(y - z\right)}{t - z}\]
\[\begin{array}{l} \mathbf{if}\;x \le -4.65492457237323704 \cdot 10^{-300} \lor \neg \left(x \le 2.82887926197790055 \cdot 10^{62}\right):\\ \;\;\;\;\frac{x}{\frac{t}{y - z} - \frac{z}{y - z}}\\ \mathbf{else}:\\ \;\;\;\;\frac{x \cdot y + x \cdot \left(-z\right)}{t - z}\\ \end{array}\]

Error

Bits error versus x

Bits error versus y

Bits error versus z

Bits error versus t

Target

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

Derivation

  1. Split input into 2 regimes
  2. if x < -4.65492457237323704e-300 or 2.82887926197790055e62 < x

    1. Initial program 16.0

      \[\frac{x \cdot \left(y - z\right)}{t - z}\]
    2. Using strategy rm
    3. Applied associate-/l*2.3

      \[\leadsto \color{blue}{\frac{x}{\frac{t - z}{y - z}}}\]
    4. Using strategy rm
    5. Applied div-sub2.3

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

    if -4.65492457237323704e-300 < x < 2.82887926197790055e62

    1. Initial program 2.4

      \[\frac{x \cdot \left(y - z\right)}{t - z}\]
    2. Using strategy rm
    3. Applied sub-neg2.4

      \[\leadsto \frac{x \cdot \color{blue}{\left(y + \left(-z\right)\right)}}{t - z}\]
    4. Applied distribute-lft-in2.4

      \[\leadsto \frac{\color{blue}{x \cdot y + x \cdot \left(-z\right)}}{t - z}\]
  3. Recombined 2 regimes into one program.
  4. Final simplification2.4

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \le -4.65492457237323704 \cdot 10^{-300} \lor \neg \left(x \le 2.82887926197790055 \cdot 10^{62}\right):\\ \;\;\;\;\frac{x}{\frac{t}{y - z} - \frac{z}{y - z}}\\ \mathbf{else}:\\ \;\;\;\;\frac{x \cdot y + x \cdot \left(-z\right)}{t - z}\\ \end{array}\]

Reproduce

herbie shell --seed 2020150 
(FPCore (x y z t)
  :name "Graphics.Rendering.Chart.Plot.AreaSpots:renderAreaSpots4D from Chart-1.5.3"
  :precision binary64

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

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