Rosa's DopplerBench

Percentage Accurate: 72.0% → 98.0%
Time: 12.0s
Alternatives: 11
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 11 alternatives:

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 2: 88.3% accurate, 0.7× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;t1 \leq -9.2 \cdot 10^{+156}:\\ \;\;\;\;v \cdot \frac{-1 + \frac{u}{t1}}{t1 + u}\\ \mathbf{elif}\;t1 \leq 1.5 \cdot 10^{+108}:\\ \;\;\;\;v \cdot \frac{-t1}{\left(t1 + u\right) \cdot \left(t1 + u\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{v \cdot -1}{t1 + u}\\ \end{array} \end{array} \]
(FPCore (u v t1)
 :precision binary64
 (if (<= t1 -9.2e+156)
   (* v (/ (+ -1.0 (/ u t1)) (+ t1 u)))
   (if (<= t1 1.5e+108)
     (* v (/ (- t1) (* (+ t1 u) (+ t1 u))))
     (/ (* v -1.0) (+ t1 u)))))
double code(double u, double v, double t1) {
	double tmp;
	if (t1 <= -9.2e+156) {
		tmp = v * ((-1.0 + (u / t1)) / (t1 + u));
	} else if (t1 <= 1.5e+108) {
		tmp = v * (-t1 / ((t1 + u) * (t1 + u)));
	} else {
		tmp = (v * -1.0) / (t1 + u);
	}
	return tmp;
}
real(8) function code(u, v, t1)
    real(8), intent (in) :: u
    real(8), intent (in) :: v
    real(8), intent (in) :: t1
    real(8) :: tmp
    if (t1 <= (-9.2d+156)) then
        tmp = v * (((-1.0d0) + (u / t1)) / (t1 + u))
    else if (t1 <= 1.5d+108) then
        tmp = v * (-t1 / ((t1 + u) * (t1 + u)))
    else
        tmp = (v * (-1.0d0)) / (t1 + u)
    end if
    code = tmp
end function
public static double code(double u, double v, double t1) {
	double tmp;
	if (t1 <= -9.2e+156) {
		tmp = v * ((-1.0 + (u / t1)) / (t1 + u));
	} else if (t1 <= 1.5e+108) {
		tmp = v * (-t1 / ((t1 + u) * (t1 + u)));
	} else {
		tmp = (v * -1.0) / (t1 + u);
	}
	return tmp;
}
def code(u, v, t1):
	tmp = 0
	if t1 <= -9.2e+156:
		tmp = v * ((-1.0 + (u / t1)) / (t1 + u))
	elif t1 <= 1.5e+108:
		tmp = v * (-t1 / ((t1 + u) * (t1 + u)))
	else:
		tmp = (v * -1.0) / (t1 + u)
	return tmp
function code(u, v, t1)
	tmp = 0.0
	if (t1 <= -9.2e+156)
		tmp = Float64(v * Float64(Float64(-1.0 + Float64(u / t1)) / Float64(t1 + u)));
	elseif (t1 <= 1.5e+108)
		tmp = Float64(v * Float64(Float64(-t1) / Float64(Float64(t1 + u) * Float64(t1 + u))));
	else
		tmp = Float64(Float64(v * -1.0) / Float64(t1 + u));
	end
	return tmp
end
function tmp_2 = code(u, v, t1)
	tmp = 0.0;
	if (t1 <= -9.2e+156)
		tmp = v * ((-1.0 + (u / t1)) / (t1 + u));
	elseif (t1 <= 1.5e+108)
		tmp = v * (-t1 / ((t1 + u) * (t1 + u)));
	else
		tmp = (v * -1.0) / (t1 + u);
	end
	tmp_2 = tmp;
end
code[u_, v_, t1_] := If[LessEqual[t1, -9.2e+156], N[(v * N[(N[(-1.0 + N[(u / t1), $MachinePrecision]), $MachinePrecision] / N[(t1 + u), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t1, 1.5e+108], N[(v * N[((-t1) / N[(N[(t1 + u), $MachinePrecision] * N[(t1 + u), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(v * -1.0), $MachinePrecision] / N[(t1 + u), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;t1 \leq -9.2 \cdot 10^{+156}:\\
\;\;\;\;v \cdot \frac{-1 + \frac{u}{t1}}{t1 + u}\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if t1 < -9.1999999999999995e156

    1. Initial program 38.5%

      \[\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(\mathsf{neg}\left(t1\right)\right) \cdot v}{\left(t1 + u\right) \cdot \left(t1 + u\right)}} \]
      2. lift-*.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{\color{blue}{-1 + \frac{u}{t1}}}{t1 + u} \cdot v \]
      5. lower-/.f6490.3

        \[\leadsto \frac{-1 + \color{blue}{\frac{u}{t1}}}{t1 + u} \cdot v \]
    9. Applied rewrites90.3%

      \[\leadsto \frac{\color{blue}{-1 + \frac{u}{t1}}}{t1 + u} \cdot v \]

    if -9.1999999999999995e156 < t1 < 1.49999999999999992e108

    1. Initial program 83.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(\mathsf{neg}\left(t1\right)\right) \cdot v}{\left(t1 + u\right) \cdot \left(t1 + u\right)}} \]
      2. lift-*.f64N/A

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

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{-t1}{\left(t1 + u\right) \cdot \left(t1 + u\right)} \cdot v} \]

    if 1.49999999999999992e108 < t1

    1. Initial program 47.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \frac{\color{blue}{-1} \cdot \left(\mathsf{neg}\left(v\right)\right)}{\mathsf{neg}\left(\left(t1 + u\right)\right)} \]
    6. Step-by-step derivation
      1. Applied rewrites91.4%

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

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

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

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

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

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

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

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

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

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

          \[\leadsto \frac{\color{blue}{v \cdot -1}}{t1 + u} \]
        11. lower-*.f6491.4

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

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

      \[\leadsto \begin{array}{l} \mathbf{if}\;t1 \leq -9.2 \cdot 10^{+156}:\\ \;\;\;\;v \cdot \frac{-1 + \frac{u}{t1}}{t1 + u}\\ \mathbf{elif}\;t1 \leq 1.5 \cdot 10^{+108}:\\ \;\;\;\;v \cdot \frac{-t1}{\left(t1 + u\right) \cdot \left(t1 + u\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{v \cdot -1}{t1 + u}\\ \end{array} \]
    9. Add Preprocessing

    Reproduce

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