Rosa's DopplerBench

Percentage Accurate: 72.4% → 98.0%
Time: 8.2s
Alternatives: 12
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 12 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: 72.4% 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: 98.0% accurate, 0.8× speedup?

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

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

    \[\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-*.f64N/A

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \frac{\frac{v}{\color{blue}{u + t1}} \cdot t1}{\mathsf{neg}\left(\left(t1 + u\right)\right)} \]
    16. lower-neg.f6497.9

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

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

      \[\leadsto \frac{\frac{v}{u + t1} \cdot t1}{-\color{blue}{\left(u + t1\right)}} \]
    19. lower-+.f6497.9

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

    \[\leadsto \color{blue}{\frac{\frac{v}{u + t1} \cdot t1}{-\left(u + t1\right)}} \]
  5. Final simplification97.9%

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

Alternative 2: 87.2% accurate, 0.2× 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}{t1}\\ \mathbf{if}\;t\_1 \leq -\infty:\\ \;\;\;\;t\_2\\ \mathbf{elif}\;t\_1 \leq -5 \cdot 10^{-310}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;t\_1 \leq 0:\\ \;\;\;\;\frac{\frac{v}{t1 + u} \cdot t1}{-u}\\ \mathbf{elif}\;t\_1 \leq 4 \cdot 10^{+226}:\\ \;\;\;\;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) t1)))
   (if (<= t_1 (- INFINITY))
     t_2
     (if (<= t_1 -5e-310)
       t_1
       (if (<= t_1 0.0)
         (/ (* (/ v (+ t1 u)) t1) (- u))
         (if (<= t_1 4e+226) 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 / t1;
	double tmp;
	if (t_1 <= -((double) INFINITY)) {
		tmp = t_2;
	} else if (t_1 <= -5e-310) {
		tmp = t_1;
	} else if (t_1 <= 0.0) {
		tmp = ((v / (t1 + u)) * t1) / -u;
	} else if (t_1 <= 4e+226) {
		tmp = t_1;
	} else {
		tmp = t_2;
	}
	return tmp;
}
public static double code(double u, double v, double t1) {
	double t_1 = (-t1 * v) / ((t1 + u) * (t1 + u));
	double t_2 = -v / t1;
	double tmp;
	if (t_1 <= -Double.POSITIVE_INFINITY) {
		tmp = t_2;
	} else if (t_1 <= -5e-310) {
		tmp = t_1;
	} else if (t_1 <= 0.0) {
		tmp = ((v / (t1 + u)) * t1) / -u;
	} else if (t_1 <= 4e+226) {
		tmp = t_1;
	} else {
		tmp = t_2;
	}
	return tmp;
}
def code(u, v, t1):
	t_1 = (-t1 * v) / ((t1 + u) * (t1 + u))
	t_2 = -v / t1
	tmp = 0
	if t_1 <= -math.inf:
		tmp = t_2
	elif t_1 <= -5e-310:
		tmp = t_1
	elif t_1 <= 0.0:
		tmp = ((v / (t1 + u)) * t1) / -u
	elif t_1 <= 4e+226:
		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) / t1)
	tmp = 0.0
	if (t_1 <= Float64(-Inf))
		tmp = t_2;
	elseif (t_1 <= -5e-310)
		tmp = t_1;
	elseif (t_1 <= 0.0)
		tmp = Float64(Float64(Float64(v / Float64(t1 + u)) * t1) / Float64(-u));
	elseif (t_1 <= 4e+226)
		tmp = t_1;
	else
		tmp = t_2;
	end
	return tmp
end
function tmp_2 = code(u, v, t1)
	t_1 = (-t1 * v) / ((t1 + u) * (t1 + u));
	t_2 = -v / t1;
	tmp = 0.0;
	if (t_1 <= -Inf)
		tmp = t_2;
	elseif (t_1 <= -5e-310)
		tmp = t_1;
	elseif (t_1 <= 0.0)
		tmp = ((v / (t1 + u)) * t1) / -u;
	elseif (t_1 <= 4e+226)
		tmp = t_1;
	else
		tmp = t_2;
	end
	tmp_2 = 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) / t1), $MachinePrecision]}, If[LessEqual[t$95$1, (-Infinity)], t$95$2, If[LessEqual[t$95$1, -5e-310], t$95$1, If[LessEqual[t$95$1, 0.0], N[(N[(N[(v / N[(t1 + u), $MachinePrecision]), $MachinePrecision] * t1), $MachinePrecision] / (-u)), $MachinePrecision], If[LessEqual[t$95$1, 4e+226], 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}{t1}\\
\mathbf{if}\;t\_1 \leq -\infty:\\
\;\;\;\;t\_2\\

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

\mathbf{elif}\;t\_1 \leq 0:\\
\;\;\;\;\frac{\frac{v}{t1 + u} \cdot t1}{-u}\\

\mathbf{elif}\;t\_1 \leq 4 \cdot 10^{+226}:\\
\;\;\;\;t\_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if (/.f64 (*.f64 (neg.f64 t1) v) (*.f64 (+.f64 t1 u) (+.f64 t1 u))) < -inf.0 or 3.99999999999999985e226 < (/.f64 (*.f64 (neg.f64 t1) v) (*.f64 (+.f64 t1 u) (+.f64 t1 u)))

    1. Initial program 22.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 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.f6486.3

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

      \[\leadsto \color{blue}{\frac{-v}{t1}} \]

    if -inf.0 < (/.f64 (*.f64 (neg.f64 t1) v) (*.f64 (+.f64 t1 u) (+.f64 t1 u))) < -4.999999999999985e-310 or -0.0 < (/.f64 (*.f64 (neg.f64 t1) v) (*.f64 (+.f64 t1 u) (+.f64 t1 u))) < 3.99999999999999985e226

    1. Initial program 99.3%

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

    if -4.999999999999985e-310 < (/.f64 (*.f64 (neg.f64 t1) v) (*.f64 (+.f64 t1 u) (+.f64 t1 u))) < -0.0

    1. Initial program 81.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-*.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{\frac{v}{u + t1} \cdot t1}{\color{blue}{-u}} \]
    7. Applied rewrites88.6%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;\frac{\left(-t1\right) \cdot v}{\left(t1 + u\right) \cdot \left(t1 + u\right)} \leq -\infty:\\ \;\;\;\;\frac{-v}{t1}\\ \mathbf{elif}\;\frac{\left(-t1\right) \cdot v}{\left(t1 + u\right) \cdot \left(t1 + u\right)} \leq -5 \cdot 10^{-310}:\\ \;\;\;\;\frac{\left(-t1\right) \cdot v}{\left(t1 + u\right) \cdot \left(t1 + u\right)}\\ \mathbf{elif}\;\frac{\left(-t1\right) \cdot v}{\left(t1 + u\right) \cdot \left(t1 + u\right)} \leq 0:\\ \;\;\;\;\frac{\frac{v}{t1 + u} \cdot t1}{-u}\\ \mathbf{elif}\;\frac{\left(-t1\right) \cdot v}{\left(t1 + u\right) \cdot \left(t1 + u\right)} \leq 4 \cdot 10^{+226}:\\ \;\;\;\;\frac{\left(-t1\right) \cdot v}{\left(t1 + u\right) \cdot \left(t1 + u\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{-v}{t1}\\ \end{array} \]
  5. Add Preprocessing

Alternative 3: 84.0% accurate, 0.3× 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}{t1}\\ \mathbf{if}\;t\_1 \leq -\infty:\\ \;\;\;\;t\_2\\ \mathbf{elif}\;t\_1 \leq 4 \cdot 10^{+226}:\\ \;\;\;\;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) t1)))
   (if (<= t_1 (- INFINITY)) t_2 (if (<= t_1 4e+226) 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 / t1;
	double tmp;
	if (t_1 <= -((double) INFINITY)) {
		tmp = t_2;
	} else if (t_1 <= 4e+226) {
		tmp = t_1;
	} else {
		tmp = t_2;
	}
	return tmp;
}
public static double code(double u, double v, double t1) {
	double t_1 = (-t1 * v) / ((t1 + u) * (t1 + u));
	double t_2 = -v / t1;
	double tmp;
	if (t_1 <= -Double.POSITIVE_INFINITY) {
		tmp = t_2;
	} else if (t_1 <= 4e+226) {
		tmp = t_1;
	} else {
		tmp = t_2;
	}
	return tmp;
}
def code(u, v, t1):
	t_1 = (-t1 * v) / ((t1 + u) * (t1 + u))
	t_2 = -v / t1
	tmp = 0
	if t_1 <= -math.inf:
		tmp = t_2
	elif t_1 <= 4e+226:
		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) / t1)
	tmp = 0.0
	if (t_1 <= Float64(-Inf))
		tmp = t_2;
	elseif (t_1 <= 4e+226)
		tmp = t_1;
	else
		tmp = t_2;
	end
	return tmp
end
function tmp_2 = code(u, v, t1)
	t_1 = (-t1 * v) / ((t1 + u) * (t1 + u));
	t_2 = -v / t1;
	tmp = 0.0;
	if (t_1 <= -Inf)
		tmp = t_2;
	elseif (t_1 <= 4e+226)
		tmp = t_1;
	else
		tmp = t_2;
	end
	tmp_2 = 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) / t1), $MachinePrecision]}, If[LessEqual[t$95$1, (-Infinity)], t$95$2, If[LessEqual[t$95$1, 4e+226], 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}{t1}\\
\mathbf{if}\;t\_1 \leq -\infty:\\
\;\;\;\;t\_2\\

\mathbf{elif}\;t\_1 \leq 4 \cdot 10^{+226}:\\
\;\;\;\;t\_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (/.f64 (*.f64 (neg.f64 t1) v) (*.f64 (+.f64 t1 u) (+.f64 t1 u))) < -inf.0 or 3.99999999999999985e226 < (/.f64 (*.f64 (neg.f64 t1) v) (*.f64 (+.f64 t1 u) (+.f64 t1 u)))

    1. Initial program 22.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 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.f6486.3

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

      \[\leadsto \color{blue}{\frac{-v}{t1}} \]

    if -inf.0 < (/.f64 (*.f64 (neg.f64 t1) v) (*.f64 (+.f64 t1 u) (+.f64 t1 u))) < 3.99999999999999985e226

    1. Initial program 89.7%

      \[\frac{\left(-t1\right) \cdot v}{\left(t1 + u\right) \cdot \left(t1 + u\right)} \]
    2. Add Preprocessing
  3. Recombined 2 regimes into one program.
  4. Add Preprocessing

Alternative 4: 78.1% accurate, 0.7× speedup?

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

\\
\begin{array}{l}
t_1 := \frac{-v}{\mathsf{fma}\left(u, 2, t1\right)}\\
\mathbf{if}\;t1 \leq -1.65 \cdot 10^{-52}:\\
\;\;\;\;t\_1\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t1 < -1.64999999999999998e-52 or 4.5000000000000003e-119 < t1

    1. Initial program 72.1%

      \[\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-*.f64N/A

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{\frac{v}{\color{blue}{u + t1}} \cdot t1}{\mathsf{neg}\left(\left(t1 + u\right)\right)} \]
      16. lower-neg.f6499.9

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

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

        \[\leadsto \frac{\frac{v}{u + t1} \cdot t1}{-\color{blue}{\left(u + t1\right)}} \]
      19. lower-+.f6499.9

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\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. *-commutativeN/A

        \[\leadsto \frac{-v}{\color{blue}{u \cdot 2} + t1} \]
      3. lower-fma.f6484.0

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

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

    if -1.64999999999999998e-52 < t1 < 4.5000000000000003e-119

    1. Initial program 82.4%

      \[\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-*.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto -1 \cdot \frac{\color{blue}{v \cdot t1}}{{u}^{2}} \]
      2. associate-*l/N/A

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{\frac{-1 \cdot v}{u}}{u}} \cdot t1 \]
      8. associate-*r/N/A

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

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

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

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

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

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

        \[\leadsto \frac{\frac{v}{\color{blue}{\mathsf{neg}\left(u\right)}}}{u} \cdot t1 \]
      15. lower-neg.f6479.3

        \[\leadsto \frac{\frac{v}{\color{blue}{-u}}}{u} \cdot t1 \]
    7. Applied rewrites79.3%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t1 \leq -1.65 \cdot 10^{-52}:\\ \;\;\;\;\frac{-v}{\mathsf{fma}\left(u, 2, t1\right)}\\ \mathbf{elif}\;t1 \leq 4.5 \cdot 10^{-119}:\\ \;\;\;\;\frac{\frac{-v}{u}}{u} \cdot t1\\ \mathbf{else}:\\ \;\;\;\;\frac{-v}{\mathsf{fma}\left(u, 2, t1\right)}\\ \end{array} \]
  5. Add Preprocessing

Alternative 5: 79.0% accurate, 0.7× speedup?

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

\\
\begin{array}{l}
t_1 := \frac{-v}{\mathsf{fma}\left(u, 2, t1\right)}\\
\mathbf{if}\;t1 \leq -1.65 \cdot 10^{-52}:\\
\;\;\;\;t\_1\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t1 < -1.64999999999999998e-52 or 4.5000000000000003e-119 < t1

    1. Initial program 72.1%

      \[\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-*.f64N/A

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{\frac{v}{\color{blue}{u + t1}} \cdot t1}{\mathsf{neg}\left(\left(t1 + u\right)\right)} \]
      16. lower-neg.f6499.9

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

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

        \[\leadsto \frac{\frac{v}{u + t1} \cdot t1}{-\color{blue}{\left(u + t1\right)}} \]
      19. lower-+.f6499.9

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\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. *-commutativeN/A

        \[\leadsto \frac{-v}{\color{blue}{u \cdot 2} + t1} \]
      3. lower-fma.f6484.0

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

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

    if -1.64999999999999998e-52 < t1 < 4.5000000000000003e-119

    1. Initial program 82.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-/.f6477.9

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t1 \leq -1.65 \cdot 10^{-52}:\\ \;\;\;\;\frac{-v}{\mathsf{fma}\left(u, 2, t1\right)}\\ \mathbf{elif}\;t1 \leq 4.5 \cdot 10^{-119}:\\ \;\;\;\;\frac{t1}{u} \cdot \frac{-v}{u}\\ \mathbf{else}:\\ \;\;\;\;\frac{-v}{\mathsf{fma}\left(u, 2, t1\right)}\\ \end{array} \]
  5. Add Preprocessing

Alternative 6: 94.5% accurate, 0.7× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;u \leq 1.1 \cdot 10^{+65}:\\
\;\;\;\;\frac{-v}{\mathsf{fma}\left(2 + \frac{u}{t1}, u, t1\right)}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if u < 1.0999999999999999e65

    1. Initial program 75.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-*.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{-v}{\color{blue}{\frac{u + t1}{t1} \cdot \left(u + t1\right)}} \]
    6. Applied rewrites97.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-/.f6497.6

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

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

    if 1.0999999999999999e65 < u

    1. Initial program 76.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-*.f64N/A

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{\frac{v}{\color{blue}{u + t1}} \cdot t1}{\mathsf{neg}\left(\left(t1 + u\right)\right)} \]
      16. lower-neg.f6499.9

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

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

        \[\leadsto \frac{\frac{v}{u + t1} \cdot t1}{-\color{blue}{\left(u + t1\right)}} \]
      19. lower-+.f6499.9

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

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

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

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

        \[\leadsto \frac{\frac{v}{u + t1} \cdot t1}{\color{blue}{-u}} \]
    7. Applied rewrites92.3%

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

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

Alternative 7: 76.5% accurate, 0.8× speedup?

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

\\
\begin{array}{l}
t_1 := \frac{-v}{\mathsf{fma}\left(u, 2, t1\right)}\\
\mathbf{if}\;t1 \leq -1.65 \cdot 10^{-52}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;t1 \leq 1.6 \cdot 10^{-119}:\\
\;\;\;\;\frac{\left(-t1\right) \cdot v}{u \cdot u}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t1 < -1.64999999999999998e-52 or 1.59999999999999997e-119 < t1

    1. Initial program 72.1%

      \[\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-*.f64N/A

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{\frac{v}{\color{blue}{u + t1}} \cdot t1}{\mathsf{neg}\left(\left(t1 + u\right)\right)} \]
      16. lower-neg.f6499.9

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

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

        \[\leadsto \frac{\frac{v}{u + t1} \cdot t1}{-\color{blue}{\left(u + t1\right)}} \]
      19. lower-+.f6499.9

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\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. *-commutativeN/A

        \[\leadsto \frac{-v}{\color{blue}{u \cdot 2} + t1} \]
      3. lower-fma.f6484.0

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

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

    if -1.64999999999999998e-52 < t1 < 1.59999999999999997e-119

    1. Initial program 82.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 \frac{\left(-t1\right) \cdot v}{\color{blue}{{u}^{2}}} \]
    4. Step-by-step derivation
      1. unpow2N/A

        \[\leadsto \frac{\left(-t1\right) \cdot v}{\color{blue}{u \cdot u}} \]
      2. lower-*.f6476.4

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

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

Alternative 8: 76.8% accurate, 0.8× speedup?

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

\\
\begin{array}{l}
t_1 := \frac{-v}{\mathsf{fma}\left(u, 2, t1\right)}\\
\mathbf{if}\;t1 \leq -1.65 \cdot 10^{-52}:\\
\;\;\;\;t\_1\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t1 < -1.64999999999999998e-52 or 4.5000000000000003e-119 < t1

    1. Initial program 72.1%

      \[\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-*.f64N/A

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{\frac{v}{\color{blue}{u + t1}} \cdot t1}{\mathsf{neg}\left(\left(t1 + u\right)\right)} \]
      16. lower-neg.f6499.9

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

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

        \[\leadsto \frac{\frac{v}{u + t1} \cdot t1}{-\color{blue}{\left(u + t1\right)}} \]
      19. lower-+.f6499.9

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\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. *-commutativeN/A

        \[\leadsto \frac{-v}{\color{blue}{u \cdot 2} + t1} \]
      3. lower-fma.f6484.0

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

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

    if -1.64999999999999998e-52 < t1 < 4.5000000000000003e-119

    1. Initial program 82.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 \frac{\left(-t1\right) \cdot v}{\color{blue}{{u}^{2}}} \]
    4. Step-by-step derivation
      1. unpow2N/A

        \[\leadsto \frac{\left(-t1\right) \cdot v}{\color{blue}{u \cdot u}} \]
      2. lower-*.f6476.4

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

      \[\leadsto \frac{\left(-t1\right) \cdot v}{\color{blue}{u \cdot u}} \]
    6. Step-by-step derivation
      1. lift-/.f64N/A

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t1 \leq -1.65 \cdot 10^{-52}:\\ \;\;\;\;\frac{-v}{\mathsf{fma}\left(u, 2, t1\right)}\\ \mathbf{elif}\;t1 \leq 4.5 \cdot 10^{-119}:\\ \;\;\;\;\frac{-v}{u \cdot u} \cdot t1\\ \mathbf{else}:\\ \;\;\;\;\frac{-v}{\mathsf{fma}\left(u, 2, t1\right)}\\ \end{array} \]
  5. Add Preprocessing

Alternative 9: 76.5% accurate, 0.8× speedup?

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

\\
\begin{array}{l}
t_1 := \frac{-v}{\mathsf{fma}\left(u, 2, t1\right)}\\
\mathbf{if}\;t1 \leq -1.65 \cdot 10^{-52}:\\
\;\;\;\;t\_1\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t1 < -1.64999999999999998e-52 or 3.79999999999999975e-119 < t1

    1. Initial program 72.1%

      \[\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-*.f64N/A

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{\frac{v}{\color{blue}{u + t1}} \cdot t1}{\mathsf{neg}\left(\left(t1 + u\right)\right)} \]
      16. lower-neg.f6499.9

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

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

        \[\leadsto \frac{\frac{v}{u + t1} \cdot t1}{-\color{blue}{\left(u + t1\right)}} \]
      19. lower-+.f6499.9

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\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. *-commutativeN/A

        \[\leadsto \frac{-v}{\color{blue}{u \cdot 2} + t1} \]
      3. lower-fma.f6484.0

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

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

    if -1.64999999999999998e-52 < t1 < 3.79999999999999975e-119

    1. Initial program 82.4%

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

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

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

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

        \[\leadsto \frac{\left(-t1\right) \cdot v}{u \cdot u + \color{blue}{\left(2 \cdot t1\right) \cdot u}} \]
      4. distribute-rgt-inN/A

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

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

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

        \[\leadsto \frac{\left(-t1\right) \cdot v}{\color{blue}{\left(2 \cdot t1 + u\right)} \cdot u} \]
      8. lower-fma.f6475.4

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

      \[\leadsto \frac{\left(-t1\right) \cdot v}{\color{blue}{\mathsf{fma}\left(2, t1, u\right) \cdot u}} \]
    6. Step-by-step derivation
      1. lift-/.f64N/A

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

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

        \[\leadsto \frac{\color{blue}{v \cdot \left(-t1\right)}}{\mathsf{fma}\left(2, t1, u\right) \cdot u} \]
      4. associate-/l*N/A

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

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

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

      \[\leadsto \color{blue}{v \cdot \frac{-t1}{\mathsf{fma}\left(2, t1, u\right) \cdot u}} \]
    8. Taylor expanded in u around inf

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

        \[\leadsto v \cdot \frac{-t1}{\color{blue}{u \cdot u}} \]
      2. lower-*.f6473.7

        \[\leadsto v \cdot \frac{-t1}{\color{blue}{u \cdot u}} \]
    10. Applied rewrites73.7%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t1 \leq -1.65 \cdot 10^{-52}:\\ \;\;\;\;\frac{-v}{\mathsf{fma}\left(u, 2, t1\right)}\\ \mathbf{elif}\;t1 \leq 3.8 \cdot 10^{-119}:\\ \;\;\;\;\frac{-t1}{u \cdot u} \cdot v\\ \mathbf{else}:\\ \;\;\;\;\frac{-v}{\mathsf{fma}\left(u, 2, t1\right)}\\ \end{array} \]
  5. Add Preprocessing

Alternative 10: 98.0% accurate, 0.8× speedup?

\[\begin{array}{l} \\ \frac{t1}{t1 + u} \cdot \frac{-v}{t1 + u} \end{array} \]
(FPCore (u v t1) :precision binary64 (* (/ t1 (+ t1 u)) (/ (- v) (+ t1 u))))
double code(double u, double v, double t1) {
	return (t1 / (t1 + u)) * (-v / (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 / (t1 + u)) * (-v / (t1 + u))
end function
public static double code(double u, double v, double t1) {
	return (t1 / (t1 + u)) * (-v / (t1 + u));
}
def code(u, v, t1):
	return (t1 / (t1 + u)) * (-v / (t1 + u))
function code(u, v, t1)
	return Float64(Float64(t1 / Float64(t1 + u)) * Float64(Float64(-v) / Float64(t1 + u)))
end
function tmp = code(u, v, t1)
	tmp = (t1 / (t1 + u)) * (-v / (t1 + u));
end
code[u_, v_, t1_] := N[(N[(t1 / N[(t1 + u), $MachinePrecision]), $MachinePrecision] * N[((-v) / N[(t1 + u), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
\frac{t1}{t1 + u} \cdot \frac{-v}{t1 + u}
\end{array}
Derivation
  1. Initial program 76.0%

    \[\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. frac-2negN/A

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

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

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

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

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

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

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

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

      \[\leadsto \frac{\mathsf{neg}\left(v\right)}{t1 + u} \cdot \color{blue}{\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-/.f6497.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-+.f6497.4

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

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

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

Alternative 11: 62.1% accurate, 1.2× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;v \leq 4.7 \cdot 10^{+148}:\\
\;\;\;\;\frac{-v}{\mathsf{fma}\left(u, 2, t1\right)}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if v < 4.6999999999999997e148

    1. Initial program 78.0%

      \[\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-*.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{-v}{\color{blue}{\frac{u + t1}{t1} \cdot \left(u + t1\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. *-commutativeN/A

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

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

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

    if 4.6999999999999997e148 < v

    1. Initial program 65.2%

      \[\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.f6451.4

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

      \[\leadsto \color{blue}{\frac{-v}{t1}} \]
  3. Recombined 2 regimes into one program.
  4. Add Preprocessing

Alternative 12: 53.7% 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 76.0%

    \[\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.f6458.3

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

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

Reproduce

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