Average Error: 6.8 → 1.2
Time: 3.3s
Precision: 64
\[x + \frac{y \cdot \left(z - x\right)}{t}\]
\[\begin{array}{l} \mathbf{if}\;t \le -2.3586519208860508 \cdot 10^{25}:\\ \;\;\;\;x + \frac{\sqrt[3]{y}}{\frac{\sqrt[3]{t} \cdot \sqrt[3]{t}}{\sqrt[3]{y}}} \cdot \frac{\sqrt[3]{y}}{\frac{\sqrt[3]{t}}{z - x}}\\ \mathbf{elif}\;t \le 6.9694522298809892 \cdot 10^{-21}:\\ \;\;\;\;x + \left(\frac{z \cdot y}{t} - \frac{x \cdot y}{t}\right)\\ \mathbf{else}:\\ \;\;\;\;x + \frac{y}{t} \cdot \left(z - x\right)\\ \end{array}\]
x + \frac{y \cdot \left(z - x\right)}{t}
\begin{array}{l}
\mathbf{if}\;t \le -2.3586519208860508 \cdot 10^{25}:\\
\;\;\;\;x + \frac{\sqrt[3]{y}}{\frac{\sqrt[3]{t} \cdot \sqrt[3]{t}}{\sqrt[3]{y}}} \cdot \frac{\sqrt[3]{y}}{\frac{\sqrt[3]{t}}{z - x}}\\

\mathbf{elif}\;t \le 6.9694522298809892 \cdot 10^{-21}:\\
\;\;\;\;x + \left(\frac{z \cdot y}{t} - \frac{x \cdot y}{t}\right)\\

\mathbf{else}:\\
\;\;\;\;x + \frac{y}{t} \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 <= -2.358651920886051e+25)) {
		VAR = (x + ((cbrt(y) / ((cbrt(t) * cbrt(t)) / cbrt(y))) * (cbrt(y) / (cbrt(t) / (z - x)))));
	} else {
		double VAR_1;
		if ((t <= 6.969452229880989e-21)) {
			VAR_1 = (x + (((z * y) / t) - ((x * y) / t)));
		} else {
			VAR_1 = (x + ((y / t) * (z - x)));
		}
		VAR = VAR_1;
	}
	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.8
Target1.9
Herbie1.2
\[x - \left(x \cdot \frac{y}{t} + \left(-z\right) \cdot \frac{y}{t}\right)\]

Derivation

  1. Split input into 3 regimes
  2. if t < -2.358651920886051e+25

    1. Initial program 10.8

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

      \[\leadsto x + \color{blue}{\frac{y}{\frac{t}{z - x}}}\]
    4. Using strategy rm
    5. Applied *-un-lft-identity1.1

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

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

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

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

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

      \[\leadsto x + \color{blue}{\frac{\sqrt[3]{y}}{\frac{\sqrt[3]{t} \cdot \sqrt[3]{t}}{\sqrt[3]{y}}}} \cdot \frac{\sqrt[3]{y}}{\frac{\sqrt[3]{t}}{z - x}}\]

    if -2.358651920886051e+25 < t < 6.969452229880989e-21

    1. Initial program 1.9

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

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

      \[\leadsto x + \color{blue}{\frac{y}{\sqrt[3]{t} \cdot \sqrt[3]{t}} \cdot \frac{z - x}{\sqrt[3]{t}}}\]
    5. Taylor expanded around 0 1.9

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

    if 6.969452229880989e-21 < t

    1. Initial program 8.8

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \le -2.3586519208860508 \cdot 10^{25}:\\ \;\;\;\;x + \frac{\sqrt[3]{y}}{\frac{\sqrt[3]{t} \cdot \sqrt[3]{t}}{\sqrt[3]{y}}} \cdot \frac{\sqrt[3]{y}}{\frac{\sqrt[3]{t}}{z - x}}\\ \mathbf{elif}\;t \le 6.9694522298809892 \cdot 10^{-21}:\\ \;\;\;\;x + \left(\frac{z \cdot y}{t} - \frac{x \cdot y}{t}\right)\\ \mathbf{else}:\\ \;\;\;\;x + \frac{y}{t} \cdot \left(z - x\right)\\ \end{array}\]

Reproduce

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