Optimisation.CirclePacking:place from circle-packing-0.1.0.4, D

Percentage Accurate: 92.7% → 97.7%
Time: 8.4s
Alternatives: 11
Speedup: 1.1×

Specification

?
\[\begin{array}{l} \\ x + \frac{y \cdot \left(z - x\right)}{t} \end{array} \]
(FPCore (x y z t) :precision binary64 (+ x (/ (* y (- z x)) t)))
double code(double x, double y, double z, double t) {
	return x + ((y * (z - x)) / t);
}
real(8) function code(x, y, z, t)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    code = x + ((y * (z - x)) / t)
end function
public static double code(double x, double y, double z, double t) {
	return x + ((y * (z - x)) / t);
}
def code(x, y, z, t):
	return x + ((y * (z - x)) / t)
function code(x, y, z, t)
	return Float64(x + Float64(Float64(y * Float64(z - x)) / t))
end
function tmp = code(x, y, z, t)
	tmp = x + ((y * (z - x)) / t);
end
code[x_, y_, z_, t_] := N[(x + N[(N[(y * N[(z - x), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
x + \frac{y \cdot \left(z - x\right)}{t}
\end{array}

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

The average percentage accuracy by input value. Horizontal axis shows value of an input variable; the variable is choosen in the title. Vertical axis is accuracy; higher is better. Red represent the original program, while blue represents Herbie's suggestion. These can be toggled with buttons below the plot. The line is an average while dots represent individual samples.

Accuracy vs Speed?

Herbie found 11 alternatives:

AlternativeAccuracySpeedup
The accuracy (vertical axis) and speed (horizontal axis) of each alternatives. Up and to the right is better. The red square shows the initial program, and each blue circle shows an alternative.The line shows the best available speed-accuracy tradeoffs.

Initial Program: 92.7% accurate, 1.0× speedup?

\[\begin{array}{l} \\ x + \frac{y \cdot \left(z - x\right)}{t} \end{array} \]
(FPCore (x y z t) :precision binary64 (+ x (/ (* y (- z x)) t)))
double code(double x, double y, double z, double t) {
	return x + ((y * (z - x)) / t);
}
real(8) function code(x, y, z, t)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    code = x + ((y * (z - x)) / t)
end function
public static double code(double x, double y, double z, double t) {
	return x + ((y * (z - x)) / t);
}
def code(x, y, z, t):
	return x + ((y * (z - x)) / t)
function code(x, y, z, t)
	return Float64(x + Float64(Float64(y * Float64(z - x)) / t))
end
function tmp = code(x, y, z, t)
	tmp = x + ((y * (z - x)) / t);
end
code[x_, y_, z_, t_] := N[(x + N[(N[(y * N[(z - x), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
x + \frac{y \cdot \left(z - x\right)}{t}
\end{array}

Alternative 1: 97.7% accurate, 1.1× speedup?

\[\begin{array}{l} \\ \mathsf{fma}\left(\frac{y}{t}, z - x, x\right) \end{array} \]
(FPCore (x y z t) :precision binary64 (fma (/ y t) (- z x) x))
double code(double x, double y, double z, double t) {
	return fma((y / t), (z - x), x);
}
function code(x, y, z, t)
	return fma(Float64(y / t), Float64(z - x), x)
end
code[x_, y_, z_, t_] := N[(N[(y / t), $MachinePrecision] * N[(z - x), $MachinePrecision] + x), $MachinePrecision]
\begin{array}{l}

\\
\mathsf{fma}\left(\frac{y}{t}, z - x, x\right)
\end{array}
Derivation
  1. Initial program 90.7%

    \[x + \frac{y \cdot \left(z - x\right)}{t} \]
  2. Add Preprocessing
  3. Step-by-step derivation
    1. lift-+.f64N/A

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

      \[\leadsto \color{blue}{\frac{y \cdot \left(z - x\right)}{t} + x} \]
    3. lift-/.f64N/A

      \[\leadsto \color{blue}{\frac{y \cdot \left(z - x\right)}{t}} + x \]
    4. lift-*.f64N/A

      \[\leadsto \frac{\color{blue}{y \cdot \left(z - x\right)}}{t} + x \]
    5. *-commutativeN/A

      \[\leadsto \frac{\color{blue}{\left(z - x\right) \cdot y}}{t} + x \]
    6. associate-/l*N/A

      \[\leadsto \color{blue}{\left(z - x\right) \cdot \frac{y}{t}} + x \]
    7. *-commutativeN/A

      \[\leadsto \color{blue}{\frac{y}{t} \cdot \left(z - x\right)} + x \]
    8. lower-fma.f64N/A

      \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{y}{t}, z - x, x\right)} \]
    9. lower-/.f6497.0

      \[\leadsto \mathsf{fma}\left(\color{blue}{\frac{y}{t}}, z - x, x\right) \]
  4. Applied rewrites97.0%

    \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{y}{t}, z - x, x\right)} \]
  5. Add Preprocessing

Alternative 2: 80.6% accurate, 0.2× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \frac{\left(z - x\right) \cdot y}{t} + x\\ t_2 := \left(z - x\right) \cdot \frac{y}{t}\\ \mathbf{if}\;t\_1 \leq -5 \cdot 10^{+279}:\\ \;\;\;\;t\_2\\ \mathbf{elif}\;t\_1 \leq -2 \cdot 10^{+17}:\\ \;\;\;\;x - \frac{x \cdot y}{t}\\ \mathbf{elif}\;t\_1 \leq 4 \cdot 10^{+194}:\\ \;\;\;\;\mathsf{fma}\left(\frac{z}{t}, y, x\right)\\ \mathbf{else}:\\ \;\;\;\;t\_2\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (let* ((t_1 (+ (/ (* (- z x) y) t) x)) (t_2 (* (- z x) (/ y t))))
   (if (<= t_1 -5e+279)
     t_2
     (if (<= t_1 -2e+17)
       (- x (/ (* x y) t))
       (if (<= t_1 4e+194) (fma (/ z t) y x) t_2)))))
double code(double x, double y, double z, double t) {
	double t_1 = (((z - x) * y) / t) + x;
	double t_2 = (z - x) * (y / t);
	double tmp;
	if (t_1 <= -5e+279) {
		tmp = t_2;
	} else if (t_1 <= -2e+17) {
		tmp = x - ((x * y) / t);
	} else if (t_1 <= 4e+194) {
		tmp = fma((z / t), y, x);
	} else {
		tmp = t_2;
	}
	return tmp;
}
function code(x, y, z, t)
	t_1 = Float64(Float64(Float64(Float64(z - x) * y) / t) + x)
	t_2 = Float64(Float64(z - x) * Float64(y / t))
	tmp = 0.0
	if (t_1 <= -5e+279)
		tmp = t_2;
	elseif (t_1 <= -2e+17)
		tmp = Float64(x - Float64(Float64(x * y) / t));
	elseif (t_1 <= 4e+194)
		tmp = fma(Float64(z / t), y, x);
	else
		tmp = t_2;
	end
	return tmp
end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(N[(N[(z - x), $MachinePrecision] * y), $MachinePrecision] / t), $MachinePrecision] + x), $MachinePrecision]}, Block[{t$95$2 = N[(N[(z - x), $MachinePrecision] * N[(y / t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, -5e+279], t$95$2, If[LessEqual[t$95$1, -2e+17], N[(x - N[(N[(x * y), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 4e+194], N[(N[(z / t), $MachinePrecision] * y + x), $MachinePrecision], t$95$2]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := \frac{\left(z - x\right) \cdot y}{t} + x\\
t_2 := \left(z - x\right) \cdot \frac{y}{t}\\
\mathbf{if}\;t\_1 \leq -5 \cdot 10^{+279}:\\
\;\;\;\;t\_2\\

\mathbf{elif}\;t\_1 \leq -2 \cdot 10^{+17}:\\
\;\;\;\;x - \frac{x \cdot y}{t}\\

\mathbf{elif}\;t\_1 \leq 4 \cdot 10^{+194}:\\
\;\;\;\;\mathsf{fma}\left(\frac{z}{t}, y, x\right)\\

\mathbf{else}:\\
\;\;\;\;t\_2\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if (+.f64 x (/.f64 (*.f64 y (-.f64 z x)) t)) < -5.0000000000000002e279 or 3.99999999999999978e194 < (+.f64 x (/.f64 (*.f64 y (-.f64 z x)) t))

    1. Initial program 80.9%

      \[x + \frac{y \cdot \left(z - x\right)}{t} \]
    2. Add Preprocessing
    3. Taylor expanded in t around 0

      \[\leadsto \color{blue}{\frac{y \cdot \left(z - x\right)}{t}} \]
    4. Step-by-step derivation
      1. lower-/.f64N/A

        \[\leadsto \color{blue}{\frac{y \cdot \left(z - x\right)}{t}} \]
      2. *-commutativeN/A

        \[\leadsto \frac{\color{blue}{\left(z - x\right) \cdot y}}{t} \]
      3. lower-*.f64N/A

        \[\leadsto \frac{\color{blue}{\left(z - x\right) \cdot y}}{t} \]
      4. lower--.f6471.9

        \[\leadsto \frac{\color{blue}{\left(z - x\right)} \cdot y}{t} \]
    5. Applied rewrites71.9%

      \[\leadsto \color{blue}{\frac{\left(z - x\right) \cdot y}{t}} \]
    6. Step-by-step derivation
      1. Applied rewrites82.4%

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

      if -5.0000000000000002e279 < (+.f64 x (/.f64 (*.f64 y (-.f64 z x)) t)) < -2e17

      1. Initial program 99.7%

        \[x + \frac{y \cdot \left(z - x\right)}{t} \]
      2. Add Preprocessing
      3. Taylor expanded in z around 0

        \[\leadsto \color{blue}{x + -1 \cdot \frac{x \cdot y}{t}} \]
      4. Step-by-step derivation
        1. mul-1-negN/A

          \[\leadsto x + \color{blue}{\left(\mathsf{neg}\left(\frac{x \cdot y}{t}\right)\right)} \]
        2. unsub-negN/A

          \[\leadsto \color{blue}{x - \frac{x \cdot y}{t}} \]
        3. lower--.f64N/A

          \[\leadsto \color{blue}{x - \frac{x \cdot y}{t}} \]
        4. lower-/.f64N/A

          \[\leadsto x - \color{blue}{\frac{x \cdot y}{t}} \]
        5. lower-*.f6478.1

          \[\leadsto x - \frac{\color{blue}{x \cdot y}}{t} \]
      5. Applied rewrites78.1%

        \[\leadsto \color{blue}{x - \frac{x \cdot y}{t}} \]

      if -2e17 < (+.f64 x (/.f64 (*.f64 y (-.f64 z x)) t)) < 3.99999999999999978e194

      1. Initial program 97.8%

        \[x + \frac{y \cdot \left(z - x\right)}{t} \]
      2. Add Preprocessing
      3. Step-by-step derivation
        1. lift-+.f64N/A

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

          \[\leadsto \color{blue}{\frac{y \cdot \left(z - x\right)}{t} + x} \]
        3. lift-/.f64N/A

          \[\leadsto \color{blue}{\frac{y \cdot \left(z - x\right)}{t}} + x \]
        4. lift-*.f64N/A

          \[\leadsto \frac{\color{blue}{y \cdot \left(z - x\right)}}{t} + x \]
        5. associate-/l*N/A

          \[\leadsto \color{blue}{y \cdot \frac{z - x}{t}} + x \]
        6. *-commutativeN/A

          \[\leadsto \color{blue}{\frac{z - x}{t} \cdot y} + x \]
        7. lower-fma.f64N/A

          \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{z - x}{t}, y, x\right)} \]
        8. lower-/.f6496.2

          \[\leadsto \mathsf{fma}\left(\color{blue}{\frac{z - x}{t}}, y, x\right) \]
      4. Applied rewrites96.2%

        \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{z - x}{t}, y, x\right)} \]
      5. Taylor expanded in z around inf

        \[\leadsto \mathsf{fma}\left(\color{blue}{\frac{z}{t}}, y, x\right) \]
      6. Step-by-step derivation
        1. lower-/.f6488.1

          \[\leadsto \mathsf{fma}\left(\color{blue}{\frac{z}{t}}, y, x\right) \]
      7. Applied rewrites88.1%

        \[\leadsto \mathsf{fma}\left(\color{blue}{\frac{z}{t}}, y, x\right) \]
    7. Recombined 3 regimes into one program.
    8. Final simplification83.6%

      \[\leadsto \begin{array}{l} \mathbf{if}\;\frac{\left(z - x\right) \cdot y}{t} + x \leq -5 \cdot 10^{+279}:\\ \;\;\;\;\left(z - x\right) \cdot \frac{y}{t}\\ \mathbf{elif}\;\frac{\left(z - x\right) \cdot y}{t} + x \leq -2 \cdot 10^{+17}:\\ \;\;\;\;x - \frac{x \cdot y}{t}\\ \mathbf{elif}\;\frac{\left(z - x\right) \cdot y}{t} + x \leq 4 \cdot 10^{+194}:\\ \;\;\;\;\mathsf{fma}\left(\frac{z}{t}, y, x\right)\\ \mathbf{else}:\\ \;\;\;\;\left(z - x\right) \cdot \frac{y}{t}\\ \end{array} \]
    9. Add Preprocessing

    Alternative 3: 81.4% accurate, 0.6× speedup?

    \[\begin{array}{l} \\ \begin{array}{l} t_1 := \mathsf{fma}\left(\frac{y}{t}, -x, x\right)\\ \mathbf{if}\;x \leq -2 \cdot 10^{+54}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;x \leq -2.3 \cdot 10^{-181}:\\ \;\;\;\;\left(z - x\right) \cdot \frac{y}{t}\\ \mathbf{elif}\;x \leq 4.8 \cdot 10^{+66}:\\ \;\;\;\;\frac{z \cdot y}{t} + x\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
    (FPCore (x y z t)
     :precision binary64
     (let* ((t_1 (fma (/ y t) (- x) x)))
       (if (<= x -2e+54)
         t_1
         (if (<= x -2.3e-181)
           (* (- z x) (/ y t))
           (if (<= x 4.8e+66) (+ (/ (* z y) t) x) t_1)))))
    double code(double x, double y, double z, double t) {
    	double t_1 = fma((y / t), -x, x);
    	double tmp;
    	if (x <= -2e+54) {
    		tmp = t_1;
    	} else if (x <= -2.3e-181) {
    		tmp = (z - x) * (y / t);
    	} else if (x <= 4.8e+66) {
    		tmp = ((z * y) / t) + x;
    	} else {
    		tmp = t_1;
    	}
    	return tmp;
    }
    
    function code(x, y, z, t)
    	t_1 = fma(Float64(y / t), Float64(-x), x)
    	tmp = 0.0
    	if (x <= -2e+54)
    		tmp = t_1;
    	elseif (x <= -2.3e-181)
    		tmp = Float64(Float64(z - x) * Float64(y / t));
    	elseif (x <= 4.8e+66)
    		tmp = Float64(Float64(Float64(z * y) / t) + x);
    	else
    		tmp = t_1;
    	end
    	return tmp
    end
    
    code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(y / t), $MachinePrecision] * (-x) + x), $MachinePrecision]}, If[LessEqual[x, -2e+54], t$95$1, If[LessEqual[x, -2.3e-181], N[(N[(z - x), $MachinePrecision] * N[(y / t), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 4.8e+66], N[(N[(N[(z * y), $MachinePrecision] / t), $MachinePrecision] + x), $MachinePrecision], t$95$1]]]]
    
    \begin{array}{l}
    
    \\
    \begin{array}{l}
    t_1 := \mathsf{fma}\left(\frac{y}{t}, -x, x\right)\\
    \mathbf{if}\;x \leq -2 \cdot 10^{+54}:\\
    \;\;\;\;t\_1\\
    
    \mathbf{elif}\;x \leq -2.3 \cdot 10^{-181}:\\
    \;\;\;\;\left(z - x\right) \cdot \frac{y}{t}\\
    
    \mathbf{elif}\;x \leq 4.8 \cdot 10^{+66}:\\
    \;\;\;\;\frac{z \cdot y}{t} + x\\
    
    \mathbf{else}:\\
    \;\;\;\;t\_1\\
    
    
    \end{array}
    \end{array}
    
    Derivation
    1. Split input into 3 regimes
    2. if x < -2.0000000000000002e54 or 4.8000000000000003e66 < x

      1. Initial program 85.1%

        \[x + \frac{y \cdot \left(z - x\right)}{t} \]
      2. Add Preprocessing
      3. Step-by-step derivation
        1. lift-+.f64N/A

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

          \[\leadsto \color{blue}{\frac{y \cdot \left(z - x\right)}{t} + x} \]
        3. lift-/.f64N/A

          \[\leadsto \color{blue}{\frac{y \cdot \left(z - x\right)}{t}} + x \]
        4. lift-*.f64N/A

          \[\leadsto \frac{\color{blue}{y \cdot \left(z - x\right)}}{t} + x \]
        5. *-commutativeN/A

          \[\leadsto \frac{\color{blue}{\left(z - x\right) \cdot y}}{t} + x \]
        6. associate-/l*N/A

          \[\leadsto \color{blue}{\left(z - x\right) \cdot \frac{y}{t}} + x \]
        7. *-commutativeN/A

          \[\leadsto \color{blue}{\frac{y}{t} \cdot \left(z - x\right)} + x \]
        8. lower-fma.f64N/A

          \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{y}{t}, z - x, x\right)} \]
        9. lower-/.f6499.9

          \[\leadsto \mathsf{fma}\left(\color{blue}{\frac{y}{t}}, z - x, x\right) \]
      4. Applied rewrites99.9%

        \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{y}{t}, z - x, x\right)} \]
      5. Taylor expanded in z around 0

        \[\leadsto \mathsf{fma}\left(\frac{y}{t}, \color{blue}{-1 \cdot x}, x\right) \]
      6. Step-by-step derivation
        1. mul-1-negN/A

          \[\leadsto \mathsf{fma}\left(\frac{y}{t}, \color{blue}{\mathsf{neg}\left(x\right)}, x\right) \]
        2. lower-neg.f6492.3

          \[\leadsto \mathsf{fma}\left(\frac{y}{t}, \color{blue}{-x}, x\right) \]
      7. Applied rewrites92.3%

        \[\leadsto \mathsf{fma}\left(\frac{y}{t}, \color{blue}{-x}, x\right) \]

      if -2.0000000000000002e54 < x < -2.29999999999999991e-181

      1. Initial program 89.3%

        \[x + \frac{y \cdot \left(z - x\right)}{t} \]
      2. Add Preprocessing
      3. Taylor expanded in t around 0

        \[\leadsto \color{blue}{\frac{y \cdot \left(z - x\right)}{t}} \]
      4. Step-by-step derivation
        1. lower-/.f64N/A

          \[\leadsto \color{blue}{\frac{y \cdot \left(z - x\right)}{t}} \]
        2. *-commutativeN/A

          \[\leadsto \frac{\color{blue}{\left(z - x\right) \cdot y}}{t} \]
        3. lower-*.f64N/A

          \[\leadsto \frac{\color{blue}{\left(z - x\right) \cdot y}}{t} \]
        4. lower--.f6470.1

          \[\leadsto \frac{\color{blue}{\left(z - x\right)} \cdot y}{t} \]
      5. Applied rewrites70.1%

        \[\leadsto \color{blue}{\frac{\left(z - x\right) \cdot y}{t}} \]
      6. Step-by-step derivation
        1. Applied rewrites78.6%

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

        if -2.29999999999999991e-181 < x < 4.8000000000000003e66

        1. Initial program 97.8%

          \[x + \frac{y \cdot \left(z - x\right)}{t} \]
        2. Add Preprocessing
        3. Taylor expanded in z around inf

          \[\leadsto x + \frac{\color{blue}{y \cdot z}}{t} \]
        4. Step-by-step derivation
          1. *-commutativeN/A

            \[\leadsto x + \frac{\color{blue}{z \cdot y}}{t} \]
          2. lower-*.f6489.0

            \[\leadsto x + \frac{\color{blue}{z \cdot y}}{t} \]
        5. Applied rewrites89.0%

          \[\leadsto x + \frac{\color{blue}{z \cdot y}}{t} \]
      7. Recombined 3 regimes into one program.
      8. Final simplification88.6%

        \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -2 \cdot 10^{+54}:\\ \;\;\;\;\mathsf{fma}\left(\frac{y}{t}, -x, x\right)\\ \mathbf{elif}\;x \leq -2.3 \cdot 10^{-181}:\\ \;\;\;\;\left(z - x\right) \cdot \frac{y}{t}\\ \mathbf{elif}\;x \leq 4.8 \cdot 10^{+66}:\\ \;\;\;\;\frac{z \cdot y}{t} + x\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(\frac{y}{t}, -x, x\right)\\ \end{array} \]
      9. Add Preprocessing

      Alternative 4: 83.1% accurate, 0.6× speedup?

      \[\begin{array}{l} \\ \begin{array}{l} t_1 := \mathsf{fma}\left(\frac{z}{t}, y, x\right)\\ \mathbf{if}\;t \leq -7.2 \cdot 10^{-75}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;t \leq 2.95 \cdot 10^{+23}:\\ \;\;\;\;\frac{\left(z - x\right) \cdot y}{t}\\ \mathbf{elif}\;t \leq 3.2 \cdot 10^{+100}:\\ \;\;\;\;x - \frac{x \cdot y}{t}\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
      (FPCore (x y z t)
       :precision binary64
       (let* ((t_1 (fma (/ z t) y x)))
         (if (<= t -7.2e-75)
           t_1
           (if (<= t 2.95e+23)
             (/ (* (- z x) y) t)
             (if (<= t 3.2e+100) (- x (/ (* x y) t)) t_1)))))
      double code(double x, double y, double z, double t) {
      	double t_1 = fma((z / t), y, x);
      	double tmp;
      	if (t <= -7.2e-75) {
      		tmp = t_1;
      	} else if (t <= 2.95e+23) {
      		tmp = ((z - x) * y) / t;
      	} else if (t <= 3.2e+100) {
      		tmp = x - ((x * y) / t);
      	} else {
      		tmp = t_1;
      	}
      	return tmp;
      }
      
      function code(x, y, z, t)
      	t_1 = fma(Float64(z / t), y, x)
      	tmp = 0.0
      	if (t <= -7.2e-75)
      		tmp = t_1;
      	elseif (t <= 2.95e+23)
      		tmp = Float64(Float64(Float64(z - x) * y) / t);
      	elseif (t <= 3.2e+100)
      		tmp = Float64(x - Float64(Float64(x * y) / t));
      	else
      		tmp = t_1;
      	end
      	return tmp
      end
      
      code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(z / t), $MachinePrecision] * y + x), $MachinePrecision]}, If[LessEqual[t, -7.2e-75], t$95$1, If[LessEqual[t, 2.95e+23], N[(N[(N[(z - x), $MachinePrecision] * y), $MachinePrecision] / t), $MachinePrecision], If[LessEqual[t, 3.2e+100], N[(x - N[(N[(x * y), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
      
      \begin{array}{l}
      
      \\
      \begin{array}{l}
      t_1 := \mathsf{fma}\left(\frac{z}{t}, y, x\right)\\
      \mathbf{if}\;t \leq -7.2 \cdot 10^{-75}:\\
      \;\;\;\;t\_1\\
      
      \mathbf{elif}\;t \leq 2.95 \cdot 10^{+23}:\\
      \;\;\;\;\frac{\left(z - x\right) \cdot y}{t}\\
      
      \mathbf{elif}\;t \leq 3.2 \cdot 10^{+100}:\\
      \;\;\;\;x - \frac{x \cdot y}{t}\\
      
      \mathbf{else}:\\
      \;\;\;\;t\_1\\
      
      
      \end{array}
      \end{array}
      
      Derivation
      1. Split input into 3 regimes
      2. if t < -7.2000000000000001e-75 or 3.1999999999999999e100 < t

        1. Initial program 84.5%

          \[x + \frac{y \cdot \left(z - x\right)}{t} \]
        2. Add Preprocessing
        3. Step-by-step derivation
          1. lift-+.f64N/A

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

            \[\leadsto \color{blue}{\frac{y \cdot \left(z - x\right)}{t} + x} \]
          3. lift-/.f64N/A

            \[\leadsto \color{blue}{\frac{y \cdot \left(z - x\right)}{t}} + x \]
          4. lift-*.f64N/A

            \[\leadsto \frac{\color{blue}{y \cdot \left(z - x\right)}}{t} + x \]
          5. associate-/l*N/A

            \[\leadsto \color{blue}{y \cdot \frac{z - x}{t}} + x \]
          6. *-commutativeN/A

            \[\leadsto \color{blue}{\frac{z - x}{t} \cdot y} + x \]
          7. lower-fma.f64N/A

            \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{z - x}{t}, y, x\right)} \]
          8. lower-/.f6496.5

            \[\leadsto \mathsf{fma}\left(\color{blue}{\frac{z - x}{t}}, y, x\right) \]
        4. Applied rewrites96.5%

          \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{z - x}{t}, y, x\right)} \]
        5. Taylor expanded in z around inf

          \[\leadsto \mathsf{fma}\left(\color{blue}{\frac{z}{t}}, y, x\right) \]
        6. Step-by-step derivation
          1. lower-/.f6483.4

            \[\leadsto \mathsf{fma}\left(\color{blue}{\frac{z}{t}}, y, x\right) \]
        7. Applied rewrites83.4%

          \[\leadsto \mathsf{fma}\left(\color{blue}{\frac{z}{t}}, y, x\right) \]

        if -7.2000000000000001e-75 < t < 2.94999999999999994e23

        1. Initial program 98.0%

          \[x + \frac{y \cdot \left(z - x\right)}{t} \]
        2. Add Preprocessing
        3. Taylor expanded in t around 0

          \[\leadsto \color{blue}{\frac{y \cdot \left(z - x\right)}{t}} \]
        4. Step-by-step derivation
          1. lower-/.f64N/A

            \[\leadsto \color{blue}{\frac{y \cdot \left(z - x\right)}{t}} \]
          2. *-commutativeN/A

            \[\leadsto \frac{\color{blue}{\left(z - x\right) \cdot y}}{t} \]
          3. lower-*.f64N/A

            \[\leadsto \frac{\color{blue}{\left(z - x\right) \cdot y}}{t} \]
          4. lower--.f6486.4

            \[\leadsto \frac{\color{blue}{\left(z - x\right)} \cdot y}{t} \]
        5. Applied rewrites86.4%

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

        if 2.94999999999999994e23 < t < 3.1999999999999999e100

        1. Initial program 91.9%

          \[x + \frac{y \cdot \left(z - x\right)}{t} \]
        2. Add Preprocessing
        3. Taylor expanded in z around 0

          \[\leadsto \color{blue}{x + -1 \cdot \frac{x \cdot y}{t}} \]
        4. Step-by-step derivation
          1. mul-1-negN/A

            \[\leadsto x + \color{blue}{\left(\mathsf{neg}\left(\frac{x \cdot y}{t}\right)\right)} \]
          2. unsub-negN/A

            \[\leadsto \color{blue}{x - \frac{x \cdot y}{t}} \]
          3. lower--.f64N/A

            \[\leadsto \color{blue}{x - \frac{x \cdot y}{t}} \]
          4. lower-/.f64N/A

            \[\leadsto x - \color{blue}{\frac{x \cdot y}{t}} \]
          5. lower-*.f6483.4

            \[\leadsto x - \frac{\color{blue}{x \cdot y}}{t} \]
        5. Applied rewrites83.4%

          \[\leadsto \color{blue}{x - \frac{x \cdot y}{t}} \]
      3. Recombined 3 regimes into one program.
      4. Add Preprocessing

      Alternative 5: 84.0% accurate, 0.7× speedup?

      \[\begin{array}{l} \\ \begin{array}{l} t_1 := \left(z - x\right) \cdot \frac{y}{t}\\ \mathbf{if}\;y \leq -3.1 \cdot 10^{+72}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;y \leq 5.9 \cdot 10^{+110}:\\ \;\;\;\;\frac{z \cdot y}{t} + x\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
      (FPCore (x y z t)
       :precision binary64
       (let* ((t_1 (* (- z x) (/ y t))))
         (if (<= y -3.1e+72) t_1 (if (<= y 5.9e+110) (+ (/ (* z y) t) x) t_1))))
      double code(double x, double y, double z, double t) {
      	double t_1 = (z - x) * (y / t);
      	double tmp;
      	if (y <= -3.1e+72) {
      		tmp = t_1;
      	} else if (y <= 5.9e+110) {
      		tmp = ((z * y) / t) + x;
      	} else {
      		tmp = t_1;
      	}
      	return tmp;
      }
      
      real(8) function code(x, y, z, t)
          real(8), intent (in) :: x
          real(8), intent (in) :: y
          real(8), intent (in) :: z
          real(8), intent (in) :: t
          real(8) :: t_1
          real(8) :: tmp
          t_1 = (z - x) * (y / t)
          if (y <= (-3.1d+72)) then
              tmp = t_1
          else if (y <= 5.9d+110) then
              tmp = ((z * y) / t) + x
          else
              tmp = t_1
          end if
          code = tmp
      end function
      
      public static double code(double x, double y, double z, double t) {
      	double t_1 = (z - x) * (y / t);
      	double tmp;
      	if (y <= -3.1e+72) {
      		tmp = t_1;
      	} else if (y <= 5.9e+110) {
      		tmp = ((z * y) / t) + x;
      	} else {
      		tmp = t_1;
      	}
      	return tmp;
      }
      
      def code(x, y, z, t):
      	t_1 = (z - x) * (y / t)
      	tmp = 0
      	if y <= -3.1e+72:
      		tmp = t_1
      	elif y <= 5.9e+110:
      		tmp = ((z * y) / t) + x
      	else:
      		tmp = t_1
      	return tmp
      
      function code(x, y, z, t)
      	t_1 = Float64(Float64(z - x) * Float64(y / t))
      	tmp = 0.0
      	if (y <= -3.1e+72)
      		tmp = t_1;
      	elseif (y <= 5.9e+110)
      		tmp = Float64(Float64(Float64(z * y) / t) + x);
      	else
      		tmp = t_1;
      	end
      	return tmp
      end
      
      function tmp_2 = code(x, y, z, t)
      	t_1 = (z - x) * (y / t);
      	tmp = 0.0;
      	if (y <= -3.1e+72)
      		tmp = t_1;
      	elseif (y <= 5.9e+110)
      		tmp = ((z * y) / t) + x;
      	else
      		tmp = t_1;
      	end
      	tmp_2 = tmp;
      end
      
      code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(z - x), $MachinePrecision] * N[(y / t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -3.1e+72], t$95$1, If[LessEqual[y, 5.9e+110], N[(N[(N[(z * y), $MachinePrecision] / t), $MachinePrecision] + x), $MachinePrecision], t$95$1]]]
      
      \begin{array}{l}
      
      \\
      \begin{array}{l}
      t_1 := \left(z - x\right) \cdot \frac{y}{t}\\
      \mathbf{if}\;y \leq -3.1 \cdot 10^{+72}:\\
      \;\;\;\;t\_1\\
      
      \mathbf{elif}\;y \leq 5.9 \cdot 10^{+110}:\\
      \;\;\;\;\frac{z \cdot y}{t} + x\\
      
      \mathbf{else}:\\
      \;\;\;\;t\_1\\
      
      
      \end{array}
      \end{array}
      
      Derivation
      1. Split input into 2 regimes
      2. if y < -3.09999999999999988e72 or 5.8999999999999997e110 < y

        1. Initial program 80.6%

          \[x + \frac{y \cdot \left(z - x\right)}{t} \]
        2. Add Preprocessing
        3. Taylor expanded in t around 0

          \[\leadsto \color{blue}{\frac{y \cdot \left(z - x\right)}{t}} \]
        4. Step-by-step derivation
          1. lower-/.f64N/A

            \[\leadsto \color{blue}{\frac{y \cdot \left(z - x\right)}{t}} \]
          2. *-commutativeN/A

            \[\leadsto \frac{\color{blue}{\left(z - x\right) \cdot y}}{t} \]
          3. lower-*.f64N/A

            \[\leadsto \frac{\color{blue}{\left(z - x\right) \cdot y}}{t} \]
          4. lower--.f6475.7

            \[\leadsto \frac{\color{blue}{\left(z - x\right)} \cdot y}{t} \]
        5. Applied rewrites75.7%

          \[\leadsto \color{blue}{\frac{\left(z - x\right) \cdot y}{t}} \]
        6. Step-by-step derivation
          1. Applied rewrites84.3%

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

          if -3.09999999999999988e72 < y < 5.8999999999999997e110

          1. Initial program 96.9%

            \[x + \frac{y \cdot \left(z - x\right)}{t} \]
          2. Add Preprocessing
          3. Taylor expanded in z around inf

            \[\leadsto x + \frac{\color{blue}{y \cdot z}}{t} \]
          4. Step-by-step derivation
            1. *-commutativeN/A

              \[\leadsto x + \frac{\color{blue}{z \cdot y}}{t} \]
            2. lower-*.f6483.7

              \[\leadsto x + \frac{\color{blue}{z \cdot y}}{t} \]
          5. Applied rewrites83.7%

            \[\leadsto x + \frac{\color{blue}{z \cdot y}}{t} \]
        7. Recombined 2 regimes into one program.
        8. Final simplification83.9%

          \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -3.1 \cdot 10^{+72}:\\ \;\;\;\;\left(z - x\right) \cdot \frac{y}{t}\\ \mathbf{elif}\;y \leq 5.9 \cdot 10^{+110}:\\ \;\;\;\;\frac{z \cdot y}{t} + x\\ \mathbf{else}:\\ \;\;\;\;\left(z - x\right) \cdot \frac{y}{t}\\ \end{array} \]
        9. Add Preprocessing

        Alternative 6: 83.8% accurate, 0.7× speedup?

        \[\begin{array}{l} \\ \begin{array}{l} t_1 := \mathsf{fma}\left(\frac{z}{t}, y, x\right)\\ \mathbf{if}\;t \leq -7.2 \cdot 10^{-75}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;t \leq 6.5 \cdot 10^{-20}:\\ \;\;\;\;\left(z - x\right) \cdot \frac{y}{t}\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
        (FPCore (x y z t)
         :precision binary64
         (let* ((t_1 (fma (/ z t) y x)))
           (if (<= t -7.2e-75) t_1 (if (<= t 6.5e-20) (* (- z x) (/ y t)) t_1))))
        double code(double x, double y, double z, double t) {
        	double t_1 = fma((z / t), y, x);
        	double tmp;
        	if (t <= -7.2e-75) {
        		tmp = t_1;
        	} else if (t <= 6.5e-20) {
        		tmp = (z - x) * (y / t);
        	} else {
        		tmp = t_1;
        	}
        	return tmp;
        }
        
        function code(x, y, z, t)
        	t_1 = fma(Float64(z / t), y, x)
        	tmp = 0.0
        	if (t <= -7.2e-75)
        		tmp = t_1;
        	elseif (t <= 6.5e-20)
        		tmp = Float64(Float64(z - x) * Float64(y / t));
        	else
        		tmp = t_1;
        	end
        	return tmp
        end
        
        code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(z / t), $MachinePrecision] * y + x), $MachinePrecision]}, If[LessEqual[t, -7.2e-75], t$95$1, If[LessEqual[t, 6.5e-20], N[(N[(z - x), $MachinePrecision] * N[(y / t), $MachinePrecision]), $MachinePrecision], t$95$1]]]
        
        \begin{array}{l}
        
        \\
        \begin{array}{l}
        t_1 := \mathsf{fma}\left(\frac{z}{t}, y, x\right)\\
        \mathbf{if}\;t \leq -7.2 \cdot 10^{-75}:\\
        \;\;\;\;t\_1\\
        
        \mathbf{elif}\;t \leq 6.5 \cdot 10^{-20}:\\
        \;\;\;\;\left(z - x\right) \cdot \frac{y}{t}\\
        
        \mathbf{else}:\\
        \;\;\;\;t\_1\\
        
        
        \end{array}
        \end{array}
        
        Derivation
        1. Split input into 2 regimes
        2. if t < -7.2000000000000001e-75 or 6.50000000000000032e-20 < t

          1. Initial program 86.4%

            \[x + \frac{y \cdot \left(z - x\right)}{t} \]
          2. Add Preprocessing
          3. Step-by-step derivation
            1. lift-+.f64N/A

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

              \[\leadsto \color{blue}{\frac{y \cdot \left(z - x\right)}{t} + x} \]
            3. lift-/.f64N/A

              \[\leadsto \color{blue}{\frac{y \cdot \left(z - x\right)}{t}} + x \]
            4. lift-*.f64N/A

              \[\leadsto \frac{\color{blue}{y \cdot \left(z - x\right)}}{t} + x \]
            5. associate-/l*N/A

              \[\leadsto \color{blue}{y \cdot \frac{z - x}{t}} + x \]
            6. *-commutativeN/A

              \[\leadsto \color{blue}{\frac{z - x}{t} \cdot y} + x \]
            7. lower-fma.f64N/A

              \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{z - x}{t}, y, x\right)} \]
            8. lower-/.f6497.1

              \[\leadsto \mathsf{fma}\left(\color{blue}{\frac{z - x}{t}}, y, x\right) \]
          4. Applied rewrites97.1%

            \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{z - x}{t}, y, x\right)} \]
          5. Taylor expanded in z around inf

            \[\leadsto \mathsf{fma}\left(\color{blue}{\frac{z}{t}}, y, x\right) \]
          6. Step-by-step derivation
            1. lower-/.f6479.8

              \[\leadsto \mathsf{fma}\left(\color{blue}{\frac{z}{t}}, y, x\right) \]
          7. Applied rewrites79.8%

            \[\leadsto \mathsf{fma}\left(\color{blue}{\frac{z}{t}}, y, x\right) \]

          if -7.2000000000000001e-75 < t < 6.50000000000000032e-20

          1. Initial program 97.8%

            \[x + \frac{y \cdot \left(z - x\right)}{t} \]
          2. Add Preprocessing
          3. Taylor expanded in t around 0

            \[\leadsto \color{blue}{\frac{y \cdot \left(z - x\right)}{t}} \]
          4. Step-by-step derivation
            1. lower-/.f64N/A

              \[\leadsto \color{blue}{\frac{y \cdot \left(z - x\right)}{t}} \]
            2. *-commutativeN/A

              \[\leadsto \frac{\color{blue}{\left(z - x\right) \cdot y}}{t} \]
            3. lower-*.f64N/A

              \[\leadsto \frac{\color{blue}{\left(z - x\right) \cdot y}}{t} \]
            4. lower--.f6488.2

              \[\leadsto \frac{\color{blue}{\left(z - x\right)} \cdot y}{t} \]
          5. Applied rewrites88.2%

            \[\leadsto \color{blue}{\frac{\left(z - x\right) \cdot y}{t}} \]
          6. Step-by-step derivation
            1. Applied rewrites85.3%

              \[\leadsto \frac{y}{t} \cdot \color{blue}{\left(z - x\right)} \]
          7. Recombined 2 regimes into one program.
          8. Final simplification81.8%

            \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -7.2 \cdot 10^{-75}:\\ \;\;\;\;\mathsf{fma}\left(\frac{z}{t}, y, x\right)\\ \mathbf{elif}\;t \leq 6.5 \cdot 10^{-20}:\\ \;\;\;\;\left(z - x\right) \cdot \frac{y}{t}\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(\frac{z}{t}, y, x\right)\\ \end{array} \]
          9. Add Preprocessing

          Alternative 7: 73.6% accurate, 0.8× speedup?

          \[\begin{array}{l} \\ \begin{array}{l} t_1 := \mathsf{fma}\left(\frac{z}{t}, y, x\right)\\ \mathbf{if}\;t \leq -3.6 \cdot 10^{-147}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;t \leq 1.3 \cdot 10^{-117}:\\ \;\;\;\;z \cdot \frac{y}{t}\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
          (FPCore (x y z t)
           :precision binary64
           (let* ((t_1 (fma (/ z t) y x)))
             (if (<= t -3.6e-147) t_1 (if (<= t 1.3e-117) (* z (/ y t)) t_1))))
          double code(double x, double y, double z, double t) {
          	double t_1 = fma((z / t), y, x);
          	double tmp;
          	if (t <= -3.6e-147) {
          		tmp = t_1;
          	} else if (t <= 1.3e-117) {
          		tmp = z * (y / t);
          	} else {
          		tmp = t_1;
          	}
          	return tmp;
          }
          
          function code(x, y, z, t)
          	t_1 = fma(Float64(z / t), y, x)
          	tmp = 0.0
          	if (t <= -3.6e-147)
          		tmp = t_1;
          	elseif (t <= 1.3e-117)
          		tmp = Float64(z * Float64(y / t));
          	else
          		tmp = t_1;
          	end
          	return tmp
          end
          
          code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(z / t), $MachinePrecision] * y + x), $MachinePrecision]}, If[LessEqual[t, -3.6e-147], t$95$1, If[LessEqual[t, 1.3e-117], N[(z * N[(y / t), $MachinePrecision]), $MachinePrecision], t$95$1]]]
          
          \begin{array}{l}
          
          \\
          \begin{array}{l}
          t_1 := \mathsf{fma}\left(\frac{z}{t}, y, x\right)\\
          \mathbf{if}\;t \leq -3.6 \cdot 10^{-147}:\\
          \;\;\;\;t\_1\\
          
          \mathbf{elif}\;t \leq 1.3 \cdot 10^{-117}:\\
          \;\;\;\;z \cdot \frac{y}{t}\\
          
          \mathbf{else}:\\
          \;\;\;\;t\_1\\
          
          
          \end{array}
          \end{array}
          
          Derivation
          1. Split input into 2 regimes
          2. if t < -3.60000000000000012e-147 or 1.29999999999999992e-117 < t

            1. Initial program 88.5%

              \[x + \frac{y \cdot \left(z - x\right)}{t} \]
            2. Add Preprocessing
            3. Step-by-step derivation
              1. lift-+.f64N/A

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

                \[\leadsto \color{blue}{\frac{y \cdot \left(z - x\right)}{t} + x} \]
              3. lift-/.f64N/A

                \[\leadsto \color{blue}{\frac{y \cdot \left(z - x\right)}{t}} + x \]
              4. lift-*.f64N/A

                \[\leadsto \frac{\color{blue}{y \cdot \left(z - x\right)}}{t} + x \]
              5. associate-/l*N/A

                \[\leadsto \color{blue}{y \cdot \frac{z - x}{t}} + x \]
              6. *-commutativeN/A

                \[\leadsto \color{blue}{\frac{z - x}{t} \cdot y} + x \]
              7. lower-fma.f64N/A

                \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{z - x}{t}, y, x\right)} \]
              8. lower-/.f6496.0

                \[\leadsto \mathsf{fma}\left(\color{blue}{\frac{z - x}{t}}, y, x\right) \]
            4. Applied rewrites96.0%

              \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{z - x}{t}, y, x\right)} \]
            5. Taylor expanded in z around inf

              \[\leadsto \mathsf{fma}\left(\color{blue}{\frac{z}{t}}, y, x\right) \]
            6. Step-by-step derivation
              1. lower-/.f6475.9

                \[\leadsto \mathsf{fma}\left(\color{blue}{\frac{z}{t}}, y, x\right) \]
            7. Applied rewrites75.9%

              \[\leadsto \mathsf{fma}\left(\color{blue}{\frac{z}{t}}, y, x\right) \]

            if -3.60000000000000012e-147 < t < 1.29999999999999992e-117

            1. Initial program 96.9%

              \[x + \frac{y \cdot \left(z - x\right)}{t} \]
            2. Add Preprocessing
            3. Step-by-step derivation
              1. lift-+.f64N/A

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

                \[\leadsto \color{blue}{\frac{y \cdot \left(z - x\right)}{t} + x} \]
              3. lift-/.f64N/A

                \[\leadsto \color{blue}{\frac{y \cdot \left(z - x\right)}{t}} + x \]
              4. lift-*.f64N/A

                \[\leadsto \frac{\color{blue}{y \cdot \left(z - x\right)}}{t} + x \]
              5. associate-/l*N/A

                \[\leadsto \color{blue}{y \cdot \frac{z - x}{t}} + x \]
              6. *-commutativeN/A

                \[\leadsto \color{blue}{\frac{z - x}{t} \cdot y} + x \]
              7. lower-fma.f64N/A

                \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{z - x}{t}, y, x\right)} \]
              8. lower-/.f6474.6

                \[\leadsto \mathsf{fma}\left(\color{blue}{\frac{z - x}{t}}, y, x\right) \]
            4. Applied rewrites74.6%

              \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{z - x}{t}, y, x\right)} \]
            5. Taylor expanded in z around inf

              \[\leadsto \color{blue}{\frac{y \cdot z}{t}} \]
            6. Step-by-step derivation
              1. associate-*l/N/A

                \[\leadsto \color{blue}{\frac{y}{t} \cdot z} \]
              2. lower-*.f64N/A

                \[\leadsto \color{blue}{\frac{y}{t} \cdot z} \]
              3. lower-/.f6460.0

                \[\leadsto \color{blue}{\frac{y}{t}} \cdot z \]
            7. Applied rewrites60.0%

              \[\leadsto \color{blue}{\frac{y}{t} \cdot z} \]
          3. Recombined 2 regimes into one program.
          4. Final simplification71.8%

            \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -3.6 \cdot 10^{-147}:\\ \;\;\;\;\mathsf{fma}\left(\frac{z}{t}, y, x\right)\\ \mathbf{elif}\;t \leq 1.3 \cdot 10^{-117}:\\ \;\;\;\;z \cdot \frac{y}{t}\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(\frac{z}{t}, y, x\right)\\ \end{array} \]
          5. Add Preprocessing

          Alternative 8: 72.2% accurate, 0.9× speedup?

          \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;y \leq -6.8 \cdot 10^{+252}:\\ \;\;\;\;\frac{-x}{t} \cdot y\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(\frac{z}{t}, y, x\right)\\ \end{array} \end{array} \]
          (FPCore (x y z t)
           :precision binary64
           (if (<= y -6.8e+252) (* (/ (- x) t) y) (fma (/ z t) y x)))
          double code(double x, double y, double z, double t) {
          	double tmp;
          	if (y <= -6.8e+252) {
          		tmp = (-x / t) * y;
          	} else {
          		tmp = fma((z / t), y, x);
          	}
          	return tmp;
          }
          
          function code(x, y, z, t)
          	tmp = 0.0
          	if (y <= -6.8e+252)
          		tmp = Float64(Float64(Float64(-x) / t) * y);
          	else
          		tmp = fma(Float64(z / t), y, x);
          	end
          	return tmp
          end
          
          code[x_, y_, z_, t_] := If[LessEqual[y, -6.8e+252], N[(N[((-x) / t), $MachinePrecision] * y), $MachinePrecision], N[(N[(z / t), $MachinePrecision] * y + x), $MachinePrecision]]
          
          \begin{array}{l}
          
          \\
          \begin{array}{l}
          \mathbf{if}\;y \leq -6.8 \cdot 10^{+252}:\\
          \;\;\;\;\frac{-x}{t} \cdot y\\
          
          \mathbf{else}:\\
          \;\;\;\;\mathsf{fma}\left(\frac{z}{t}, y, x\right)\\
          
          
          \end{array}
          \end{array}
          
          Derivation
          1. Split input into 2 regimes
          2. if y < -6.8e252

            1. Initial program 69.0%

              \[x + \frac{y \cdot \left(z - x\right)}{t} \]
            2. Add Preprocessing
            3. Taylor expanded in t around 0

              \[\leadsto \color{blue}{\frac{y \cdot \left(z - x\right)}{t}} \]
            4. Step-by-step derivation
              1. lower-/.f64N/A

                \[\leadsto \color{blue}{\frac{y \cdot \left(z - x\right)}{t}} \]
              2. *-commutativeN/A

                \[\leadsto \frac{\color{blue}{\left(z - x\right) \cdot y}}{t} \]
              3. lower-*.f64N/A

                \[\leadsto \frac{\color{blue}{\left(z - x\right) \cdot y}}{t} \]
              4. lower--.f6468.9

                \[\leadsto \frac{\color{blue}{\left(z - x\right)} \cdot y}{t} \]
            5. Applied rewrites68.9%

              \[\leadsto \color{blue}{\frac{\left(z - x\right) \cdot y}{t}} \]
            6. Taylor expanded in z around 0

              \[\leadsto -1 \cdot \color{blue}{\frac{x \cdot y}{t}} \]
            7. Step-by-step derivation
              1. Applied rewrites83.2%

                \[\leadsto \frac{-x}{t} \cdot \color{blue}{y} \]

              if -6.8e252 < y

              1. Initial program 92.0%

                \[x + \frac{y \cdot \left(z - x\right)}{t} \]
              2. Add Preprocessing
              3. Step-by-step derivation
                1. lift-+.f64N/A

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

                  \[\leadsto \color{blue}{\frac{y \cdot \left(z - x\right)}{t} + x} \]
                3. lift-/.f64N/A

                  \[\leadsto \color{blue}{\frac{y \cdot \left(z - x\right)}{t}} + x \]
                4. lift-*.f64N/A

                  \[\leadsto \frac{\color{blue}{y \cdot \left(z - x\right)}}{t} + x \]
                5. associate-/l*N/A

                  \[\leadsto \color{blue}{y \cdot \frac{z - x}{t}} + x \]
                6. *-commutativeN/A

                  \[\leadsto \color{blue}{\frac{z - x}{t} \cdot y} + x \]
                7. lower-fma.f64N/A

                  \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{z - x}{t}, y, x\right)} \]
                8. lower-/.f6490.1

                  \[\leadsto \mathsf{fma}\left(\color{blue}{\frac{z - x}{t}}, y, x\right) \]
              4. Applied rewrites90.1%

                \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{z - x}{t}, y, x\right)} \]
              5. Taylor expanded in z around inf

                \[\leadsto \mathsf{fma}\left(\color{blue}{\frac{z}{t}}, y, x\right) \]
              6. Step-by-step derivation
                1. lower-/.f6470.3

                  \[\leadsto \mathsf{fma}\left(\color{blue}{\frac{z}{t}}, y, x\right) \]
              7. Applied rewrites70.3%

                \[\leadsto \mathsf{fma}\left(\color{blue}{\frac{z}{t}}, y, x\right) \]
            8. Recombined 2 regimes into one program.
            9. Add Preprocessing

            Alternative 9: 37.6% accurate, 1.0× speedup?

            \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x \leq -7.8 \cdot 10^{-23}:\\ \;\;\;\;\frac{z}{t} \cdot y\\ \mathbf{else}:\\ \;\;\;\;\frac{z \cdot y}{t}\\ \end{array} \end{array} \]
            (FPCore (x y z t)
             :precision binary64
             (if (<= x -7.8e-23) (* (/ z t) y) (/ (* z y) t)))
            double code(double x, double y, double z, double t) {
            	double tmp;
            	if (x <= -7.8e-23) {
            		tmp = (z / t) * y;
            	} else {
            		tmp = (z * y) / t;
            	}
            	return tmp;
            }
            
            real(8) function code(x, y, z, t)
                real(8), intent (in) :: x
                real(8), intent (in) :: y
                real(8), intent (in) :: z
                real(8), intent (in) :: t
                real(8) :: tmp
                if (x <= (-7.8d-23)) then
                    tmp = (z / t) * y
                else
                    tmp = (z * y) / t
                end if
                code = tmp
            end function
            
            public static double code(double x, double y, double z, double t) {
            	double tmp;
            	if (x <= -7.8e-23) {
            		tmp = (z / t) * y;
            	} else {
            		tmp = (z * y) / t;
            	}
            	return tmp;
            }
            
            def code(x, y, z, t):
            	tmp = 0
            	if x <= -7.8e-23:
            		tmp = (z / t) * y
            	else:
            		tmp = (z * y) / t
            	return tmp
            
            function code(x, y, z, t)
            	tmp = 0.0
            	if (x <= -7.8e-23)
            		tmp = Float64(Float64(z / t) * y);
            	else
            		tmp = Float64(Float64(z * y) / t);
            	end
            	return tmp
            end
            
            function tmp_2 = code(x, y, z, t)
            	tmp = 0.0;
            	if (x <= -7.8e-23)
            		tmp = (z / t) * y;
            	else
            		tmp = (z * y) / t;
            	end
            	tmp_2 = tmp;
            end
            
            code[x_, y_, z_, t_] := If[LessEqual[x, -7.8e-23], N[(N[(z / t), $MachinePrecision] * y), $MachinePrecision], N[(N[(z * y), $MachinePrecision] / t), $MachinePrecision]]
            
            \begin{array}{l}
            
            \\
            \begin{array}{l}
            \mathbf{if}\;x \leq -7.8 \cdot 10^{-23}:\\
            \;\;\;\;\frac{z}{t} \cdot y\\
            
            \mathbf{else}:\\
            \;\;\;\;\frac{z \cdot y}{t}\\
            
            
            \end{array}
            \end{array}
            
            Derivation
            1. Split input into 2 regimes
            2. if x < -7.8e-23

              1. Initial program 83.9%

                \[x + \frac{y \cdot \left(z - x\right)}{t} \]
              2. Add Preprocessing
              3. Taylor expanded in z around inf

                \[\leadsto \color{blue}{\frac{y \cdot z}{t}} \]
              4. Step-by-step derivation
                1. lower-/.f64N/A

                  \[\leadsto \color{blue}{\frac{y \cdot z}{t}} \]
                2. *-commutativeN/A

                  \[\leadsto \frac{\color{blue}{z \cdot y}}{t} \]
                3. lower-*.f6412.6

                  \[\leadsto \frac{\color{blue}{z \cdot y}}{t} \]
              5. Applied rewrites12.6%

                \[\leadsto \color{blue}{\frac{z \cdot y}{t}} \]
              6. Step-by-step derivation
                1. Applied rewrites20.5%

                  \[\leadsto y \cdot \color{blue}{\frac{z}{t}} \]

                if -7.8e-23 < x

                1. Initial program 93.2%

                  \[x + \frac{y \cdot \left(z - x\right)}{t} \]
                2. Add Preprocessing
                3. Taylor expanded in z around inf

                  \[\leadsto \color{blue}{\frac{y \cdot z}{t}} \]
                4. Step-by-step derivation
                  1. lower-/.f64N/A

                    \[\leadsto \color{blue}{\frac{y \cdot z}{t}} \]
                  2. *-commutativeN/A

                    \[\leadsto \frac{\color{blue}{z \cdot y}}{t} \]
                  3. lower-*.f6443.3

                    \[\leadsto \frac{\color{blue}{z \cdot y}}{t} \]
                5. Applied rewrites43.3%

                  \[\leadsto \color{blue}{\frac{z \cdot y}{t}} \]
              7. Recombined 2 regimes into one program.
              8. Final simplification37.0%

                \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -7.8 \cdot 10^{-23}:\\ \;\;\;\;\frac{z}{t} \cdot y\\ \mathbf{else}:\\ \;\;\;\;\frac{z \cdot y}{t}\\ \end{array} \]
              9. Add Preprocessing

              Alternative 10: 40.7% accurate, 1.4× speedup?

              \[\begin{array}{l} \\ z \cdot \frac{y}{t} \end{array} \]
              (FPCore (x y z t) :precision binary64 (* z (/ y t)))
              double code(double x, double y, double z, double t) {
              	return z * (y / t);
              }
              
              real(8) function code(x, y, z, t)
                  real(8), intent (in) :: x
                  real(8), intent (in) :: y
                  real(8), intent (in) :: z
                  real(8), intent (in) :: t
                  code = z * (y / t)
              end function
              
              public static double code(double x, double y, double z, double t) {
              	return z * (y / t);
              }
              
              def code(x, y, z, t):
              	return z * (y / t)
              
              function code(x, y, z, t)
              	return Float64(z * Float64(y / t))
              end
              
              function tmp = code(x, y, z, t)
              	tmp = z * (y / t);
              end
              
              code[x_, y_, z_, t_] := N[(z * N[(y / t), $MachinePrecision]), $MachinePrecision]
              
              \begin{array}{l}
              
              \\
              z \cdot \frac{y}{t}
              \end{array}
              
              Derivation
              1. Initial program 90.7%

                \[x + \frac{y \cdot \left(z - x\right)}{t} \]
              2. Add Preprocessing
              3. Step-by-step derivation
                1. lift-+.f64N/A

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

                  \[\leadsto \color{blue}{\frac{y \cdot \left(z - x\right)}{t} + x} \]
                3. lift-/.f64N/A

                  \[\leadsto \color{blue}{\frac{y \cdot \left(z - x\right)}{t}} + x \]
                4. lift-*.f64N/A

                  \[\leadsto \frac{\color{blue}{y \cdot \left(z - x\right)}}{t} + x \]
                5. associate-/l*N/A

                  \[\leadsto \color{blue}{y \cdot \frac{z - x}{t}} + x \]
                6. *-commutativeN/A

                  \[\leadsto \color{blue}{\frac{z - x}{t} \cdot y} + x \]
                7. lower-fma.f64N/A

                  \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{z - x}{t}, y, x\right)} \]
                8. lower-/.f6490.5

                  \[\leadsto \mathsf{fma}\left(\color{blue}{\frac{z - x}{t}}, y, x\right) \]
              4. Applied rewrites90.5%

                \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{z - x}{t}, y, x\right)} \]
              5. Taylor expanded in z around inf

                \[\leadsto \color{blue}{\frac{y \cdot z}{t}} \]
              6. Step-by-step derivation
                1. associate-*l/N/A

                  \[\leadsto \color{blue}{\frac{y}{t} \cdot z} \]
                2. lower-*.f64N/A

                  \[\leadsto \color{blue}{\frac{y}{t} \cdot z} \]
                3. lower-/.f6438.4

                  \[\leadsto \color{blue}{\frac{y}{t}} \cdot z \]
              7. Applied rewrites38.4%

                \[\leadsto \color{blue}{\frac{y}{t} \cdot z} \]
              8. Final simplification38.4%

                \[\leadsto z \cdot \frac{y}{t} \]
              9. Add Preprocessing

              Alternative 11: 37.5% accurate, 1.4× speedup?

              \[\begin{array}{l} \\ \frac{z}{t} \cdot y \end{array} \]
              (FPCore (x y z t) :precision binary64 (* (/ z t) y))
              double code(double x, double y, double z, double t) {
              	return (z / t) * y;
              }
              
              real(8) function code(x, y, z, t)
                  real(8), intent (in) :: x
                  real(8), intent (in) :: y
                  real(8), intent (in) :: z
                  real(8), intent (in) :: t
                  code = (z / t) * y
              end function
              
              public static double code(double x, double y, double z, double t) {
              	return (z / t) * y;
              }
              
              def code(x, y, z, t):
              	return (z / t) * y
              
              function code(x, y, z, t)
              	return Float64(Float64(z / t) * y)
              end
              
              function tmp = code(x, y, z, t)
              	tmp = (z / t) * y;
              end
              
              code[x_, y_, z_, t_] := N[(N[(z / t), $MachinePrecision] * y), $MachinePrecision]
              
              \begin{array}{l}
              
              \\
              \frac{z}{t} \cdot y
              \end{array}
              
              Derivation
              1. Initial program 90.7%

                \[x + \frac{y \cdot \left(z - x\right)}{t} \]
              2. Add Preprocessing
              3. Taylor expanded in z around inf

                \[\leadsto \color{blue}{\frac{y \cdot z}{t}} \]
              4. Step-by-step derivation
                1. lower-/.f64N/A

                  \[\leadsto \color{blue}{\frac{y \cdot z}{t}} \]
                2. *-commutativeN/A

                  \[\leadsto \frac{\color{blue}{z \cdot y}}{t} \]
                3. lower-*.f6434.8

                  \[\leadsto \frac{\color{blue}{z \cdot y}}{t} \]
              5. Applied rewrites34.8%

                \[\leadsto \color{blue}{\frac{z \cdot y}{t}} \]
              6. Step-by-step derivation
                1. Applied rewrites32.9%

                  \[\leadsto y \cdot \color{blue}{\frac{z}{t}} \]
                2. Final simplification32.9%

                  \[\leadsto \frac{z}{t} \cdot y \]
                3. Add Preprocessing

                Developer Target 1: 90.4% accurate, 0.6× speedup?

                \[\begin{array}{l} \\ x - \left(x \cdot \frac{y}{t} + \left(-z\right) \cdot \frac{y}{t}\right) \end{array} \]
                (FPCore (x y z t)
                 :precision binary64
                 (- x (+ (* x (/ y t)) (* (- z) (/ y t)))))
                double code(double x, double y, double z, double t) {
                	return x - ((x * (y / t)) + (-z * (y / t)));
                }
                
                real(8) function code(x, y, z, t)
                    real(8), intent (in) :: x
                    real(8), intent (in) :: y
                    real(8), intent (in) :: z
                    real(8), intent (in) :: t
                    code = x - ((x * (y / t)) + (-z * (y / t)))
                end function
                
                public static double code(double x, double y, double z, double t) {
                	return x - ((x * (y / t)) + (-z * (y / t)));
                }
                
                def code(x, y, z, t):
                	return x - ((x * (y / t)) + (-z * (y / t)))
                
                function code(x, y, z, t)
                	return Float64(x - Float64(Float64(x * Float64(y / t)) + Float64(Float64(-z) * Float64(y / t))))
                end
                
                function tmp = code(x, y, z, t)
                	tmp = x - ((x * (y / t)) + (-z * (y / t)));
                end
                
                code[x_, y_, z_, t_] := N[(x - N[(N[(x * N[(y / t), $MachinePrecision]), $MachinePrecision] + N[((-z) * N[(y / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
                
                \begin{array}{l}
                
                \\
                x - \left(x \cdot \frac{y}{t} + \left(-z\right) \cdot \frac{y}{t}\right)
                \end{array}
                

                Reproduce

                ?
                herbie shell --seed 2024268 
                (FPCore (x y z t)
                  :name "Optimisation.CirclePacking:place from circle-packing-0.1.0.4, D"
                  :precision binary64
                
                  :alt
                  (! :herbie-platform default (- x (+ (* x (/ y t)) (* (- z) (/ y t)))))
                
                  (+ x (/ (* y (- z x)) t)))