Rosa's DopplerBench

Percentage Accurate: 73.1% → 97.9%
Time: 7.0s
Alternatives: 9
Speedup: 0.8×

Specification

?
\[\begin{array}{l} \\ \frac{\left(-t1\right) \cdot v}{\left(t1 + u\right) \cdot \left(t1 + u\right)} \end{array} \]
(FPCore (u v t1) :precision binary64 (/ (* (- t1) v) (* (+ t1 u) (+ t1 u))))
double code(double u, double v, double t1) {
	return (-t1 * v) / ((t1 + u) * (t1 + u));
}
real(8) function code(u, v, t1)
    real(8), intent (in) :: u
    real(8), intent (in) :: v
    real(8), intent (in) :: t1
    code = (-t1 * v) / ((t1 + u) * (t1 + u))
end function
public static double code(double u, double v, double t1) {
	return (-t1 * v) / ((t1 + u) * (t1 + u));
}
def code(u, v, t1):
	return (-t1 * v) / ((t1 + u) * (t1 + u))
function code(u, v, t1)
	return Float64(Float64(Float64(-t1) * v) / Float64(Float64(t1 + u) * Float64(t1 + u)))
end
function tmp = code(u, v, t1)
	tmp = (-t1 * v) / ((t1 + u) * (t1 + u));
end
code[u_, v_, t1_] := N[(N[((-t1) * v), $MachinePrecision] / N[(N[(t1 + u), $MachinePrecision] * N[(t1 + u), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
\frac{\left(-t1\right) \cdot v}{\left(t1 + u\right) \cdot \left(t1 + u\right)}
\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 9 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: 73.1% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \frac{\left(-t1\right) \cdot v}{\left(t1 + u\right) \cdot \left(t1 + u\right)} \end{array} \]
(FPCore (u v t1) :precision binary64 (/ (* (- t1) v) (* (+ t1 u) (+ t1 u))))
double code(double u, double v, double t1) {
	return (-t1 * v) / ((t1 + u) * (t1 + u));
}
real(8) function code(u, v, t1)
    real(8), intent (in) :: u
    real(8), intent (in) :: v
    real(8), intent (in) :: t1
    code = (-t1 * v) / ((t1 + u) * (t1 + u))
end function
public static double code(double u, double v, double t1) {
	return (-t1 * v) / ((t1 + u) * (t1 + u));
}
def code(u, v, t1):
	return (-t1 * v) / ((t1 + u) * (t1 + u))
function code(u, v, t1)
	return Float64(Float64(Float64(-t1) * v) / Float64(Float64(t1 + u) * Float64(t1 + u)))
end
function tmp = code(u, v, t1)
	tmp = (-t1 * v) / ((t1 + u) * (t1 + u));
end
code[u_, v_, t1_] := N[(N[((-t1) * v), $MachinePrecision] / N[(N[(t1 + u), $MachinePrecision] * N[(t1 + u), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
\frac{\left(-t1\right) \cdot v}{\left(t1 + u\right) \cdot \left(t1 + u\right)}
\end{array}

Alternative 1: 97.9% accurate, 0.8× speedup?

\[\begin{array}{l} \\ \frac{v}{u + t1} \cdot \frac{t1}{\left(-u\right) - t1} \end{array} \]
(FPCore (u v t1) :precision binary64 (* (/ v (+ u t1)) (/ t1 (- (- u) t1))))
double code(double u, double v, double t1) {
	return (v / (u + t1)) * (t1 / (-u - t1));
}
real(8) function code(u, v, t1)
    real(8), intent (in) :: u
    real(8), intent (in) :: v
    real(8), intent (in) :: t1
    code = (v / (u + t1)) * (t1 / (-u - t1))
end function
public static double code(double u, double v, double t1) {
	return (v / (u + t1)) * (t1 / (-u - t1));
}
def code(u, v, t1):
	return (v / (u + t1)) * (t1 / (-u - t1))
function code(u, v, t1)
	return Float64(Float64(v / Float64(u + t1)) * Float64(t1 / Float64(Float64(-u) - t1)))
end
function tmp = code(u, v, t1)
	tmp = (v / (u + t1)) * (t1 / (-u - t1));
end
code[u_, v_, t1_] := N[(N[(v / N[(u + t1), $MachinePrecision]), $MachinePrecision] * N[(t1 / N[((-u) - t1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
\frac{v}{u + t1} \cdot \frac{t1}{\left(-u\right) - t1}
\end{array}
Derivation
  1. Initial program 69.9%

    \[\frac{\left(-t1\right) \cdot v}{\left(t1 + u\right) \cdot \left(t1 + u\right)} \]
  2. Add Preprocessing
  3. Step-by-step derivation
    1. lift-/.f64N/A

      \[\leadsto \color{blue}{\frac{\left(-t1\right) \cdot v}{\left(t1 + u\right) \cdot \left(t1 + u\right)}} \]
    2. lift-*.f64N/A

      \[\leadsto \frac{\color{blue}{\left(-t1\right) \cdot v}}{\left(t1 + u\right) \cdot \left(t1 + u\right)} \]
    3. *-commutativeN/A

      \[\leadsto \frac{\color{blue}{v \cdot \left(-t1\right)}}{\left(t1 + u\right) \cdot \left(t1 + u\right)} \]
    4. lift-neg.f64N/A

      \[\leadsto \frac{v \cdot \color{blue}{\left(\mathsf{neg}\left(t1\right)\right)}}{\left(t1 + u\right) \cdot \left(t1 + u\right)} \]
    5. neg-mul-1N/A

      \[\leadsto \frac{v \cdot \color{blue}{\left(-1 \cdot t1\right)}}{\left(t1 + u\right) \cdot \left(t1 + u\right)} \]
    6. associate-*r*N/A

      \[\leadsto \frac{\color{blue}{\left(v \cdot -1\right) \cdot t1}}{\left(t1 + u\right) \cdot \left(t1 + u\right)} \]
    7. lift-*.f64N/A

      \[\leadsto \frac{\left(v \cdot -1\right) \cdot t1}{\color{blue}{\left(t1 + u\right) \cdot \left(t1 + u\right)}} \]
    8. times-fracN/A

      \[\leadsto \color{blue}{\frac{v \cdot -1}{t1 + u} \cdot \frac{t1}{t1 + u}} \]
    9. *-commutativeN/A

      \[\leadsto \frac{\color{blue}{-1 \cdot v}}{t1 + u} \cdot \frac{t1}{t1 + u} \]
    10. neg-mul-1N/A

      \[\leadsto \frac{\color{blue}{\mathsf{neg}\left(v\right)}}{t1 + u} \cdot \frac{t1}{t1 + u} \]
    11. lower-*.f64N/A

      \[\leadsto \color{blue}{\frac{\mathsf{neg}\left(v\right)}{t1 + u} \cdot \frac{t1}{t1 + u}} \]
    12. lower-/.f64N/A

      \[\leadsto \color{blue}{\frac{\mathsf{neg}\left(v\right)}{t1 + u}} \cdot \frac{t1}{t1 + u} \]
    13. lower-neg.f64N/A

      \[\leadsto \frac{\color{blue}{-v}}{t1 + u} \cdot \frac{t1}{t1 + u} \]
    14. lift-+.f64N/A

      \[\leadsto \frac{-v}{\color{blue}{t1 + u}} \cdot \frac{t1}{t1 + u} \]
    15. +-commutativeN/A

      \[\leadsto \frac{-v}{\color{blue}{u + t1}} \cdot \frac{t1}{t1 + u} \]
    16. lower-+.f64N/A

      \[\leadsto \frac{-v}{\color{blue}{u + t1}} \cdot \frac{t1}{t1 + u} \]
    17. lower-/.f6499.4

      \[\leadsto \frac{-v}{u + t1} \cdot \color{blue}{\frac{t1}{t1 + u}} \]
    18. lift-+.f64N/A

      \[\leadsto \frac{-v}{u + t1} \cdot \frac{t1}{\color{blue}{t1 + u}} \]
    19. +-commutativeN/A

      \[\leadsto \frac{-v}{u + t1} \cdot \frac{t1}{\color{blue}{u + t1}} \]
    20. lower-+.f6499.4

      \[\leadsto \frac{-v}{u + t1} \cdot \frac{t1}{\color{blue}{u + t1}} \]
  4. Applied rewrites99.4%

    \[\leadsto \color{blue}{\frac{-v}{u + t1} \cdot \frac{t1}{u + t1}} \]
  5. Final simplification99.4%

    \[\leadsto \frac{v}{u + t1} \cdot \frac{t1}{\left(-u\right) - t1} \]
  6. Add Preprocessing

Alternative 2: 87.3% accurate, 0.6× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \frac{\left(-t1\right) \cdot v}{\left(t1 + u\right) \cdot \left(t1 + u\right)}\\ t_2 := \frac{-v}{\mathsf{fma}\left(2, u, t1\right)}\\ \mathbf{if}\;t1 \leq -1.9 \cdot 10^{+48}:\\ \;\;\;\;t\_2\\ \mathbf{elif}\;t1 \leq -5 \cdot 10^{-138}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;t1 \leq 5.2 \cdot 10^{-225}:\\ \;\;\;\;\frac{-t1}{u} \cdot \frac{v}{u}\\ \mathbf{elif}\;t1 \leq 4.4 \cdot 10^{+54}:\\ \;\;\;\;t\_1\\ \mathbf{else}:\\ \;\;\;\;t\_2\\ \end{array} \end{array} \]
(FPCore (u v t1)
 :precision binary64
 (let* ((t_1 (/ (* (- t1) v) (* (+ t1 u) (+ t1 u))))
        (t_2 (/ (- v) (fma 2.0 u t1))))
   (if (<= t1 -1.9e+48)
     t_2
     (if (<= t1 -5e-138)
       t_1
       (if (<= t1 5.2e-225)
         (* (/ (- t1) u) (/ v u))
         (if (<= t1 4.4e+54) t_1 t_2))))))
double code(double u, double v, double t1) {
	double t_1 = (-t1 * v) / ((t1 + u) * (t1 + u));
	double t_2 = -v / fma(2.0, u, t1);
	double tmp;
	if (t1 <= -1.9e+48) {
		tmp = t_2;
	} else if (t1 <= -5e-138) {
		tmp = t_1;
	} else if (t1 <= 5.2e-225) {
		tmp = (-t1 / u) * (v / u);
	} else if (t1 <= 4.4e+54) {
		tmp = t_1;
	} else {
		tmp = t_2;
	}
	return tmp;
}
function code(u, v, t1)
	t_1 = Float64(Float64(Float64(-t1) * v) / Float64(Float64(t1 + u) * Float64(t1 + u)))
	t_2 = Float64(Float64(-v) / fma(2.0, u, t1))
	tmp = 0.0
	if (t1 <= -1.9e+48)
		tmp = t_2;
	elseif (t1 <= -5e-138)
		tmp = t_1;
	elseif (t1 <= 5.2e-225)
		tmp = Float64(Float64(Float64(-t1) / u) * Float64(v / u));
	elseif (t1 <= 4.4e+54)
		tmp = t_1;
	else
		tmp = t_2;
	end
	return tmp
end
code[u_, v_, t1_] := Block[{t$95$1 = N[(N[((-t1) * v), $MachinePrecision] / N[(N[(t1 + u), $MachinePrecision] * N[(t1 + u), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[((-v) / N[(2.0 * u + t1), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t1, -1.9e+48], t$95$2, If[LessEqual[t1, -5e-138], t$95$1, If[LessEqual[t1, 5.2e-225], N[(N[((-t1) / u), $MachinePrecision] * N[(v / u), $MachinePrecision]), $MachinePrecision], If[LessEqual[t1, 4.4e+54], t$95$1, t$95$2]]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := \frac{\left(-t1\right) \cdot v}{\left(t1 + u\right) \cdot \left(t1 + u\right)}\\
t_2 := \frac{-v}{\mathsf{fma}\left(2, u, t1\right)}\\
\mathbf{if}\;t1 \leq -1.9 \cdot 10^{+48}:\\
\;\;\;\;t\_2\\

\mathbf{elif}\;t1 \leq -5 \cdot 10^{-138}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;t1 \leq 5.2 \cdot 10^{-225}:\\
\;\;\;\;\frac{-t1}{u} \cdot \frac{v}{u}\\

\mathbf{elif}\;t1 \leq 4.4 \cdot 10^{+54}:\\
\;\;\;\;t\_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if t1 < -1.9e48 or 4.3999999999999998e54 < t1

    1. Initial program 55.3%

      \[\frac{\left(-t1\right) \cdot v}{\left(t1 + u\right) \cdot \left(t1 + u\right)} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. lift-/.f64N/A

        \[\leadsto \color{blue}{\frac{\left(-t1\right) \cdot v}{\left(t1 + u\right) \cdot \left(t1 + u\right)}} \]
      2. lift-*.f64N/A

        \[\leadsto \frac{\color{blue}{\left(-t1\right) \cdot v}}{\left(t1 + u\right) \cdot \left(t1 + u\right)} \]
      3. *-commutativeN/A

        \[\leadsto \frac{\color{blue}{v \cdot \left(-t1\right)}}{\left(t1 + u\right) \cdot \left(t1 + u\right)} \]
      4. lift-neg.f64N/A

        \[\leadsto \frac{v \cdot \color{blue}{\left(\mathsf{neg}\left(t1\right)\right)}}{\left(t1 + u\right) \cdot \left(t1 + u\right)} \]
      5. neg-mul-1N/A

        \[\leadsto \frac{v \cdot \color{blue}{\left(-1 \cdot t1\right)}}{\left(t1 + u\right) \cdot \left(t1 + u\right)} \]
      6. associate-*r*N/A

        \[\leadsto \frac{\color{blue}{\left(v \cdot -1\right) \cdot t1}}{\left(t1 + u\right) \cdot \left(t1 + u\right)} \]
      7. lift-*.f64N/A

        \[\leadsto \frac{\left(v \cdot -1\right) \cdot t1}{\color{blue}{\left(t1 + u\right) \cdot \left(t1 + u\right)}} \]
      8. times-fracN/A

        \[\leadsto \color{blue}{\frac{v \cdot -1}{t1 + u} \cdot \frac{t1}{t1 + u}} \]
      9. *-commutativeN/A

        \[\leadsto \frac{\color{blue}{-1 \cdot v}}{t1 + u} \cdot \frac{t1}{t1 + u} \]
      10. neg-mul-1N/A

        \[\leadsto \frac{\color{blue}{\mathsf{neg}\left(v\right)}}{t1 + u} \cdot \frac{t1}{t1 + u} \]
      11. lower-*.f64N/A

        \[\leadsto \color{blue}{\frac{\mathsf{neg}\left(v\right)}{t1 + u} \cdot \frac{t1}{t1 + u}} \]
      12. lower-/.f64N/A

        \[\leadsto \color{blue}{\frac{\mathsf{neg}\left(v\right)}{t1 + u}} \cdot \frac{t1}{t1 + u} \]
      13. lower-neg.f64N/A

        \[\leadsto \frac{\color{blue}{-v}}{t1 + u} \cdot \frac{t1}{t1 + u} \]
      14. lift-+.f64N/A

        \[\leadsto \frac{-v}{\color{blue}{t1 + u}} \cdot \frac{t1}{t1 + u} \]
      15. +-commutativeN/A

        \[\leadsto \frac{-v}{\color{blue}{u + t1}} \cdot \frac{t1}{t1 + u} \]
      16. lower-+.f64N/A

        \[\leadsto \frac{-v}{\color{blue}{u + t1}} \cdot \frac{t1}{t1 + u} \]
      17. lower-/.f6499.9

        \[\leadsto \frac{-v}{u + t1} \cdot \color{blue}{\frac{t1}{t1 + u}} \]
      18. lift-+.f64N/A

        \[\leadsto \frac{-v}{u + t1} \cdot \frac{t1}{\color{blue}{t1 + u}} \]
      19. +-commutativeN/A

        \[\leadsto \frac{-v}{u + t1} \cdot \frac{t1}{\color{blue}{u + t1}} \]
      20. lower-+.f6499.9

        \[\leadsto \frac{-v}{u + t1} \cdot \frac{t1}{\color{blue}{u + t1}} \]
    4. Applied rewrites99.9%

      \[\leadsto \color{blue}{\frac{-v}{u + t1} \cdot \frac{t1}{u + t1}} \]
    5. Step-by-step derivation
      1. lift-*.f64N/A

        \[\leadsto \color{blue}{\frac{-v}{u + t1} \cdot \frac{t1}{u + t1}} \]
      2. *-commutativeN/A

        \[\leadsto \color{blue}{\frac{t1}{u + t1} \cdot \frac{-v}{u + t1}} \]
      3. lift-/.f64N/A

        \[\leadsto \color{blue}{\frac{t1}{u + t1}} \cdot \frac{-v}{u + t1} \]
      4. clear-numN/A

        \[\leadsto \color{blue}{\frac{1}{\frac{u + t1}{t1}}} \cdot \frac{-v}{u + t1} \]
      5. lift-/.f64N/A

        \[\leadsto \frac{1}{\frac{u + t1}{t1}} \cdot \color{blue}{\frac{-v}{u + t1}} \]
      6. frac-timesN/A

        \[\leadsto \color{blue}{\frac{1 \cdot \left(-v\right)}{\frac{u + t1}{t1} \cdot \left(u + t1\right)}} \]
      7. *-lft-identityN/A

        \[\leadsto \frac{\color{blue}{-v}}{\frac{u + t1}{t1} \cdot \left(u + t1\right)} \]
      8. lower-/.f64N/A

        \[\leadsto \color{blue}{\frac{-v}{\frac{u + t1}{t1} \cdot \left(u + t1\right)}} \]
      9. lower-*.f64N/A

        \[\leadsto \frac{-v}{\color{blue}{\frac{u + t1}{t1} \cdot \left(u + t1\right)}} \]
      10. lower-/.f6495.3

        \[\leadsto \frac{-v}{\color{blue}{\frac{u + t1}{t1}} \cdot \left(u + t1\right)} \]
      11. lift-+.f64N/A

        \[\leadsto \frac{-v}{\frac{\color{blue}{u + t1}}{t1} \cdot \left(u + t1\right)} \]
      12. +-commutativeN/A

        \[\leadsto \frac{-v}{\frac{\color{blue}{t1 + u}}{t1} \cdot \left(u + t1\right)} \]
      13. lower-+.f6495.3

        \[\leadsto \frac{-v}{\frac{\color{blue}{t1 + u}}{t1} \cdot \left(u + t1\right)} \]
      14. lift-+.f64N/A

        \[\leadsto \frac{-v}{\frac{t1 + u}{t1} \cdot \color{blue}{\left(u + t1\right)}} \]
      15. +-commutativeN/A

        \[\leadsto \frac{-v}{\frac{t1 + u}{t1} \cdot \color{blue}{\left(t1 + u\right)}} \]
      16. lower-+.f6495.3

        \[\leadsto \frac{-v}{\frac{t1 + u}{t1} \cdot \color{blue}{\left(t1 + u\right)}} \]
    6. Applied rewrites95.3%

      \[\leadsto \color{blue}{\frac{-v}{\frac{t1 + u}{t1} \cdot \left(t1 + u\right)}} \]
    7. Taylor expanded in u around 0

      \[\leadsto \frac{-v}{\color{blue}{t1 + 2 \cdot u}} \]
    8. Step-by-step derivation
      1. +-commutativeN/A

        \[\leadsto \frac{-v}{\color{blue}{2 \cdot u + t1}} \]
      2. lower-fma.f6487.5

        \[\leadsto \frac{-v}{\color{blue}{\mathsf{fma}\left(2, u, t1\right)}} \]
    9. Applied rewrites87.5%

      \[\leadsto \frac{-v}{\color{blue}{\mathsf{fma}\left(2, u, t1\right)}} \]

    if -1.9e48 < t1 < -4.99999999999999989e-138 or 5.20000000000000027e-225 < t1 < 4.3999999999999998e54

    1. Initial program 89.2%

      \[\frac{\left(-t1\right) \cdot v}{\left(t1 + u\right) \cdot \left(t1 + u\right)} \]
    2. Add Preprocessing

    if -4.99999999999999989e-138 < t1 < 5.20000000000000027e-225

    1. Initial program 73.4%

      \[\frac{\left(-t1\right) \cdot v}{\left(t1 + u\right) \cdot \left(t1 + u\right)} \]
    2. Add Preprocessing
    3. Taylor expanded in u around inf

      \[\leadsto \color{blue}{-1 \cdot \frac{t1 \cdot v}{{u}^{2}}} \]
    4. Step-by-step derivation
      1. mul-1-negN/A

        \[\leadsto \color{blue}{\mathsf{neg}\left(\frac{t1 \cdot v}{{u}^{2}}\right)} \]
      2. distribute-neg-frac2N/A

        \[\leadsto \color{blue}{\frac{t1 \cdot v}{\mathsf{neg}\left({u}^{2}\right)}} \]
      3. mul-1-negN/A

        \[\leadsto \frac{t1 \cdot v}{\color{blue}{-1 \cdot {u}^{2}}} \]
      4. unpow2N/A

        \[\leadsto \frac{t1 \cdot v}{-1 \cdot \color{blue}{\left(u \cdot u\right)}} \]
      5. associate-*r*N/A

        \[\leadsto \frac{t1 \cdot v}{\color{blue}{\left(-1 \cdot u\right) \cdot u}} \]
      6. times-fracN/A

        \[\leadsto \color{blue}{\frac{t1}{-1 \cdot u} \cdot \frac{v}{u}} \]
      7. neg-mul-1N/A

        \[\leadsto \frac{t1}{\color{blue}{\mathsf{neg}\left(u\right)}} \cdot \frac{v}{u} \]
      8. lower-*.f64N/A

        \[\leadsto \color{blue}{\frac{t1}{\mathsf{neg}\left(u\right)} \cdot \frac{v}{u}} \]
      9. lower-/.f64N/A

        \[\leadsto \color{blue}{\frac{t1}{\mathsf{neg}\left(u\right)}} \cdot \frac{v}{u} \]
      10. lower-neg.f64N/A

        \[\leadsto \frac{t1}{\color{blue}{-u}} \cdot \frac{v}{u} \]
      11. lower-/.f6492.8

        \[\leadsto \frac{t1}{-u} \cdot \color{blue}{\frac{v}{u}} \]
    5. Applied rewrites92.8%

      \[\leadsto \color{blue}{\frac{t1}{-u} \cdot \frac{v}{u}} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification89.1%

    \[\leadsto \begin{array}{l} \mathbf{if}\;t1 \leq -1.9 \cdot 10^{+48}:\\ \;\;\;\;\frac{-v}{\mathsf{fma}\left(2, u, t1\right)}\\ \mathbf{elif}\;t1 \leq -5 \cdot 10^{-138}:\\ \;\;\;\;\frac{\left(-t1\right) \cdot v}{\left(t1 + u\right) \cdot \left(t1 + u\right)}\\ \mathbf{elif}\;t1 \leq 5.2 \cdot 10^{-225}:\\ \;\;\;\;\frac{-t1}{u} \cdot \frac{v}{u}\\ \mathbf{elif}\;t1 \leq 4.4 \cdot 10^{+54}:\\ \;\;\;\;\frac{\left(-t1\right) \cdot v}{\left(t1 + u\right) \cdot \left(t1 + u\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{-v}{\mathsf{fma}\left(2, u, t1\right)}\\ \end{array} \]
  5. Add Preprocessing

Alternative 3: 76.9% accurate, 0.7× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;t1 \leq -5.2 \cdot 10^{-108} \lor \neg \left(t1 \leq 2.4 \cdot 10^{-158}\right):\\ \;\;\;\;\frac{-v}{\mathsf{fma}\left(2, u, t1\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{-t1}{u} \cdot \frac{v}{u}\\ \end{array} \end{array} \]
(FPCore (u v t1)
 :precision binary64
 (if (or (<= t1 -5.2e-108) (not (<= t1 2.4e-158)))
   (/ (- v) (fma 2.0 u t1))
   (* (/ (- t1) u) (/ v u))))
double code(double u, double v, double t1) {
	double tmp;
	if ((t1 <= -5.2e-108) || !(t1 <= 2.4e-158)) {
		tmp = -v / fma(2.0, u, t1);
	} else {
		tmp = (-t1 / u) * (v / u);
	}
	return tmp;
}
function code(u, v, t1)
	tmp = 0.0
	if ((t1 <= -5.2e-108) || !(t1 <= 2.4e-158))
		tmp = Float64(Float64(-v) / fma(2.0, u, t1));
	else
		tmp = Float64(Float64(Float64(-t1) / u) * Float64(v / u));
	end
	return tmp
end
code[u_, v_, t1_] := If[Or[LessEqual[t1, -5.2e-108], N[Not[LessEqual[t1, 2.4e-158]], $MachinePrecision]], N[((-v) / N[(2.0 * u + t1), $MachinePrecision]), $MachinePrecision], N[(N[((-t1) / u), $MachinePrecision] * N[(v / u), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;t1 \leq -5.2 \cdot 10^{-108} \lor \neg \left(t1 \leq 2.4 \cdot 10^{-158}\right):\\
\;\;\;\;\frac{-v}{\mathsf{fma}\left(2, u, t1\right)}\\

\mathbf{else}:\\
\;\;\;\;\frac{-t1}{u} \cdot \frac{v}{u}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t1 < -5.19999999999999968e-108 or 2.40000000000000007e-158 < t1

    1. Initial program 66.7%

      \[\frac{\left(-t1\right) \cdot v}{\left(t1 + u\right) \cdot \left(t1 + u\right)} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. lift-/.f64N/A

        \[\leadsto \color{blue}{\frac{\left(-t1\right) \cdot v}{\left(t1 + u\right) \cdot \left(t1 + u\right)}} \]
      2. lift-*.f64N/A

        \[\leadsto \frac{\color{blue}{\left(-t1\right) \cdot v}}{\left(t1 + u\right) \cdot \left(t1 + u\right)} \]
      3. *-commutativeN/A

        \[\leadsto \frac{\color{blue}{v \cdot \left(-t1\right)}}{\left(t1 + u\right) \cdot \left(t1 + u\right)} \]
      4. lift-neg.f64N/A

        \[\leadsto \frac{v \cdot \color{blue}{\left(\mathsf{neg}\left(t1\right)\right)}}{\left(t1 + u\right) \cdot \left(t1 + u\right)} \]
      5. neg-mul-1N/A

        \[\leadsto \frac{v \cdot \color{blue}{\left(-1 \cdot t1\right)}}{\left(t1 + u\right) \cdot \left(t1 + u\right)} \]
      6. associate-*r*N/A

        \[\leadsto \frac{\color{blue}{\left(v \cdot -1\right) \cdot t1}}{\left(t1 + u\right) \cdot \left(t1 + u\right)} \]
      7. lift-*.f64N/A

        \[\leadsto \frac{\left(v \cdot -1\right) \cdot t1}{\color{blue}{\left(t1 + u\right) \cdot \left(t1 + u\right)}} \]
      8. times-fracN/A

        \[\leadsto \color{blue}{\frac{v \cdot -1}{t1 + u} \cdot \frac{t1}{t1 + u}} \]
      9. *-commutativeN/A

        \[\leadsto \frac{\color{blue}{-1 \cdot v}}{t1 + u} \cdot \frac{t1}{t1 + u} \]
      10. neg-mul-1N/A

        \[\leadsto \frac{\color{blue}{\mathsf{neg}\left(v\right)}}{t1 + u} \cdot \frac{t1}{t1 + u} \]
      11. lower-*.f64N/A

        \[\leadsto \color{blue}{\frac{\mathsf{neg}\left(v\right)}{t1 + u} \cdot \frac{t1}{t1 + u}} \]
      12. lower-/.f64N/A

        \[\leadsto \color{blue}{\frac{\mathsf{neg}\left(v\right)}{t1 + u}} \cdot \frac{t1}{t1 + u} \]
      13. lower-neg.f64N/A

        \[\leadsto \frac{\color{blue}{-v}}{t1 + u} \cdot \frac{t1}{t1 + u} \]
      14. lift-+.f64N/A

        \[\leadsto \frac{-v}{\color{blue}{t1 + u}} \cdot \frac{t1}{t1 + u} \]
      15. +-commutativeN/A

        \[\leadsto \frac{-v}{\color{blue}{u + t1}} \cdot \frac{t1}{t1 + u} \]
      16. lower-+.f64N/A

        \[\leadsto \frac{-v}{\color{blue}{u + t1}} \cdot \frac{t1}{t1 + u} \]
      17. lower-/.f6499.8

        \[\leadsto \frac{-v}{u + t1} \cdot \color{blue}{\frac{t1}{t1 + u}} \]
      18. lift-+.f64N/A

        \[\leadsto \frac{-v}{u + t1} \cdot \frac{t1}{\color{blue}{t1 + u}} \]
      19. +-commutativeN/A

        \[\leadsto \frac{-v}{u + t1} \cdot \frac{t1}{\color{blue}{u + t1}} \]
      20. lower-+.f6499.8

        \[\leadsto \frac{-v}{u + t1} \cdot \frac{t1}{\color{blue}{u + t1}} \]
    4. Applied rewrites99.8%

      \[\leadsto \color{blue}{\frac{-v}{u + t1} \cdot \frac{t1}{u + t1}} \]
    5. Step-by-step derivation
      1. lift-*.f64N/A

        \[\leadsto \color{blue}{\frac{-v}{u + t1} \cdot \frac{t1}{u + t1}} \]
      2. *-commutativeN/A

        \[\leadsto \color{blue}{\frac{t1}{u + t1} \cdot \frac{-v}{u + t1}} \]
      3. lift-/.f64N/A

        \[\leadsto \color{blue}{\frac{t1}{u + t1}} \cdot \frac{-v}{u + t1} \]
      4. clear-numN/A

        \[\leadsto \color{blue}{\frac{1}{\frac{u + t1}{t1}}} \cdot \frac{-v}{u + t1} \]
      5. lift-/.f64N/A

        \[\leadsto \frac{1}{\frac{u + t1}{t1}} \cdot \color{blue}{\frac{-v}{u + t1}} \]
      6. frac-timesN/A

        \[\leadsto \color{blue}{\frac{1 \cdot \left(-v\right)}{\frac{u + t1}{t1} \cdot \left(u + t1\right)}} \]
      7. *-lft-identityN/A

        \[\leadsto \frac{\color{blue}{-v}}{\frac{u + t1}{t1} \cdot \left(u + t1\right)} \]
      8. lower-/.f64N/A

        \[\leadsto \color{blue}{\frac{-v}{\frac{u + t1}{t1} \cdot \left(u + t1\right)}} \]
      9. lower-*.f64N/A

        \[\leadsto \frac{-v}{\color{blue}{\frac{u + t1}{t1} \cdot \left(u + t1\right)}} \]
      10. lower-/.f6494.4

        \[\leadsto \frac{-v}{\color{blue}{\frac{u + t1}{t1}} \cdot \left(u + t1\right)} \]
      11. lift-+.f64N/A

        \[\leadsto \frac{-v}{\frac{\color{blue}{u + t1}}{t1} \cdot \left(u + t1\right)} \]
      12. +-commutativeN/A

        \[\leadsto \frac{-v}{\frac{\color{blue}{t1 + u}}{t1} \cdot \left(u + t1\right)} \]
      13. lower-+.f6494.4

        \[\leadsto \frac{-v}{\frac{\color{blue}{t1 + u}}{t1} \cdot \left(u + t1\right)} \]
      14. lift-+.f64N/A

        \[\leadsto \frac{-v}{\frac{t1 + u}{t1} \cdot \color{blue}{\left(u + t1\right)}} \]
      15. +-commutativeN/A

        \[\leadsto \frac{-v}{\frac{t1 + u}{t1} \cdot \color{blue}{\left(t1 + u\right)}} \]
      16. lower-+.f6494.4

        \[\leadsto \frac{-v}{\frac{t1 + u}{t1} \cdot \color{blue}{\left(t1 + u\right)}} \]
    6. Applied rewrites94.4%

      \[\leadsto \color{blue}{\frac{-v}{\frac{t1 + u}{t1} \cdot \left(t1 + u\right)}} \]
    7. Taylor expanded in u around 0

      \[\leadsto \frac{-v}{\color{blue}{t1 + 2 \cdot u}} \]
    8. Step-by-step derivation
      1. +-commutativeN/A

        \[\leadsto \frac{-v}{\color{blue}{2 \cdot u + t1}} \]
      2. lower-fma.f6478.4

        \[\leadsto \frac{-v}{\color{blue}{\mathsf{fma}\left(2, u, t1\right)}} \]
    9. Applied rewrites78.4%

      \[\leadsto \frac{-v}{\color{blue}{\mathsf{fma}\left(2, u, t1\right)}} \]

    if -5.19999999999999968e-108 < t1 < 2.40000000000000007e-158

    1. Initial program 78.5%

      \[\frac{\left(-t1\right) \cdot v}{\left(t1 + u\right) \cdot \left(t1 + u\right)} \]
    2. Add Preprocessing
    3. Taylor expanded in u around inf

      \[\leadsto \color{blue}{-1 \cdot \frac{t1 \cdot v}{{u}^{2}}} \]
    4. Step-by-step derivation
      1. mul-1-negN/A

        \[\leadsto \color{blue}{\mathsf{neg}\left(\frac{t1 \cdot v}{{u}^{2}}\right)} \]
      2. distribute-neg-frac2N/A

        \[\leadsto \color{blue}{\frac{t1 \cdot v}{\mathsf{neg}\left({u}^{2}\right)}} \]
      3. mul-1-negN/A

        \[\leadsto \frac{t1 \cdot v}{\color{blue}{-1 \cdot {u}^{2}}} \]
      4. unpow2N/A

        \[\leadsto \frac{t1 \cdot v}{-1 \cdot \color{blue}{\left(u \cdot u\right)}} \]
      5. associate-*r*N/A

        \[\leadsto \frac{t1 \cdot v}{\color{blue}{\left(-1 \cdot u\right) \cdot u}} \]
      6. times-fracN/A

        \[\leadsto \color{blue}{\frac{t1}{-1 \cdot u} \cdot \frac{v}{u}} \]
      7. neg-mul-1N/A

        \[\leadsto \frac{t1}{\color{blue}{\mathsf{neg}\left(u\right)}} \cdot \frac{v}{u} \]
      8. lower-*.f64N/A

        \[\leadsto \color{blue}{\frac{t1}{\mathsf{neg}\left(u\right)} \cdot \frac{v}{u}} \]
      9. lower-/.f64N/A

        \[\leadsto \color{blue}{\frac{t1}{\mathsf{neg}\left(u\right)}} \cdot \frac{v}{u} \]
      10. lower-neg.f64N/A

        \[\leadsto \frac{t1}{\color{blue}{-u}} \cdot \frac{v}{u} \]
      11. lower-/.f6491.8

        \[\leadsto \frac{t1}{-u} \cdot \color{blue}{\frac{v}{u}} \]
    5. Applied rewrites91.8%

      \[\leadsto \color{blue}{\frac{t1}{-u} \cdot \frac{v}{u}} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification82.1%

    \[\leadsto \begin{array}{l} \mathbf{if}\;t1 \leq -5.2 \cdot 10^{-108} \lor \neg \left(t1 \leq 2.4 \cdot 10^{-158}\right):\\ \;\;\;\;\frac{-v}{\mathsf{fma}\left(2, u, t1\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{-t1}{u} \cdot \frac{v}{u}\\ \end{array} \]
  5. Add Preprocessing

Alternative 4: 77.2% accurate, 0.7× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;t1 \leq -5.2 \cdot 10^{-108} \lor \neg \left(t1 \leq 2.4 \cdot 10^{-158}\right):\\ \;\;\;\;\frac{-v}{\mathsf{fma}\left(2, u, t1\right)}\\ \mathbf{else}:\\ \;\;\;\;v \cdot \frac{\frac{-t1}{u}}{u}\\ \end{array} \end{array} \]
(FPCore (u v t1)
 :precision binary64
 (if (or (<= t1 -5.2e-108) (not (<= t1 2.4e-158)))
   (/ (- v) (fma 2.0 u t1))
   (* v (/ (/ (- t1) u) u))))
double code(double u, double v, double t1) {
	double tmp;
	if ((t1 <= -5.2e-108) || !(t1 <= 2.4e-158)) {
		tmp = -v / fma(2.0, u, t1);
	} else {
		tmp = v * ((-t1 / u) / u);
	}
	return tmp;
}
function code(u, v, t1)
	tmp = 0.0
	if ((t1 <= -5.2e-108) || !(t1 <= 2.4e-158))
		tmp = Float64(Float64(-v) / fma(2.0, u, t1));
	else
		tmp = Float64(v * Float64(Float64(Float64(-t1) / u) / u));
	end
	return tmp
end
code[u_, v_, t1_] := If[Or[LessEqual[t1, -5.2e-108], N[Not[LessEqual[t1, 2.4e-158]], $MachinePrecision]], N[((-v) / N[(2.0 * u + t1), $MachinePrecision]), $MachinePrecision], N[(v * N[(N[((-t1) / u), $MachinePrecision] / u), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;t1 \leq -5.2 \cdot 10^{-108} \lor \neg \left(t1 \leq 2.4 \cdot 10^{-158}\right):\\
\;\;\;\;\frac{-v}{\mathsf{fma}\left(2, u, t1\right)}\\

\mathbf{else}:\\
\;\;\;\;v \cdot \frac{\frac{-t1}{u}}{u}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t1 < -5.19999999999999968e-108 or 2.40000000000000007e-158 < t1

    1. Initial program 66.7%

      \[\frac{\left(-t1\right) \cdot v}{\left(t1 + u\right) \cdot \left(t1 + u\right)} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. lift-/.f64N/A

        \[\leadsto \color{blue}{\frac{\left(-t1\right) \cdot v}{\left(t1 + u\right) \cdot \left(t1 + u\right)}} \]
      2. lift-*.f64N/A

        \[\leadsto \frac{\color{blue}{\left(-t1\right) \cdot v}}{\left(t1 + u\right) \cdot \left(t1 + u\right)} \]
      3. *-commutativeN/A

        \[\leadsto \frac{\color{blue}{v \cdot \left(-t1\right)}}{\left(t1 + u\right) \cdot \left(t1 + u\right)} \]
      4. lift-neg.f64N/A

        \[\leadsto \frac{v \cdot \color{blue}{\left(\mathsf{neg}\left(t1\right)\right)}}{\left(t1 + u\right) \cdot \left(t1 + u\right)} \]
      5. neg-mul-1N/A

        \[\leadsto \frac{v \cdot \color{blue}{\left(-1 \cdot t1\right)}}{\left(t1 + u\right) \cdot \left(t1 + u\right)} \]
      6. associate-*r*N/A

        \[\leadsto \frac{\color{blue}{\left(v \cdot -1\right) \cdot t1}}{\left(t1 + u\right) \cdot \left(t1 + u\right)} \]
      7. lift-*.f64N/A

        \[\leadsto \frac{\left(v \cdot -1\right) \cdot t1}{\color{blue}{\left(t1 + u\right) \cdot \left(t1 + u\right)}} \]
      8. times-fracN/A

        \[\leadsto \color{blue}{\frac{v \cdot -1}{t1 + u} \cdot \frac{t1}{t1 + u}} \]
      9. *-commutativeN/A

        \[\leadsto \frac{\color{blue}{-1 \cdot v}}{t1 + u} \cdot \frac{t1}{t1 + u} \]
      10. neg-mul-1N/A

        \[\leadsto \frac{\color{blue}{\mathsf{neg}\left(v\right)}}{t1 + u} \cdot \frac{t1}{t1 + u} \]
      11. lower-*.f64N/A

        \[\leadsto \color{blue}{\frac{\mathsf{neg}\left(v\right)}{t1 + u} \cdot \frac{t1}{t1 + u}} \]
      12. lower-/.f64N/A

        \[\leadsto \color{blue}{\frac{\mathsf{neg}\left(v\right)}{t1 + u}} \cdot \frac{t1}{t1 + u} \]
      13. lower-neg.f64N/A

        \[\leadsto \frac{\color{blue}{-v}}{t1 + u} \cdot \frac{t1}{t1 + u} \]
      14. lift-+.f64N/A

        \[\leadsto \frac{-v}{\color{blue}{t1 + u}} \cdot \frac{t1}{t1 + u} \]
      15. +-commutativeN/A

        \[\leadsto \frac{-v}{\color{blue}{u + t1}} \cdot \frac{t1}{t1 + u} \]
      16. lower-+.f64N/A

        \[\leadsto \frac{-v}{\color{blue}{u + t1}} \cdot \frac{t1}{t1 + u} \]
      17. lower-/.f6499.8

        \[\leadsto \frac{-v}{u + t1} \cdot \color{blue}{\frac{t1}{t1 + u}} \]
      18. lift-+.f64N/A

        \[\leadsto \frac{-v}{u + t1} \cdot \frac{t1}{\color{blue}{t1 + u}} \]
      19. +-commutativeN/A

        \[\leadsto \frac{-v}{u + t1} \cdot \frac{t1}{\color{blue}{u + t1}} \]
      20. lower-+.f6499.8

        \[\leadsto \frac{-v}{u + t1} \cdot \frac{t1}{\color{blue}{u + t1}} \]
    4. Applied rewrites99.8%

      \[\leadsto \color{blue}{\frac{-v}{u + t1} \cdot \frac{t1}{u + t1}} \]
    5. Step-by-step derivation
      1. lift-*.f64N/A

        \[\leadsto \color{blue}{\frac{-v}{u + t1} \cdot \frac{t1}{u + t1}} \]
      2. *-commutativeN/A

        \[\leadsto \color{blue}{\frac{t1}{u + t1} \cdot \frac{-v}{u + t1}} \]
      3. lift-/.f64N/A

        \[\leadsto \color{blue}{\frac{t1}{u + t1}} \cdot \frac{-v}{u + t1} \]
      4. clear-numN/A

        \[\leadsto \color{blue}{\frac{1}{\frac{u + t1}{t1}}} \cdot \frac{-v}{u + t1} \]
      5. lift-/.f64N/A

        \[\leadsto \frac{1}{\frac{u + t1}{t1}} \cdot \color{blue}{\frac{-v}{u + t1}} \]
      6. frac-timesN/A

        \[\leadsto \color{blue}{\frac{1 \cdot \left(-v\right)}{\frac{u + t1}{t1} \cdot \left(u + t1\right)}} \]
      7. *-lft-identityN/A

        \[\leadsto \frac{\color{blue}{-v}}{\frac{u + t1}{t1} \cdot \left(u + t1\right)} \]
      8. lower-/.f64N/A

        \[\leadsto \color{blue}{\frac{-v}{\frac{u + t1}{t1} \cdot \left(u + t1\right)}} \]
      9. lower-*.f64N/A

        \[\leadsto \frac{-v}{\color{blue}{\frac{u + t1}{t1} \cdot \left(u + t1\right)}} \]
      10. lower-/.f6494.4

        \[\leadsto \frac{-v}{\color{blue}{\frac{u + t1}{t1}} \cdot \left(u + t1\right)} \]
      11. lift-+.f64N/A

        \[\leadsto \frac{-v}{\frac{\color{blue}{u + t1}}{t1} \cdot \left(u + t1\right)} \]
      12. +-commutativeN/A

        \[\leadsto \frac{-v}{\frac{\color{blue}{t1 + u}}{t1} \cdot \left(u + t1\right)} \]
      13. lower-+.f6494.4

        \[\leadsto \frac{-v}{\frac{\color{blue}{t1 + u}}{t1} \cdot \left(u + t1\right)} \]
      14. lift-+.f64N/A

        \[\leadsto \frac{-v}{\frac{t1 + u}{t1} \cdot \color{blue}{\left(u + t1\right)}} \]
      15. +-commutativeN/A

        \[\leadsto \frac{-v}{\frac{t1 + u}{t1} \cdot \color{blue}{\left(t1 + u\right)}} \]
      16. lower-+.f6494.4

        \[\leadsto \frac{-v}{\frac{t1 + u}{t1} \cdot \color{blue}{\left(t1 + u\right)}} \]
    6. Applied rewrites94.4%

      \[\leadsto \color{blue}{\frac{-v}{\frac{t1 + u}{t1} \cdot \left(t1 + u\right)}} \]
    7. Taylor expanded in u around 0

      \[\leadsto \frac{-v}{\color{blue}{t1 + 2 \cdot u}} \]
    8. Step-by-step derivation
      1. +-commutativeN/A

        \[\leadsto \frac{-v}{\color{blue}{2 \cdot u + t1}} \]
      2. lower-fma.f6478.4

        \[\leadsto \frac{-v}{\color{blue}{\mathsf{fma}\left(2, u, t1\right)}} \]
    9. Applied rewrites78.4%

      \[\leadsto \frac{-v}{\color{blue}{\mathsf{fma}\left(2, u, t1\right)}} \]

    if -5.19999999999999968e-108 < t1 < 2.40000000000000007e-158

    1. Initial program 78.5%

      \[\frac{\left(-t1\right) \cdot v}{\left(t1 + u\right) \cdot \left(t1 + u\right)} \]
    2. Add Preprocessing
    3. Taylor expanded in u around inf

      \[\leadsto \color{blue}{-1 \cdot \frac{t1 \cdot v}{{u}^{2}}} \]
    4. Step-by-step derivation
      1. mul-1-negN/A

        \[\leadsto \color{blue}{\mathsf{neg}\left(\frac{t1 \cdot v}{{u}^{2}}\right)} \]
      2. distribute-neg-frac2N/A

        \[\leadsto \color{blue}{\frac{t1 \cdot v}{\mathsf{neg}\left({u}^{2}\right)}} \]
      3. mul-1-negN/A

        \[\leadsto \frac{t1 \cdot v}{\color{blue}{-1 \cdot {u}^{2}}} \]
      4. unpow2N/A

        \[\leadsto \frac{t1 \cdot v}{-1 \cdot \color{blue}{\left(u \cdot u\right)}} \]
      5. associate-*r*N/A

        \[\leadsto \frac{t1 \cdot v}{\color{blue}{\left(-1 \cdot u\right) \cdot u}} \]
      6. times-fracN/A

        \[\leadsto \color{blue}{\frac{t1}{-1 \cdot u} \cdot \frac{v}{u}} \]
      7. neg-mul-1N/A

        \[\leadsto \frac{t1}{\color{blue}{\mathsf{neg}\left(u\right)}} \cdot \frac{v}{u} \]
      8. lower-*.f64N/A

        \[\leadsto \color{blue}{\frac{t1}{\mathsf{neg}\left(u\right)} \cdot \frac{v}{u}} \]
      9. lower-/.f64N/A

        \[\leadsto \color{blue}{\frac{t1}{\mathsf{neg}\left(u\right)}} \cdot \frac{v}{u} \]
      10. lower-neg.f64N/A

        \[\leadsto \frac{t1}{\color{blue}{-u}} \cdot \frac{v}{u} \]
      11. lower-/.f6491.8

        \[\leadsto \frac{t1}{-u} \cdot \color{blue}{\frac{v}{u}} \]
    5. Applied rewrites91.8%

      \[\leadsto \color{blue}{\frac{t1}{-u} \cdot \frac{v}{u}} \]
    6. Step-by-step derivation
      1. Applied rewrites77.1%

        \[\leadsto \left(t1 \cdot v\right) \cdot \color{blue}{\frac{-1}{u \cdot u}} \]
      2. Step-by-step derivation
        1. Applied rewrites82.8%

          \[\leadsto v \cdot \color{blue}{\frac{t1}{\left(-u\right) \cdot u}} \]
        2. Step-by-step derivation
          1. Applied rewrites89.7%

            \[\leadsto v \cdot \frac{\frac{-t1}{u}}{\color{blue}{u}} \]
        3. Recombined 2 regimes into one program.
        4. Final simplification81.5%

          \[\leadsto \begin{array}{l} \mathbf{if}\;t1 \leq -5.2 \cdot 10^{-108} \lor \neg \left(t1 \leq 2.4 \cdot 10^{-158}\right):\\ \;\;\;\;\frac{-v}{\mathsf{fma}\left(2, u, t1\right)}\\ \mathbf{else}:\\ \;\;\;\;v \cdot \frac{\frac{-t1}{u}}{u}\\ \end{array} \]
        5. Add Preprocessing

        Alternative 5: 95.1% accurate, 0.7× speedup?

        \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;u \leq 8.6 \cdot 10^{+147}:\\ \;\;\;\;\frac{-v}{\mathsf{fma}\left(\frac{u}{t1} + 2, u, t1\right)}\\ \mathbf{else}:\\ \;\;\;\;\left(\frac{t1}{u} \cdot v\right) \cdot \frac{-1}{u}\\ \end{array} \end{array} \]
        (FPCore (u v t1)
         :precision binary64
         (if (<= u 8.6e+147)
           (/ (- v) (fma (+ (/ u t1) 2.0) u t1))
           (* (* (/ t1 u) v) (/ -1.0 u))))
        double code(double u, double v, double t1) {
        	double tmp;
        	if (u <= 8.6e+147) {
        		tmp = -v / fma(((u / t1) + 2.0), u, t1);
        	} else {
        		tmp = ((t1 / u) * v) * (-1.0 / u);
        	}
        	return tmp;
        }
        
        function code(u, v, t1)
        	tmp = 0.0
        	if (u <= 8.6e+147)
        		tmp = Float64(Float64(-v) / fma(Float64(Float64(u / t1) + 2.0), u, t1));
        	else
        		tmp = Float64(Float64(Float64(t1 / u) * v) * Float64(-1.0 / u));
        	end
        	return tmp
        end
        
        code[u_, v_, t1_] := If[LessEqual[u, 8.6e+147], N[((-v) / N[(N[(N[(u / t1), $MachinePrecision] + 2.0), $MachinePrecision] * u + t1), $MachinePrecision]), $MachinePrecision], N[(N[(N[(t1 / u), $MachinePrecision] * v), $MachinePrecision] * N[(-1.0 / u), $MachinePrecision]), $MachinePrecision]]
        
        \begin{array}{l}
        
        \\
        \begin{array}{l}
        \mathbf{if}\;u \leq 8.6 \cdot 10^{+147}:\\
        \;\;\;\;\frac{-v}{\mathsf{fma}\left(\frac{u}{t1} + 2, u, t1\right)}\\
        
        \mathbf{else}:\\
        \;\;\;\;\left(\frac{t1}{u} \cdot v\right) \cdot \frac{-1}{u}\\
        
        
        \end{array}
        \end{array}
        
        Derivation
        1. Split input into 2 regimes
        2. if u < 8.5999999999999997e147

          1. Initial program 71.3%

            \[\frac{\left(-t1\right) \cdot v}{\left(t1 + u\right) \cdot \left(t1 + u\right)} \]
          2. Add Preprocessing
          3. Step-by-step derivation
            1. lift-/.f64N/A

              \[\leadsto \color{blue}{\frac{\left(-t1\right) \cdot v}{\left(t1 + u\right) \cdot \left(t1 + u\right)}} \]
            2. lift-*.f64N/A

              \[\leadsto \frac{\color{blue}{\left(-t1\right) \cdot v}}{\left(t1 + u\right) \cdot \left(t1 + u\right)} \]
            3. *-commutativeN/A

              \[\leadsto \frac{\color{blue}{v \cdot \left(-t1\right)}}{\left(t1 + u\right) \cdot \left(t1 + u\right)} \]
            4. lift-neg.f64N/A

              \[\leadsto \frac{v \cdot \color{blue}{\left(\mathsf{neg}\left(t1\right)\right)}}{\left(t1 + u\right) \cdot \left(t1 + u\right)} \]
            5. neg-mul-1N/A

              \[\leadsto \frac{v \cdot \color{blue}{\left(-1 \cdot t1\right)}}{\left(t1 + u\right) \cdot \left(t1 + u\right)} \]
            6. associate-*r*N/A

              \[\leadsto \frac{\color{blue}{\left(v \cdot -1\right) \cdot t1}}{\left(t1 + u\right) \cdot \left(t1 + u\right)} \]
            7. lift-*.f64N/A

              \[\leadsto \frac{\left(v \cdot -1\right) \cdot t1}{\color{blue}{\left(t1 + u\right) \cdot \left(t1 + u\right)}} \]
            8. times-fracN/A

              \[\leadsto \color{blue}{\frac{v \cdot -1}{t1 + u} \cdot \frac{t1}{t1 + u}} \]
            9. *-commutativeN/A

              \[\leadsto \frac{\color{blue}{-1 \cdot v}}{t1 + u} \cdot \frac{t1}{t1 + u} \]
            10. neg-mul-1N/A

              \[\leadsto \frac{\color{blue}{\mathsf{neg}\left(v\right)}}{t1 + u} \cdot \frac{t1}{t1 + u} \]
            11. lower-*.f64N/A

              \[\leadsto \color{blue}{\frac{\mathsf{neg}\left(v\right)}{t1 + u} \cdot \frac{t1}{t1 + u}} \]
            12. lower-/.f64N/A

              \[\leadsto \color{blue}{\frac{\mathsf{neg}\left(v\right)}{t1 + u}} \cdot \frac{t1}{t1 + u} \]
            13. lower-neg.f64N/A

              \[\leadsto \frac{\color{blue}{-v}}{t1 + u} \cdot \frac{t1}{t1 + u} \]
            14. lift-+.f64N/A

              \[\leadsto \frac{-v}{\color{blue}{t1 + u}} \cdot \frac{t1}{t1 + u} \]
            15. +-commutativeN/A

              \[\leadsto \frac{-v}{\color{blue}{u + t1}} \cdot \frac{t1}{t1 + u} \]
            16. lower-+.f64N/A

              \[\leadsto \frac{-v}{\color{blue}{u + t1}} \cdot \frac{t1}{t1 + u} \]
            17. lower-/.f6499.4

              \[\leadsto \frac{-v}{u + t1} \cdot \color{blue}{\frac{t1}{t1 + u}} \]
            18. lift-+.f64N/A

              \[\leadsto \frac{-v}{u + t1} \cdot \frac{t1}{\color{blue}{t1 + u}} \]
            19. +-commutativeN/A

              \[\leadsto \frac{-v}{u + t1} \cdot \frac{t1}{\color{blue}{u + t1}} \]
            20. lower-+.f6499.4

              \[\leadsto \frac{-v}{u + t1} \cdot \frac{t1}{\color{blue}{u + t1}} \]
          4. Applied rewrites99.4%

            \[\leadsto \color{blue}{\frac{-v}{u + t1} \cdot \frac{t1}{u + t1}} \]
          5. Step-by-step derivation
            1. lift-*.f64N/A

              \[\leadsto \color{blue}{\frac{-v}{u + t1} \cdot \frac{t1}{u + t1}} \]
            2. *-commutativeN/A

              \[\leadsto \color{blue}{\frac{t1}{u + t1} \cdot \frac{-v}{u + t1}} \]
            3. lift-/.f64N/A

              \[\leadsto \color{blue}{\frac{t1}{u + t1}} \cdot \frac{-v}{u + t1} \]
            4. clear-numN/A

              \[\leadsto \color{blue}{\frac{1}{\frac{u + t1}{t1}}} \cdot \frac{-v}{u + t1} \]
            5. lift-/.f64N/A

              \[\leadsto \frac{1}{\frac{u + t1}{t1}} \cdot \color{blue}{\frac{-v}{u + t1}} \]
            6. frac-timesN/A

              \[\leadsto \color{blue}{\frac{1 \cdot \left(-v\right)}{\frac{u + t1}{t1} \cdot \left(u + t1\right)}} \]
            7. *-lft-identityN/A

              \[\leadsto \frac{\color{blue}{-v}}{\frac{u + t1}{t1} \cdot \left(u + t1\right)} \]
            8. lower-/.f64N/A

              \[\leadsto \color{blue}{\frac{-v}{\frac{u + t1}{t1} \cdot \left(u + t1\right)}} \]
            9. lower-*.f64N/A

              \[\leadsto \frac{-v}{\color{blue}{\frac{u + t1}{t1} \cdot \left(u + t1\right)}} \]
            10. lower-/.f6496.6

              \[\leadsto \frac{-v}{\color{blue}{\frac{u + t1}{t1}} \cdot \left(u + t1\right)} \]
            11. lift-+.f64N/A

              \[\leadsto \frac{-v}{\frac{\color{blue}{u + t1}}{t1} \cdot \left(u + t1\right)} \]
            12. +-commutativeN/A

              \[\leadsto \frac{-v}{\frac{\color{blue}{t1 + u}}{t1} \cdot \left(u + t1\right)} \]
            13. lower-+.f6496.6

              \[\leadsto \frac{-v}{\frac{\color{blue}{t1 + u}}{t1} \cdot \left(u + t1\right)} \]
            14. lift-+.f64N/A

              \[\leadsto \frac{-v}{\frac{t1 + u}{t1} \cdot \color{blue}{\left(u + t1\right)}} \]
            15. +-commutativeN/A

              \[\leadsto \frac{-v}{\frac{t1 + u}{t1} \cdot \color{blue}{\left(t1 + u\right)}} \]
            16. lower-+.f6496.6

              \[\leadsto \frac{-v}{\frac{t1 + u}{t1} \cdot \color{blue}{\left(t1 + u\right)}} \]
          6. Applied rewrites96.6%

            \[\leadsto \color{blue}{\frac{-v}{\frac{t1 + u}{t1} \cdot \left(t1 + u\right)}} \]
          7. Taylor expanded in u around 0

            \[\leadsto \frac{-v}{\color{blue}{t1 + u \cdot \left(2 + \frac{u}{t1}\right)}} \]
          8. Step-by-step derivation
            1. +-commutativeN/A

              \[\leadsto \frac{-v}{\color{blue}{u \cdot \left(2 + \frac{u}{t1}\right) + t1}} \]
            2. *-commutativeN/A

              \[\leadsto \frac{-v}{\color{blue}{\left(2 + \frac{u}{t1}\right) \cdot u} + t1} \]
            3. lower-fma.f64N/A

              \[\leadsto \frac{-v}{\color{blue}{\mathsf{fma}\left(2 + \frac{u}{t1}, u, t1\right)}} \]
            4. +-commutativeN/A

              \[\leadsto \frac{-v}{\mathsf{fma}\left(\color{blue}{\frac{u}{t1} + 2}, u, t1\right)} \]
            5. lower-+.f64N/A

              \[\leadsto \frac{-v}{\mathsf{fma}\left(\color{blue}{\frac{u}{t1} + 2}, u, t1\right)} \]
            6. lower-/.f6496.6

              \[\leadsto \frac{-v}{\mathsf{fma}\left(\color{blue}{\frac{u}{t1}} + 2, u, t1\right)} \]
          9. Applied rewrites96.6%

            \[\leadsto \frac{-v}{\color{blue}{\mathsf{fma}\left(\frac{u}{t1} + 2, u, t1\right)}} \]

          if 8.5999999999999997e147 < u

          1. Initial program 57.4%

            \[\frac{\left(-t1\right) \cdot v}{\left(t1 + u\right) \cdot \left(t1 + u\right)} \]
          2. Add Preprocessing
          3. Taylor expanded in u around inf

            \[\leadsto \color{blue}{-1 \cdot \frac{t1 \cdot v}{{u}^{2}}} \]
          4. Step-by-step derivation
            1. mul-1-negN/A

              \[\leadsto \color{blue}{\mathsf{neg}\left(\frac{t1 \cdot v}{{u}^{2}}\right)} \]
            2. distribute-neg-frac2N/A

              \[\leadsto \color{blue}{\frac{t1 \cdot v}{\mathsf{neg}\left({u}^{2}\right)}} \]
            3. mul-1-negN/A

              \[\leadsto \frac{t1 \cdot v}{\color{blue}{-1 \cdot {u}^{2}}} \]
            4. unpow2N/A

              \[\leadsto \frac{t1 \cdot v}{-1 \cdot \color{blue}{\left(u \cdot u\right)}} \]
            5. associate-*r*N/A

              \[\leadsto \frac{t1 \cdot v}{\color{blue}{\left(-1 \cdot u\right) \cdot u}} \]
            6. times-fracN/A

              \[\leadsto \color{blue}{\frac{t1}{-1 \cdot u} \cdot \frac{v}{u}} \]
            7. neg-mul-1N/A

              \[\leadsto \frac{t1}{\color{blue}{\mathsf{neg}\left(u\right)}} \cdot \frac{v}{u} \]
            8. lower-*.f64N/A

              \[\leadsto \color{blue}{\frac{t1}{\mathsf{neg}\left(u\right)} \cdot \frac{v}{u}} \]
            9. lower-/.f64N/A

              \[\leadsto \color{blue}{\frac{t1}{\mathsf{neg}\left(u\right)}} \cdot \frac{v}{u} \]
            10. lower-neg.f64N/A

              \[\leadsto \frac{t1}{\color{blue}{-u}} \cdot \frac{v}{u} \]
            11. lower-/.f6493.4

              \[\leadsto \frac{t1}{-u} \cdot \color{blue}{\frac{v}{u}} \]
          5. Applied rewrites93.4%

            \[\leadsto \color{blue}{\frac{t1}{-u} \cdot \frac{v}{u}} \]
          6. Step-by-step derivation
            1. Applied rewrites93.6%

              \[\leadsto \left(\frac{t1}{u} \cdot v\right) \cdot \color{blue}{\frac{-1}{u}} \]
          7. Recombined 2 regimes into one program.
          8. Add Preprocessing

          Alternative 6: 75.1% accurate, 0.8× speedup?

          \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;t1 \leq -5.2 \cdot 10^{-108} \lor \neg \left(t1 \leq 2.4 \cdot 10^{-158}\right):\\ \;\;\;\;\frac{-v}{\mathsf{fma}\left(2, u, t1\right)}\\ \mathbf{else}:\\ \;\;\;\;t1 \cdot \frac{v}{\left(-u\right) \cdot u}\\ \end{array} \end{array} \]
          (FPCore (u v t1)
           :precision binary64
           (if (or (<= t1 -5.2e-108) (not (<= t1 2.4e-158)))
             (/ (- v) (fma 2.0 u t1))
             (* t1 (/ v (* (- u) u)))))
          double code(double u, double v, double t1) {
          	double tmp;
          	if ((t1 <= -5.2e-108) || !(t1 <= 2.4e-158)) {
          		tmp = -v / fma(2.0, u, t1);
          	} else {
          		tmp = t1 * (v / (-u * u));
          	}
          	return tmp;
          }
          
          function code(u, v, t1)
          	tmp = 0.0
          	if ((t1 <= -5.2e-108) || !(t1 <= 2.4e-158))
          		tmp = Float64(Float64(-v) / fma(2.0, u, t1));
          	else
          		tmp = Float64(t1 * Float64(v / Float64(Float64(-u) * u)));
          	end
          	return tmp
          end
          
          code[u_, v_, t1_] := If[Or[LessEqual[t1, -5.2e-108], N[Not[LessEqual[t1, 2.4e-158]], $MachinePrecision]], N[((-v) / N[(2.0 * u + t1), $MachinePrecision]), $MachinePrecision], N[(t1 * N[(v / N[((-u) * u), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
          
          \begin{array}{l}
          
          \\
          \begin{array}{l}
          \mathbf{if}\;t1 \leq -5.2 \cdot 10^{-108} \lor \neg \left(t1 \leq 2.4 \cdot 10^{-158}\right):\\
          \;\;\;\;\frac{-v}{\mathsf{fma}\left(2, u, t1\right)}\\
          
          \mathbf{else}:\\
          \;\;\;\;t1 \cdot \frac{v}{\left(-u\right) \cdot u}\\
          
          
          \end{array}
          \end{array}
          
          Derivation
          1. Split input into 2 regimes
          2. if t1 < -5.19999999999999968e-108 or 2.40000000000000007e-158 < t1

            1. Initial program 66.7%

              \[\frac{\left(-t1\right) \cdot v}{\left(t1 + u\right) \cdot \left(t1 + u\right)} \]
            2. Add Preprocessing
            3. Step-by-step derivation
              1. lift-/.f64N/A

                \[\leadsto \color{blue}{\frac{\left(-t1\right) \cdot v}{\left(t1 + u\right) \cdot \left(t1 + u\right)}} \]
              2. lift-*.f64N/A

                \[\leadsto \frac{\color{blue}{\left(-t1\right) \cdot v}}{\left(t1 + u\right) \cdot \left(t1 + u\right)} \]
              3. *-commutativeN/A

                \[\leadsto \frac{\color{blue}{v \cdot \left(-t1\right)}}{\left(t1 + u\right) \cdot \left(t1 + u\right)} \]
              4. lift-neg.f64N/A

                \[\leadsto \frac{v \cdot \color{blue}{\left(\mathsf{neg}\left(t1\right)\right)}}{\left(t1 + u\right) \cdot \left(t1 + u\right)} \]
              5. neg-mul-1N/A

                \[\leadsto \frac{v \cdot \color{blue}{\left(-1 \cdot t1\right)}}{\left(t1 + u\right) \cdot \left(t1 + u\right)} \]
              6. associate-*r*N/A

                \[\leadsto \frac{\color{blue}{\left(v \cdot -1\right) \cdot t1}}{\left(t1 + u\right) \cdot \left(t1 + u\right)} \]
              7. lift-*.f64N/A

                \[\leadsto \frac{\left(v \cdot -1\right) \cdot t1}{\color{blue}{\left(t1 + u\right) \cdot \left(t1 + u\right)}} \]
              8. times-fracN/A

                \[\leadsto \color{blue}{\frac{v \cdot -1}{t1 + u} \cdot \frac{t1}{t1 + u}} \]
              9. *-commutativeN/A

                \[\leadsto \frac{\color{blue}{-1 \cdot v}}{t1 + u} \cdot \frac{t1}{t1 + u} \]
              10. neg-mul-1N/A

                \[\leadsto \frac{\color{blue}{\mathsf{neg}\left(v\right)}}{t1 + u} \cdot \frac{t1}{t1 + u} \]
              11. lower-*.f64N/A

                \[\leadsto \color{blue}{\frac{\mathsf{neg}\left(v\right)}{t1 + u} \cdot \frac{t1}{t1 + u}} \]
              12. lower-/.f64N/A

                \[\leadsto \color{blue}{\frac{\mathsf{neg}\left(v\right)}{t1 + u}} \cdot \frac{t1}{t1 + u} \]
              13. lower-neg.f64N/A

                \[\leadsto \frac{\color{blue}{-v}}{t1 + u} \cdot \frac{t1}{t1 + u} \]
              14. lift-+.f64N/A

                \[\leadsto \frac{-v}{\color{blue}{t1 + u}} \cdot \frac{t1}{t1 + u} \]
              15. +-commutativeN/A

                \[\leadsto \frac{-v}{\color{blue}{u + t1}} \cdot \frac{t1}{t1 + u} \]
              16. lower-+.f64N/A

                \[\leadsto \frac{-v}{\color{blue}{u + t1}} \cdot \frac{t1}{t1 + u} \]
              17. lower-/.f6499.8

                \[\leadsto \frac{-v}{u + t1} \cdot \color{blue}{\frac{t1}{t1 + u}} \]
              18. lift-+.f64N/A

                \[\leadsto \frac{-v}{u + t1} \cdot \frac{t1}{\color{blue}{t1 + u}} \]
              19. +-commutativeN/A

                \[\leadsto \frac{-v}{u + t1} \cdot \frac{t1}{\color{blue}{u + t1}} \]
              20. lower-+.f6499.8

                \[\leadsto \frac{-v}{u + t1} \cdot \frac{t1}{\color{blue}{u + t1}} \]
            4. Applied rewrites99.8%

              \[\leadsto \color{blue}{\frac{-v}{u + t1} \cdot \frac{t1}{u + t1}} \]
            5. Step-by-step derivation
              1. lift-*.f64N/A

                \[\leadsto \color{blue}{\frac{-v}{u + t1} \cdot \frac{t1}{u + t1}} \]
              2. *-commutativeN/A

                \[\leadsto \color{blue}{\frac{t1}{u + t1} \cdot \frac{-v}{u + t1}} \]
              3. lift-/.f64N/A

                \[\leadsto \color{blue}{\frac{t1}{u + t1}} \cdot \frac{-v}{u + t1} \]
              4. clear-numN/A

                \[\leadsto \color{blue}{\frac{1}{\frac{u + t1}{t1}}} \cdot \frac{-v}{u + t1} \]
              5. lift-/.f64N/A

                \[\leadsto \frac{1}{\frac{u + t1}{t1}} \cdot \color{blue}{\frac{-v}{u + t1}} \]
              6. frac-timesN/A

                \[\leadsto \color{blue}{\frac{1 \cdot \left(-v\right)}{\frac{u + t1}{t1} \cdot \left(u + t1\right)}} \]
              7. *-lft-identityN/A

                \[\leadsto \frac{\color{blue}{-v}}{\frac{u + t1}{t1} \cdot \left(u + t1\right)} \]
              8. lower-/.f64N/A

                \[\leadsto \color{blue}{\frac{-v}{\frac{u + t1}{t1} \cdot \left(u + t1\right)}} \]
              9. lower-*.f64N/A

                \[\leadsto \frac{-v}{\color{blue}{\frac{u + t1}{t1} \cdot \left(u + t1\right)}} \]
              10. lower-/.f6494.4

                \[\leadsto \frac{-v}{\color{blue}{\frac{u + t1}{t1}} \cdot \left(u + t1\right)} \]
              11. lift-+.f64N/A

                \[\leadsto \frac{-v}{\frac{\color{blue}{u + t1}}{t1} \cdot \left(u + t1\right)} \]
              12. +-commutativeN/A

                \[\leadsto \frac{-v}{\frac{\color{blue}{t1 + u}}{t1} \cdot \left(u + t1\right)} \]
              13. lower-+.f6494.4

                \[\leadsto \frac{-v}{\frac{\color{blue}{t1 + u}}{t1} \cdot \left(u + t1\right)} \]
              14. lift-+.f64N/A

                \[\leadsto \frac{-v}{\frac{t1 + u}{t1} \cdot \color{blue}{\left(u + t1\right)}} \]
              15. +-commutativeN/A

                \[\leadsto \frac{-v}{\frac{t1 + u}{t1} \cdot \color{blue}{\left(t1 + u\right)}} \]
              16. lower-+.f6494.4

                \[\leadsto \frac{-v}{\frac{t1 + u}{t1} \cdot \color{blue}{\left(t1 + u\right)}} \]
            6. Applied rewrites94.4%

              \[\leadsto \color{blue}{\frac{-v}{\frac{t1 + u}{t1} \cdot \left(t1 + u\right)}} \]
            7. Taylor expanded in u around 0

              \[\leadsto \frac{-v}{\color{blue}{t1 + 2 \cdot u}} \]
            8. Step-by-step derivation
              1. +-commutativeN/A

                \[\leadsto \frac{-v}{\color{blue}{2 \cdot u + t1}} \]
              2. lower-fma.f6478.4

                \[\leadsto \frac{-v}{\color{blue}{\mathsf{fma}\left(2, u, t1\right)}} \]
            9. Applied rewrites78.4%

              \[\leadsto \frac{-v}{\color{blue}{\mathsf{fma}\left(2, u, t1\right)}} \]

            if -5.19999999999999968e-108 < t1 < 2.40000000000000007e-158

            1. Initial program 78.5%

              \[\frac{\left(-t1\right) \cdot v}{\left(t1 + u\right) \cdot \left(t1 + u\right)} \]
            2. Add Preprocessing
            3. Taylor expanded in u around inf

              \[\leadsto \color{blue}{-1 \cdot \frac{t1 \cdot v}{{u}^{2}}} \]
            4. Step-by-step derivation
              1. mul-1-negN/A

                \[\leadsto \color{blue}{\mathsf{neg}\left(\frac{t1 \cdot v}{{u}^{2}}\right)} \]
              2. distribute-neg-frac2N/A

                \[\leadsto \color{blue}{\frac{t1 \cdot v}{\mathsf{neg}\left({u}^{2}\right)}} \]
              3. mul-1-negN/A

                \[\leadsto \frac{t1 \cdot v}{\color{blue}{-1 \cdot {u}^{2}}} \]
              4. unpow2N/A

                \[\leadsto \frac{t1 \cdot v}{-1 \cdot \color{blue}{\left(u \cdot u\right)}} \]
              5. associate-*r*N/A

                \[\leadsto \frac{t1 \cdot v}{\color{blue}{\left(-1 \cdot u\right) \cdot u}} \]
              6. times-fracN/A

                \[\leadsto \color{blue}{\frac{t1}{-1 \cdot u} \cdot \frac{v}{u}} \]
              7. neg-mul-1N/A

                \[\leadsto \frac{t1}{\color{blue}{\mathsf{neg}\left(u\right)}} \cdot \frac{v}{u} \]
              8. lower-*.f64N/A

                \[\leadsto \color{blue}{\frac{t1}{\mathsf{neg}\left(u\right)} \cdot \frac{v}{u}} \]
              9. lower-/.f64N/A

                \[\leadsto \color{blue}{\frac{t1}{\mathsf{neg}\left(u\right)}} \cdot \frac{v}{u} \]
              10. lower-neg.f64N/A

                \[\leadsto \frac{t1}{\color{blue}{-u}} \cdot \frac{v}{u} \]
              11. lower-/.f6491.8

                \[\leadsto \frac{t1}{-u} \cdot \color{blue}{\frac{v}{u}} \]
            5. Applied rewrites91.8%

              \[\leadsto \color{blue}{\frac{t1}{-u} \cdot \frac{v}{u}} \]
            6. Step-by-step derivation
              1. Applied rewrites83.6%

                \[\leadsto t1 \cdot \color{blue}{\frac{v}{\left(-u\right) \cdot u}} \]
            7. Recombined 2 regimes into one program.
            8. Final simplification79.8%

              \[\leadsto \begin{array}{l} \mathbf{if}\;t1 \leq -5.2 \cdot 10^{-108} \lor \neg \left(t1 \leq 2.4 \cdot 10^{-158}\right):\\ \;\;\;\;\frac{-v}{\mathsf{fma}\left(2, u, t1\right)}\\ \mathbf{else}:\\ \;\;\;\;t1 \cdot \frac{v}{\left(-u\right) \cdot u}\\ \end{array} \]
            9. Add Preprocessing

            Alternative 7: 62.0% accurate, 1.5× speedup?

            \[\begin{array}{l} \\ \frac{-v}{\mathsf{fma}\left(2, u, t1\right)} \end{array} \]
            (FPCore (u v t1) :precision binary64 (/ (- v) (fma 2.0 u t1)))
            double code(double u, double v, double t1) {
            	return -v / fma(2.0, u, t1);
            }
            
            function code(u, v, t1)
            	return Float64(Float64(-v) / fma(2.0, u, t1))
            end
            
            code[u_, v_, t1_] := N[((-v) / N[(2.0 * u + t1), $MachinePrecision]), $MachinePrecision]
            
            \begin{array}{l}
            
            \\
            \frac{-v}{\mathsf{fma}\left(2, u, t1\right)}
            \end{array}
            
            Derivation
            1. Initial program 69.9%

              \[\frac{\left(-t1\right) \cdot v}{\left(t1 + u\right) \cdot \left(t1 + u\right)} \]
            2. Add Preprocessing
            3. Step-by-step derivation
              1. lift-/.f64N/A

                \[\leadsto \color{blue}{\frac{\left(-t1\right) \cdot v}{\left(t1 + u\right) \cdot \left(t1 + u\right)}} \]
              2. lift-*.f64N/A

                \[\leadsto \frac{\color{blue}{\left(-t1\right) \cdot v}}{\left(t1 + u\right) \cdot \left(t1 + u\right)} \]
              3. *-commutativeN/A

                \[\leadsto \frac{\color{blue}{v \cdot \left(-t1\right)}}{\left(t1 + u\right) \cdot \left(t1 + u\right)} \]
              4. lift-neg.f64N/A

                \[\leadsto \frac{v \cdot \color{blue}{\left(\mathsf{neg}\left(t1\right)\right)}}{\left(t1 + u\right) \cdot \left(t1 + u\right)} \]
              5. neg-mul-1N/A

                \[\leadsto \frac{v \cdot \color{blue}{\left(-1 \cdot t1\right)}}{\left(t1 + u\right) \cdot \left(t1 + u\right)} \]
              6. associate-*r*N/A

                \[\leadsto \frac{\color{blue}{\left(v \cdot -1\right) \cdot t1}}{\left(t1 + u\right) \cdot \left(t1 + u\right)} \]
              7. lift-*.f64N/A

                \[\leadsto \frac{\left(v \cdot -1\right) \cdot t1}{\color{blue}{\left(t1 + u\right) \cdot \left(t1 + u\right)}} \]
              8. times-fracN/A

                \[\leadsto \color{blue}{\frac{v \cdot -1}{t1 + u} \cdot \frac{t1}{t1 + u}} \]
              9. *-commutativeN/A

                \[\leadsto \frac{\color{blue}{-1 \cdot v}}{t1 + u} \cdot \frac{t1}{t1 + u} \]
              10. neg-mul-1N/A

                \[\leadsto \frac{\color{blue}{\mathsf{neg}\left(v\right)}}{t1 + u} \cdot \frac{t1}{t1 + u} \]
              11. lower-*.f64N/A

                \[\leadsto \color{blue}{\frac{\mathsf{neg}\left(v\right)}{t1 + u} \cdot \frac{t1}{t1 + u}} \]
              12. lower-/.f64N/A

                \[\leadsto \color{blue}{\frac{\mathsf{neg}\left(v\right)}{t1 + u}} \cdot \frac{t1}{t1 + u} \]
              13. lower-neg.f64N/A

                \[\leadsto \frac{\color{blue}{-v}}{t1 + u} \cdot \frac{t1}{t1 + u} \]
              14. lift-+.f64N/A

                \[\leadsto \frac{-v}{\color{blue}{t1 + u}} \cdot \frac{t1}{t1 + u} \]
              15. +-commutativeN/A

                \[\leadsto \frac{-v}{\color{blue}{u + t1}} \cdot \frac{t1}{t1 + u} \]
              16. lower-+.f64N/A

                \[\leadsto \frac{-v}{\color{blue}{u + t1}} \cdot \frac{t1}{t1 + u} \]
              17. lower-/.f6499.4

                \[\leadsto \frac{-v}{u + t1} \cdot \color{blue}{\frac{t1}{t1 + u}} \]
              18. lift-+.f64N/A

                \[\leadsto \frac{-v}{u + t1} \cdot \frac{t1}{\color{blue}{t1 + u}} \]
              19. +-commutativeN/A

                \[\leadsto \frac{-v}{u + t1} \cdot \frac{t1}{\color{blue}{u + t1}} \]
              20. lower-+.f6499.4

                \[\leadsto \frac{-v}{u + t1} \cdot \frac{t1}{\color{blue}{u + t1}} \]
            4. Applied rewrites99.4%

              \[\leadsto \color{blue}{\frac{-v}{u + t1} \cdot \frac{t1}{u + t1}} \]
            5. Step-by-step derivation
              1. lift-*.f64N/A

                \[\leadsto \color{blue}{\frac{-v}{u + t1} \cdot \frac{t1}{u + t1}} \]
              2. *-commutativeN/A

                \[\leadsto \color{blue}{\frac{t1}{u + t1} \cdot \frac{-v}{u + t1}} \]
              3. lift-/.f64N/A

                \[\leadsto \color{blue}{\frac{t1}{u + t1}} \cdot \frac{-v}{u + t1} \]
              4. clear-numN/A

                \[\leadsto \color{blue}{\frac{1}{\frac{u + t1}{t1}}} \cdot \frac{-v}{u + t1} \]
              5. lift-/.f64N/A

                \[\leadsto \frac{1}{\frac{u + t1}{t1}} \cdot \color{blue}{\frac{-v}{u + t1}} \]
              6. frac-timesN/A

                \[\leadsto \color{blue}{\frac{1 \cdot \left(-v\right)}{\frac{u + t1}{t1} \cdot \left(u + t1\right)}} \]
              7. *-lft-identityN/A

                \[\leadsto \frac{\color{blue}{-v}}{\frac{u + t1}{t1} \cdot \left(u + t1\right)} \]
              8. lower-/.f64N/A

                \[\leadsto \color{blue}{\frac{-v}{\frac{u + t1}{t1} \cdot \left(u + t1\right)}} \]
              9. lower-*.f64N/A

                \[\leadsto \frac{-v}{\color{blue}{\frac{u + t1}{t1} \cdot \left(u + t1\right)}} \]
              10. lower-/.f6494.4

                \[\leadsto \frac{-v}{\color{blue}{\frac{u + t1}{t1}} \cdot \left(u + t1\right)} \]
              11. lift-+.f64N/A

                \[\leadsto \frac{-v}{\frac{\color{blue}{u + t1}}{t1} \cdot \left(u + t1\right)} \]
              12. +-commutativeN/A

                \[\leadsto \frac{-v}{\frac{\color{blue}{t1 + u}}{t1} \cdot \left(u + t1\right)} \]
              13. lower-+.f6494.4

                \[\leadsto \frac{-v}{\frac{\color{blue}{t1 + u}}{t1} \cdot \left(u + t1\right)} \]
              14. lift-+.f64N/A

                \[\leadsto \frac{-v}{\frac{t1 + u}{t1} \cdot \color{blue}{\left(u + t1\right)}} \]
              15. +-commutativeN/A

                \[\leadsto \frac{-v}{\frac{t1 + u}{t1} \cdot \color{blue}{\left(t1 + u\right)}} \]
              16. lower-+.f6494.4

                \[\leadsto \frac{-v}{\frac{t1 + u}{t1} \cdot \color{blue}{\left(t1 + u\right)}} \]
            6. Applied rewrites94.4%

              \[\leadsto \color{blue}{\frac{-v}{\frac{t1 + u}{t1} \cdot \left(t1 + u\right)}} \]
            7. Taylor expanded in u around 0

              \[\leadsto \frac{-v}{\color{blue}{t1 + 2 \cdot u}} \]
            8. Step-by-step derivation
              1. +-commutativeN/A

                \[\leadsto \frac{-v}{\color{blue}{2 \cdot u + t1}} \]
              2. lower-fma.f6464.4

                \[\leadsto \frac{-v}{\color{blue}{\mathsf{fma}\left(2, u, t1\right)}} \]
            9. Applied rewrites64.4%

              \[\leadsto \frac{-v}{\color{blue}{\mathsf{fma}\left(2, u, t1\right)}} \]
            10. Add Preprocessing

            Alternative 8: 61.5% accurate, 1.8× speedup?

            \[\begin{array}{l} \\ \frac{-v}{u + t1} \end{array} \]
            (FPCore (u v t1) :precision binary64 (/ (- v) (+ u t1)))
            double code(double u, double v, double t1) {
            	return -v / (u + t1);
            }
            
            real(8) function code(u, v, t1)
                real(8), intent (in) :: u
                real(8), intent (in) :: v
                real(8), intent (in) :: t1
                code = -v / (u + t1)
            end function
            
            public static double code(double u, double v, double t1) {
            	return -v / (u + t1);
            }
            
            def code(u, v, t1):
            	return -v / (u + t1)
            
            function code(u, v, t1)
            	return Float64(Float64(-v) / Float64(u + t1))
            end
            
            function tmp = code(u, v, t1)
            	tmp = -v / (u + t1);
            end
            
            code[u_, v_, t1_] := N[((-v) / N[(u + t1), $MachinePrecision]), $MachinePrecision]
            
            \begin{array}{l}
            
            \\
            \frac{-v}{u + t1}
            \end{array}
            
            Derivation
            1. Initial program 69.9%

              \[\frac{\left(-t1\right) \cdot v}{\left(t1 + u\right) \cdot \left(t1 + u\right)} \]
            2. Add Preprocessing
            3. Step-by-step derivation
              1. lift-/.f64N/A

                \[\leadsto \color{blue}{\frac{\left(-t1\right) \cdot v}{\left(t1 + u\right) \cdot \left(t1 + u\right)}} \]
              2. lift-*.f64N/A

                \[\leadsto \frac{\left(-t1\right) \cdot v}{\color{blue}{\left(t1 + u\right) \cdot \left(t1 + u\right)}} \]
              3. associate-/r*N/A

                \[\leadsto \color{blue}{\frac{\frac{\left(-t1\right) \cdot v}{t1 + u}}{t1 + u}} \]
              4. lower-/.f64N/A

                \[\leadsto \color{blue}{\frac{\frac{\left(-t1\right) \cdot v}{t1 + u}}{t1 + u}} \]
              5. frac-2negN/A

                \[\leadsto \frac{\color{blue}{\frac{\mathsf{neg}\left(\left(-t1\right) \cdot v\right)}{\mathsf{neg}\left(\left(t1 + u\right)\right)}}}{t1 + u} \]
              6. lift-*.f64N/A

                \[\leadsto \frac{\frac{\mathsf{neg}\left(\color{blue}{\left(-t1\right) \cdot v}\right)}{\mathsf{neg}\left(\left(t1 + u\right)\right)}}{t1 + u} \]
              7. *-commutativeN/A

                \[\leadsto \frac{\frac{\mathsf{neg}\left(\color{blue}{v \cdot \left(-t1\right)}\right)}{\mathsf{neg}\left(\left(t1 + u\right)\right)}}{t1 + u} \]
              8. distribute-lft-neg-inN/A

                \[\leadsto \frac{\frac{\color{blue}{\left(\mathsf{neg}\left(v\right)\right) \cdot \left(-t1\right)}}{\mathsf{neg}\left(\left(t1 + u\right)\right)}}{t1 + u} \]
              9. associate-/l*N/A

                \[\leadsto \frac{\color{blue}{\left(\mathsf{neg}\left(v\right)\right) \cdot \frac{-t1}{\mathsf{neg}\left(\left(t1 + u\right)\right)}}}{t1 + u} \]
              10. lift-neg.f64N/A

                \[\leadsto \frac{\left(\mathsf{neg}\left(v\right)\right) \cdot \frac{\color{blue}{\mathsf{neg}\left(t1\right)}}{\mathsf{neg}\left(\left(t1 + u\right)\right)}}{t1 + u} \]
              11. frac-2negN/A

                \[\leadsto \frac{\left(\mathsf{neg}\left(v\right)\right) \cdot \color{blue}{\frac{t1}{t1 + u}}}{t1 + u} \]
              12. lower-*.f64N/A

                \[\leadsto \frac{\color{blue}{\left(\mathsf{neg}\left(v\right)\right) \cdot \frac{t1}{t1 + u}}}{t1 + u} \]
              13. lower-neg.f64N/A

                \[\leadsto \frac{\color{blue}{\left(-v\right)} \cdot \frac{t1}{t1 + u}}{t1 + u} \]
              14. lower-/.f6498.2

                \[\leadsto \frac{\left(-v\right) \cdot \color{blue}{\frac{t1}{t1 + u}}}{t1 + u} \]
              15. lift-+.f64N/A

                \[\leadsto \frac{\left(-v\right) \cdot \frac{t1}{\color{blue}{t1 + u}}}{t1 + u} \]
              16. +-commutativeN/A

                \[\leadsto \frac{\left(-v\right) \cdot \frac{t1}{\color{blue}{u + t1}}}{t1 + u} \]
              17. lower-+.f6498.2

                \[\leadsto \frac{\left(-v\right) \cdot \frac{t1}{\color{blue}{u + t1}}}{t1 + u} \]
              18. lift-+.f64N/A

                \[\leadsto \frac{\left(-v\right) \cdot \frac{t1}{u + t1}}{\color{blue}{t1 + u}} \]
              19. +-commutativeN/A

                \[\leadsto \frac{\left(-v\right) \cdot \frac{t1}{u + t1}}{\color{blue}{u + t1}} \]
              20. lower-+.f6498.2

                \[\leadsto \frac{\left(-v\right) \cdot \frac{t1}{u + t1}}{\color{blue}{u + t1}} \]
            4. Applied rewrites98.2%

              \[\leadsto \color{blue}{\frac{\left(-v\right) \cdot \frac{t1}{u + t1}}{u + t1}} \]
            5. Taylor expanded in u around 0

              \[\leadsto \frac{\color{blue}{-1 \cdot v}}{u + t1} \]
            6. Step-by-step derivation
              1. mul-1-negN/A

                \[\leadsto \frac{\color{blue}{\mathsf{neg}\left(v\right)}}{u + t1} \]
              2. lower-neg.f6463.5

                \[\leadsto \frac{\color{blue}{-v}}{u + t1} \]
            7. Applied rewrites63.5%

              \[\leadsto \frac{\color{blue}{-v}}{u + t1} \]
            8. Add Preprocessing

            Alternative 9: 54.1% accurate, 2.1× speedup?

            \[\begin{array}{l} \\ \frac{-v}{t1} \end{array} \]
            (FPCore (u v t1) :precision binary64 (/ (- v) t1))
            double code(double u, double v, double t1) {
            	return -v / t1;
            }
            
            real(8) function code(u, v, t1)
                real(8), intent (in) :: u
                real(8), intent (in) :: v
                real(8), intent (in) :: t1
                code = -v / t1
            end function
            
            public static double code(double u, double v, double t1) {
            	return -v / t1;
            }
            
            def code(u, v, t1):
            	return -v / t1
            
            function code(u, v, t1)
            	return Float64(Float64(-v) / t1)
            end
            
            function tmp = code(u, v, t1)
            	tmp = -v / t1;
            end
            
            code[u_, v_, t1_] := N[((-v) / t1), $MachinePrecision]
            
            \begin{array}{l}
            
            \\
            \frac{-v}{t1}
            \end{array}
            
            Derivation
            1. Initial program 69.9%

              \[\frac{\left(-t1\right) \cdot v}{\left(t1 + u\right) \cdot \left(t1 + u\right)} \]
            2. Add Preprocessing
            3. Taylor expanded in u around 0

              \[\leadsto \color{blue}{-1 \cdot \frac{v}{t1}} \]
            4. Step-by-step derivation
              1. associate-*r/N/A

                \[\leadsto \color{blue}{\frac{-1 \cdot v}{t1}} \]
              2. lower-/.f64N/A

                \[\leadsto \color{blue}{\frac{-1 \cdot v}{t1}} \]
              3. mul-1-negN/A

                \[\leadsto \frac{\color{blue}{\mathsf{neg}\left(v\right)}}{t1} \]
              4. lower-neg.f6459.0

                \[\leadsto \frac{\color{blue}{-v}}{t1} \]
            5. Applied rewrites59.0%

              \[\leadsto \color{blue}{\frac{-v}{t1}} \]
            6. Add Preprocessing

            Reproduce

            ?
            herbie shell --seed 2024318 
            (FPCore (u v t1)
              :name "Rosa's DopplerBench"
              :precision binary64
              (/ (* (- t1) v) (* (+ t1 u) (+ t1 u))))