Average Error: 6.9 → 2.0
Time: 3.5s
Precision: binary64
\[x + \frac{y \cdot \left(z - x\right)}{t}\]
\[\begin{array}{l} \mathbf{if}\;y \leq -1.8785827045278664 \cdot 10^{-119}:\\ \;\;\;\;x + \frac{y}{\sqrt[3]{t} \cdot \sqrt[3]{t}} \cdot \frac{z - x}{\sqrt[3]{t}}\\ \mathbf{elif}\;y \leq 2.0458176807427126 \cdot 10^{-151}:\\ \;\;\;\;x + \frac{y \cdot \left(z - x\right)}{t}\\ \mathbf{else}:\\ \;\;\;\;x + \left(z - x\right) \cdot \frac{y}{t}\\ \end{array}\]
x + \frac{y \cdot \left(z - x\right)}{t}
\begin{array}{l}
\mathbf{if}\;y \leq -1.8785827045278664 \cdot 10^{-119}:\\
\;\;\;\;x + \frac{y}{\sqrt[3]{t} \cdot \sqrt[3]{t}} \cdot \frac{z - x}{\sqrt[3]{t}}\\

\mathbf{elif}\;y \leq 2.0458176807427126 \cdot 10^{-151}:\\
\;\;\;\;x + \frac{y \cdot \left(z - x\right)}{t}\\

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

\end{array}
(FPCore (x y z t) :precision binary64 (+ x (/ (* y (- z x)) t)))
(FPCore (x y z t)
 :precision binary64
 (if (<= y -1.8785827045278664e-119)
   (+ x (* (/ y (* (cbrt t) (cbrt t))) (/ (- z x) (cbrt t))))
   (if (<= y 2.0458176807427126e-151)
     (+ x (/ (* y (- z x)) t))
     (+ x (* (- z x) (/ y t))))))
double code(double x, double y, double z, double t) {
	return ((double) (x + (((double) (y * ((double) (z - x)))) / t)));
}
double code(double x, double y, double z, double t) {
	double tmp;
	if ((y <= -1.8785827045278664e-119)) {
		tmp = ((double) (x + ((double) ((y / ((double) (((double) cbrt(t)) * ((double) cbrt(t))))) * (((double) (z - x)) / ((double) cbrt(t)))))));
	} else {
		double tmp_1;
		if ((y <= 2.0458176807427126e-151)) {
			tmp_1 = ((double) (x + (((double) (y * ((double) (z - x)))) / t)));
		} else {
			tmp_1 = ((double) (x + ((double) (((double) (z - x)) * (y / t)))));
		}
		tmp = tmp_1;
	}
	return tmp;
}

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

Derivation

  1. Split input into 3 regimes
  2. if y < -1.87858270452786636e-119

    1. Initial program 10.6

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

      \[\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-frac_binary642.1

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

    if -1.87858270452786636e-119 < y < 2.04581768074271265e-151

    1. Initial program 1.4

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

    if 2.04581768074271265e-151 < y

    1. Initial program 9.5

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

      \[\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-frac_binary642.0

      \[\leadsto x + \color{blue}{\frac{y}{\sqrt[3]{t} \cdot \sqrt[3]{t}} \cdot \frac{z - x}{\sqrt[3]{t}}}\]
    5. Using strategy rm
    6. Applied pow1_binary642.0

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

      \[\leadsto x + \color{blue}{{\left(\frac{y}{\sqrt[3]{t} \cdot \sqrt[3]{t}}\right)}^{1}} \cdot {\left(\frac{z - x}{\sqrt[3]{t}}\right)}^{1}\]
    8. Applied pow-prod-down_binary642.0

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -1.8785827045278664 \cdot 10^{-119}:\\ \;\;\;\;x + \frac{y}{\sqrt[3]{t} \cdot \sqrt[3]{t}} \cdot \frac{z - x}{\sqrt[3]{t}}\\ \mathbf{elif}\;y \leq 2.0458176807427126 \cdot 10^{-151}:\\ \;\;\;\;x + \frac{y \cdot \left(z - x\right)}{t}\\ \mathbf{else}:\\ \;\;\;\;x + \left(z - x\right) \cdot \frac{y}{t}\\ \end{array}\]

Reproduce

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