Average Error: 6.8 → 1.9
Time: 4.1s
Precision: 64
\[x + \frac{y \cdot \left(z - x\right)}{t}\]
\[\begin{array}{l} \mathbf{if}\;x \le -2.0778965796828648 \cdot 10^{-103} \lor \neg \left(x \le 9.10716533387276044 \cdot 10^{-93}\right):\\ \;\;\;\;x + \frac{y}{t} \cdot \left(z - x\right)\\ \mathbf{else}:\\ \;\;\;\;x + \frac{\sqrt[3]{y} \cdot \sqrt[3]{y}}{1} \cdot \left(\frac{\sqrt[3]{y}}{t} \cdot \left(z - x\right)\right)\\ \end{array}\]
x + \frac{y \cdot \left(z - x\right)}{t}
\begin{array}{l}
\mathbf{if}\;x \le -2.0778965796828648 \cdot 10^{-103} \lor \neg \left(x \le 9.10716533387276044 \cdot 10^{-93}\right):\\
\;\;\;\;x + \frac{y}{t} \cdot \left(z - x\right)\\

\mathbf{else}:\\
\;\;\;\;x + \frac{\sqrt[3]{y} \cdot \sqrt[3]{y}}{1} \cdot \left(\frac{\sqrt[3]{y}}{t} \cdot \left(z - x\right)\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 temp;
	if (((x <= -2.0778965796828648e-103) || !(x <= 9.10716533387276e-93))) {
		temp = (x + ((y / t) * (z - x)));
	} else {
		temp = (x + (((cbrt(y) * cbrt(y)) / 1.0) * ((cbrt(y) / t) * (z - x))));
	}
	return temp;
}

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.8
Target2.1
Herbie1.9
\[x - \left(x \cdot \frac{y}{t} + \left(-z\right) \cdot \frac{y}{t}\right)\]

Derivation

  1. Split input into 2 regimes
  2. if x < -2.0778965796828648e-103 or 9.10716533387276e-93 < x

    1. Initial program 7.9

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

      \[\leadsto x + \color{blue}{\frac{y}{\frac{t}{z - x}}}\]
    4. Using strategy rm
    5. Applied associate-/r/0.5

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

    if -2.0778965796828648e-103 < x < 9.10716533387276e-93

    1. Initial program 5.0

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

      \[\leadsto x + \color{blue}{\frac{y}{\frac{t}{z - x}}}\]
    4. Using strategy rm
    5. Applied associate-/r/4.8

      \[\leadsto x + \color{blue}{\frac{y}{t} \cdot \left(z - x\right)}\]
    6. Using strategy rm
    7. Applied *-un-lft-identity4.8

      \[\leadsto x + \frac{y}{\color{blue}{1 \cdot t}} \cdot \left(z - x\right)\]
    8. Applied add-cube-cbrt5.5

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

      \[\leadsto x + \color{blue}{\left(\frac{\sqrt[3]{y} \cdot \sqrt[3]{y}}{1} \cdot \frac{\sqrt[3]{y}}{t}\right)} \cdot \left(z - x\right)\]
    10. Applied associate-*l*4.3

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \le -2.0778965796828648 \cdot 10^{-103} \lor \neg \left(x \le 9.10716533387276044 \cdot 10^{-93}\right):\\ \;\;\;\;x + \frac{y}{t} \cdot \left(z - x\right)\\ \mathbf{else}:\\ \;\;\;\;x + \frac{\sqrt[3]{y} \cdot \sqrt[3]{y}}{1} \cdot \left(\frac{\sqrt[3]{y}}{t} \cdot \left(z - x\right)\right)\\ \end{array}\]

Reproduce

herbie shell --seed 2020060 
(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)))