Average Error: 6.4 → 1.2
Time: 3.2s
Precision: 64
\[x + \frac{y \cdot \left(z - x\right)}{t}\]
\[\begin{array}{l} \mathbf{if}\;t \le -4.8433825726185352 \cdot 10^{-33} \lor \neg \left(t \le 3.59028723149019767 \cdot 10^{27}\right):\\ \;\;\;\;x + \frac{y}{t} \cdot \left(z - x\right)\\ \mathbf{else}:\\ \;\;\;\;x + \frac{1}{\frac{t}{y \cdot \left(z - x\right)}}\\ \end{array}\]
x + \frac{y \cdot \left(z - x\right)}{t}
\begin{array}{l}
\mathbf{if}\;t \le -4.8433825726185352 \cdot 10^{-33} \lor \neg \left(t \le 3.59028723149019767 \cdot 10^{27}\right):\\
\;\;\;\;x + \frac{y}{t} \cdot \left(z - x\right)\\

\mathbf{else}:\\
\;\;\;\;x + \frac{1}{\frac{t}{y \cdot \left(z - x\right)}}\\

\end{array}
double code(double x, double y, double z, double t) {
	return (x + ((y * (z - x)) / t));
}
double code(double x, double y, double z, double t) {
	double VAR;
	if (((t <= -4.843382572618535e-33) || !(t <= 3.5902872314901977e+27))) {
		VAR = (x + ((y / t) * (z - x)));
	} else {
		VAR = (x + (1.0 / (t / (y * (z - x)))));
	}
	return VAR;
}

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

Original6.4
Target2.0
Herbie1.2
\[x - \left(x \cdot \frac{y}{t} + \left(-z\right) \cdot \frac{y}{t}\right)\]

Derivation

  1. Split input into 2 regimes
  2. if t < -4.843382572618535e-33 or 3.5902872314901977e+27 < t

    1. Initial program 9.3

      \[x + \frac{y \cdot \left(z - x\right)}{t}\]
    2. Using strategy rm
    3. Applied clear-num9.3

      \[\leadsto x + \color{blue}{\frac{1}{\frac{t}{y \cdot \left(z - x\right)}}}\]
    4. Using strategy rm
    5. Applied associate-/r*1.2

      \[\leadsto x + \frac{1}{\color{blue}{\frac{\frac{t}{y}}{z - x}}}\]
    6. Using strategy rm
    7. Applied div-inv1.2

      \[\leadsto x + \frac{1}{\color{blue}{\frac{t}{y} \cdot \frac{1}{z - x}}}\]
    8. Applied add-cube-cbrt1.2

      \[\leadsto x + \frac{\color{blue}{\left(\sqrt[3]{1} \cdot \sqrt[3]{1}\right) \cdot \sqrt[3]{1}}}{\frac{t}{y} \cdot \frac{1}{z - x}}\]
    9. Applied times-frac1.2

      \[\leadsto x + \color{blue}{\frac{\sqrt[3]{1} \cdot \sqrt[3]{1}}{\frac{t}{y}} \cdot \frac{\sqrt[3]{1}}{\frac{1}{z - x}}}\]
    10. Simplified1.0

      \[\leadsto x + \color{blue}{\frac{y}{t}} \cdot \frac{\sqrt[3]{1}}{\frac{1}{z - x}}\]
    11. Simplified1.0

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

    if -4.843382572618535e-33 < t < 3.5902872314901977e+27

    1. Initial program 1.5

      \[x + \frac{y \cdot \left(z - x\right)}{t}\]
    2. Using strategy rm
    3. Applied clear-num1.6

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \le -4.8433825726185352 \cdot 10^{-33} \lor \neg \left(t \le 3.59028723149019767 \cdot 10^{27}\right):\\ \;\;\;\;x + \frac{y}{t} \cdot \left(z - x\right)\\ \mathbf{else}:\\ \;\;\;\;x + \frac{1}{\frac{t}{y \cdot \left(z - x\right)}}\\ \end{array}\]

Reproduce

herbie shell --seed 2020105 
(FPCore (x y z t)
  :name "Optimisation.CirclePacking:place from circle-packing-0.1.0.4, D"
  :precision binary64

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

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