Average Error: 1.9 → 1.9
Time: 3.5s
Precision: 64
\[\frac{x}{y} \cdot \left(z - t\right) + t\]
\[\frac{x}{y} \cdot \left(z - t\right) + t\]
\frac{x}{y} \cdot \left(z - t\right) + t
\frac{x}{y} \cdot \left(z - t\right) + t
double code(double x, double y, double z, double t) {
	return (((x / y) * (z - t)) + t);
}
double code(double x, double y, double z, double t) {
	return (((x / y) * (z - t)) + t);
}

Error

Bits error versus x

Bits error versus y

Bits error versus z

Bits error versus t

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Target

Original1.9
Target2.2
Herbie1.9
\[\begin{array}{l} \mathbf{if}\;z \lt 2.7594565545626922 \cdot 10^{-282}:\\ \;\;\;\;\frac{x}{y} \cdot \left(z - t\right) + t\\ \mathbf{elif}\;z \lt 2.326994450874436 \cdot 10^{-110}:\\ \;\;\;\;x \cdot \frac{z - t}{y} + t\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{y} \cdot \left(z - t\right) + t\\ \end{array}\]

Derivation

  1. Initial program 1.9

    \[\frac{x}{y} \cdot \left(z - t\right) + t\]
  2. Final simplification1.9

    \[\leadsto \frac{x}{y} \cdot \left(z - t\right) + t\]

Reproduce

herbie shell --seed 2020100 
(FPCore (x y z t)
  :name "Numeric.Signal.Multichannel:$cget from hsignal-0.2.7.1"
  :precision binary64

  :herbie-target
  (if (< z 2.759456554562692e-282) (+ (* (/ x y) (- z t)) t) (if (< z 2.326994450874436e-110) (+ (* x (/ (- z t) y)) t) (+ (* (/ x y) (- z t)) t)))

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