Rosa's DopplerBench

Percentage Accurate: 73.1% → 97.8%
Time: 9.7s
Alternatives: 9
Speedup: 1.0×

Specification

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

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 9 alternatives:

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

Initial Program: 73.1% accurate, 1.0× speedup?

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

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

Alternative 1: 97.8% accurate, 1.0× 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(Float64(-t1) / Float64(t1 + u)) * 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 77.0%

    \[\frac{\left(-t1\right) \cdot v}{\left(t1 + u\right) \cdot \left(t1 + u\right)} \]
  2. Step-by-step derivation
    1. times-frac96.6%

      \[\leadsto \color{blue}{\frac{-t1}{t1 + u} \cdot \frac{v}{t1 + u}} \]
  3. Simplified96.6%

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

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

Alternative 2: 79.3% accurate, 0.7× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;t1 \leq -2.1 \cdot 10^{-109} \lor \neg \left(t1 \leq 5.5 \cdot 10^{-40}\right):\\ \;\;\;\;\frac{v}{u \cdot -2 - t1}\\ \mathbf{else}:\\ \;\;\;\;\frac{t1}{u} \cdot \frac{-v}{u}\\ \end{array} \end{array} \]
(FPCore (u v t1)
 :precision binary64
 (if (or (<= t1 -2.1e-109) (not (<= t1 5.5e-40)))
   (/ v (- (* u -2.0) t1))
   (* (/ t1 u) (/ (- v) u))))
double code(double u, double v, double t1) {
	double tmp;
	if ((t1 <= -2.1e-109) || !(t1 <= 5.5e-40)) {
		tmp = v / ((u * -2.0) - t1);
	} else {
		tmp = (t1 / u) * (-v / 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 <= (-2.1d-109)) .or. (.not. (t1 <= 5.5d-40))) then
        tmp = v / ((u * (-2.0d0)) - t1)
    else
        tmp = (t1 / u) * (-v / u)
    end if
    code = tmp
end function
public static double code(double u, double v, double t1) {
	double tmp;
	if ((t1 <= -2.1e-109) || !(t1 <= 5.5e-40)) {
		tmp = v / ((u * -2.0) - t1);
	} else {
		tmp = (t1 / u) * (-v / u);
	}
	return tmp;
}
def code(u, v, t1):
	tmp = 0
	if (t1 <= -2.1e-109) or not (t1 <= 5.5e-40):
		tmp = v / ((u * -2.0) - t1)
	else:
		tmp = (t1 / u) * (-v / u)
	return tmp
function code(u, v, t1)
	tmp = 0.0
	if ((t1 <= -2.1e-109) || !(t1 <= 5.5e-40))
		tmp = Float64(v / Float64(Float64(u * -2.0) - t1));
	else
		tmp = Float64(Float64(t1 / u) * Float64(Float64(-v) / u));
	end
	return tmp
end
function tmp_2 = code(u, v, t1)
	tmp = 0.0;
	if ((t1 <= -2.1e-109) || ~((t1 <= 5.5e-40)))
		tmp = v / ((u * -2.0) - t1);
	else
		tmp = (t1 / u) * (-v / u);
	end
	tmp_2 = tmp;
end
code[u_, v_, t1_] := If[Or[LessEqual[t1, -2.1e-109], N[Not[LessEqual[t1, 5.5e-40]], $MachinePrecision]], N[(v / N[(N[(u * -2.0), $MachinePrecision] - t1), $MachinePrecision]), $MachinePrecision], N[(N[(t1 / u), $MachinePrecision] * N[((-v) / u), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;t1 \leq -2.1 \cdot 10^{-109} \lor \neg \left(t1 \leq 5.5 \cdot 10^{-40}\right):\\
\;\;\;\;\frac{v}{u \cdot -2 - t1}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t1 < -2.09999999999999996e-109 or 5.50000000000000002e-40 < t1

    1. Initial program 73.2%

      \[\frac{\left(-t1\right) \cdot v}{\left(t1 + u\right) \cdot \left(t1 + u\right)} \]
    2. Step-by-step derivation
      1. associate-/r*86.0%

        \[\leadsto \color{blue}{\frac{\frac{\left(-t1\right) \cdot v}{t1 + u}}{t1 + u}} \]
      2. *-commutative86.0%

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

        \[\leadsto \frac{\color{blue}{\frac{v}{\frac{t1 + u}{-t1}}}}{t1 + u} \]
      4. associate-/l/97.6%

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

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

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

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

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

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

        \[\leadsto \frac{v}{\left(t1 + u\right) \cdot \left(\frac{u}{-t1} + \left(-\color{blue}{1}\right)\right)} \]
      11. metadata-eval97.6%

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

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

      \[\leadsto \frac{v}{\color{blue}{-2 \cdot u + -1 \cdot t1}} \]
    6. Step-by-step derivation
      1. mul-1-neg81.1%

        \[\leadsto \frac{v}{-2 \cdot u + \color{blue}{\left(-t1\right)}} \]
      2. unsub-neg81.1%

        \[\leadsto \frac{v}{\color{blue}{-2 \cdot u - t1}} \]
      3. *-commutative81.1%

        \[\leadsto \frac{v}{\color{blue}{u \cdot -2} - t1} \]
    7. Simplified81.1%

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

    if -2.09999999999999996e-109 < t1 < 5.50000000000000002e-40

    1. Initial program 84.3%

      \[\frac{\left(-t1\right) \cdot v}{\left(t1 + u\right) \cdot \left(t1 + u\right)} \]
    2. Step-by-step derivation
      1. times-frac90.3%

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

      \[\leadsto \color{blue}{\frac{-t1}{t1 + u} \cdot \frac{v}{t1 + u}} \]
    4. Add Preprocessing
    5. Taylor expanded in t1 around 0 80.3%

      \[\leadsto \color{blue}{\left(-1 \cdot \frac{t1}{u}\right)} \cdot \frac{v}{t1 + u} \]
    6. Step-by-step derivation
      1. associate-*r/80.3%

        \[\leadsto \color{blue}{\frac{-1 \cdot t1}{u}} \cdot \frac{v}{t1 + u} \]
      2. mul-1-neg80.3%

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

      \[\leadsto \color{blue}{\frac{-t1}{u}} \cdot \frac{v}{t1 + u} \]
    8. Taylor expanded in t1 around 0 83.6%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t1 \leq -2.1 \cdot 10^{-109} \lor \neg \left(t1 \leq 5.5 \cdot 10^{-40}\right):\\ \;\;\;\;\frac{v}{u \cdot -2 - t1}\\ \mathbf{else}:\\ \;\;\;\;\frac{t1}{u} \cdot \frac{-v}{u}\\ \end{array} \]
  5. Add Preprocessing

Alternative 3: 79.5% accurate, 0.7× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;t1 \leq -2.3 \cdot 10^{-109} \lor \neg \left(t1 \leq 2.1 \cdot 10^{-43}\right):\\ \;\;\;\;\frac{v}{u \cdot -2 - t1}\\ \mathbf{else}:\\ \;\;\;\;\frac{v \cdot \frac{t1}{u}}{-u}\\ \end{array} \end{array} \]
(FPCore (u v t1)
 :precision binary64
 (if (or (<= t1 -2.3e-109) (not (<= t1 2.1e-43)))
   (/ v (- (* u -2.0) t1))
   (/ (* v (/ t1 u)) (- u))))
double code(double u, double v, double t1) {
	double tmp;
	if ((t1 <= -2.3e-109) || !(t1 <= 2.1e-43)) {
		tmp = v / ((u * -2.0) - t1);
	} else {
		tmp = (v * (t1 / u)) / -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 <= (-2.3d-109)) .or. (.not. (t1 <= 2.1d-43))) then
        tmp = v / ((u * (-2.0d0)) - t1)
    else
        tmp = (v * (t1 / u)) / -u
    end if
    code = tmp
end function
public static double code(double u, double v, double t1) {
	double tmp;
	if ((t1 <= -2.3e-109) || !(t1 <= 2.1e-43)) {
		tmp = v / ((u * -2.0) - t1);
	} else {
		tmp = (v * (t1 / u)) / -u;
	}
	return tmp;
}
def code(u, v, t1):
	tmp = 0
	if (t1 <= -2.3e-109) or not (t1 <= 2.1e-43):
		tmp = v / ((u * -2.0) - t1)
	else:
		tmp = (v * (t1 / u)) / -u
	return tmp
function code(u, v, t1)
	tmp = 0.0
	if ((t1 <= -2.3e-109) || !(t1 <= 2.1e-43))
		tmp = Float64(v / Float64(Float64(u * -2.0) - t1));
	else
		tmp = Float64(Float64(v * Float64(t1 / u)) / Float64(-u));
	end
	return tmp
end
function tmp_2 = code(u, v, t1)
	tmp = 0.0;
	if ((t1 <= -2.3e-109) || ~((t1 <= 2.1e-43)))
		tmp = v / ((u * -2.0) - t1);
	else
		tmp = (v * (t1 / u)) / -u;
	end
	tmp_2 = tmp;
end
code[u_, v_, t1_] := If[Or[LessEqual[t1, -2.3e-109], N[Not[LessEqual[t1, 2.1e-43]], $MachinePrecision]], N[(v / N[(N[(u * -2.0), $MachinePrecision] - t1), $MachinePrecision]), $MachinePrecision], N[(N[(v * N[(t1 / u), $MachinePrecision]), $MachinePrecision] / (-u)), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;t1 \leq -2.3 \cdot 10^{-109} \lor \neg \left(t1 \leq 2.1 \cdot 10^{-43}\right):\\
\;\;\;\;\frac{v}{u \cdot -2 - t1}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t1 < -2.3000000000000001e-109 or 2.1000000000000001e-43 < t1

    1. Initial program 73.2%

      \[\frac{\left(-t1\right) \cdot v}{\left(t1 + u\right) \cdot \left(t1 + u\right)} \]
    2. Step-by-step derivation
      1. associate-/r*86.0%

        \[\leadsto \color{blue}{\frac{\frac{\left(-t1\right) \cdot v}{t1 + u}}{t1 + u}} \]
      2. *-commutative86.0%

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

        \[\leadsto \frac{\color{blue}{\frac{v}{\frac{t1 + u}{-t1}}}}{t1 + u} \]
      4. associate-/l/97.6%

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

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

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

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

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

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

        \[\leadsto \frac{v}{\left(t1 + u\right) \cdot \left(\frac{u}{-t1} + \left(-\color{blue}{1}\right)\right)} \]
      11. metadata-eval97.6%

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

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

      \[\leadsto \frac{v}{\color{blue}{-2 \cdot u + -1 \cdot t1}} \]
    6. Step-by-step derivation
      1. mul-1-neg81.1%

        \[\leadsto \frac{v}{-2 \cdot u + \color{blue}{\left(-t1\right)}} \]
      2. unsub-neg81.1%

        \[\leadsto \frac{v}{\color{blue}{-2 \cdot u - t1}} \]
      3. *-commutative81.1%

        \[\leadsto \frac{v}{\color{blue}{u \cdot -2} - t1} \]
    7. Simplified81.1%

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

    if -2.3000000000000001e-109 < t1 < 2.1000000000000001e-43

    1. Initial program 84.3%

      \[\frac{\left(-t1\right) \cdot v}{\left(t1 + u\right) \cdot \left(t1 + u\right)} \]
    2. Step-by-step derivation
      1. times-frac90.3%

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

      \[\leadsto \color{blue}{\frac{-t1}{t1 + u} \cdot \frac{v}{t1 + u}} \]
    4. Add Preprocessing
    5. Taylor expanded in t1 around 0 80.3%

      \[\leadsto \color{blue}{\left(-1 \cdot \frac{t1}{u}\right)} \cdot \frac{v}{t1 + u} \]
    6. Step-by-step derivation
      1. associate-*r/80.3%

        \[\leadsto \color{blue}{\frac{-1 \cdot t1}{u}} \cdot \frac{v}{t1 + u} \]
      2. mul-1-neg80.3%

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

      \[\leadsto \color{blue}{\frac{-t1}{u}} \cdot \frac{v}{t1 + u} \]
    8. Taylor expanded in t1 around 0 83.6%

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

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

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

        \[\leadsto \color{blue}{\frac{-\left(-t1\right)}{-u}} \cdot \frac{v}{u} \]
      4. remove-double-neg83.6%

        \[\leadsto \frac{\color{blue}{t1}}{-u} \cdot \frac{v}{u} \]
      5. associate-*l/83.7%

        \[\leadsto \color{blue}{\frac{t1 \cdot \frac{v}{u}}{-u}} \]
      6. associate-*r/89.6%

        \[\leadsto \frac{\color{blue}{\frac{t1 \cdot v}{u}}}{-u} \]
      7. associate-*l/88.7%

        \[\leadsto \frac{\color{blue}{\frac{t1}{u} \cdot v}}{-u} \]
      8. *-commutative88.7%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t1 \leq -2.3 \cdot 10^{-109} \lor \neg \left(t1 \leq 2.1 \cdot 10^{-43}\right):\\ \;\;\;\;\frac{v}{u \cdot -2 - t1}\\ \mathbf{else}:\\ \;\;\;\;\frac{v \cdot \frac{t1}{u}}{-u}\\ \end{array} \]
  5. Add Preprocessing

Alternative 4: 79.4% accurate, 0.7× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;t1 \leq -2.4 \cdot 10^{-109} \lor \neg \left(t1 \leq 3.1 \cdot 10^{-30}\right):\\ \;\;\;\;\frac{v}{u \cdot -2 - t1}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{-v}{\frac{u}{t1}}}{u}\\ \end{array} \end{array} \]
(FPCore (u v t1)
 :precision binary64
 (if (or (<= t1 -2.4e-109) (not (<= t1 3.1e-30)))
   (/ v (- (* u -2.0) t1))
   (/ (/ (- v) (/ u t1)) u)))
double code(double u, double v, double t1) {
	double tmp;
	if ((t1 <= -2.4e-109) || !(t1 <= 3.1e-30)) {
		tmp = v / ((u * -2.0) - t1);
	} else {
		tmp = (-v / (u / 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 <= (-2.4d-109)) .or. (.not. (t1 <= 3.1d-30))) then
        tmp = v / ((u * (-2.0d0)) - t1)
    else
        tmp = (-v / (u / t1)) / u
    end if
    code = tmp
end function
public static double code(double u, double v, double t1) {
	double tmp;
	if ((t1 <= -2.4e-109) || !(t1 <= 3.1e-30)) {
		tmp = v / ((u * -2.0) - t1);
	} else {
		tmp = (-v / (u / t1)) / u;
	}
	return tmp;
}
def code(u, v, t1):
	tmp = 0
	if (t1 <= -2.4e-109) or not (t1 <= 3.1e-30):
		tmp = v / ((u * -2.0) - t1)
	else:
		tmp = (-v / (u / t1)) / u
	return tmp
function code(u, v, t1)
	tmp = 0.0
	if ((t1 <= -2.4e-109) || !(t1 <= 3.1e-30))
		tmp = Float64(v / Float64(Float64(u * -2.0) - t1));
	else
		tmp = Float64(Float64(Float64(-v) / Float64(u / t1)) / u);
	end
	return tmp
end
function tmp_2 = code(u, v, t1)
	tmp = 0.0;
	if ((t1 <= -2.4e-109) || ~((t1 <= 3.1e-30)))
		tmp = v / ((u * -2.0) - t1);
	else
		tmp = (-v / (u / t1)) / u;
	end
	tmp_2 = tmp;
end
code[u_, v_, t1_] := If[Or[LessEqual[t1, -2.4e-109], N[Not[LessEqual[t1, 3.1e-30]], $MachinePrecision]], N[(v / N[(N[(u * -2.0), $MachinePrecision] - t1), $MachinePrecision]), $MachinePrecision], N[(N[((-v) / N[(u / t1), $MachinePrecision]), $MachinePrecision] / u), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;t1 \leq -2.4 \cdot 10^{-109} \lor \neg \left(t1 \leq 3.1 \cdot 10^{-30}\right):\\
\;\;\;\;\frac{v}{u \cdot -2 - t1}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t1 < -2.39999999999999989e-109 or 3.09999999999999991e-30 < t1

    1. Initial program 73.2%

      \[\frac{\left(-t1\right) \cdot v}{\left(t1 + u\right) \cdot \left(t1 + u\right)} \]
    2. Step-by-step derivation
      1. associate-/r*86.0%

        \[\leadsto \color{blue}{\frac{\frac{\left(-t1\right) \cdot v}{t1 + u}}{t1 + u}} \]
      2. *-commutative86.0%

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

        \[\leadsto \frac{\color{blue}{\frac{v}{\frac{t1 + u}{-t1}}}}{t1 + u} \]
      4. associate-/l/97.6%

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

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

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

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

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

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

        \[\leadsto \frac{v}{\left(t1 + u\right) \cdot \left(\frac{u}{-t1} + \left(-\color{blue}{1}\right)\right)} \]
      11. metadata-eval97.6%

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

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

      \[\leadsto \frac{v}{\color{blue}{-2 \cdot u + -1 \cdot t1}} \]
    6. Step-by-step derivation
      1. mul-1-neg81.1%

        \[\leadsto \frac{v}{-2 \cdot u + \color{blue}{\left(-t1\right)}} \]
      2. unsub-neg81.1%

        \[\leadsto \frac{v}{\color{blue}{-2 \cdot u - t1}} \]
      3. *-commutative81.1%

        \[\leadsto \frac{v}{\color{blue}{u \cdot -2} - t1} \]
    7. Simplified81.1%

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

    if -2.39999999999999989e-109 < t1 < 3.09999999999999991e-30

    1. Initial program 84.3%

      \[\frac{\left(-t1\right) \cdot v}{\left(t1 + u\right) \cdot \left(t1 + u\right)} \]
    2. Step-by-step derivation
      1. times-frac90.3%

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

      \[\leadsto \color{blue}{\frac{-t1}{t1 + u} \cdot \frac{v}{t1 + u}} \]
    4. Add Preprocessing
    5. Taylor expanded in t1 around 0 80.3%

      \[\leadsto \color{blue}{\left(-1 \cdot \frac{t1}{u}\right)} \cdot \frac{v}{t1 + u} \]
    6. Step-by-step derivation
      1. associate-*r/80.3%

        \[\leadsto \color{blue}{\frac{-1 \cdot t1}{u}} \cdot \frac{v}{t1 + u} \]
      2. mul-1-neg80.3%

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

      \[\leadsto \color{blue}{\frac{-t1}{u}} \cdot \frac{v}{t1 + u} \]
    8. Taylor expanded in t1 around 0 83.6%

      \[\leadsto \frac{-t1}{u} \cdot \color{blue}{\frac{v}{u}} \]
    9. Step-by-step derivation
      1. associate-*l/83.7%

        \[\leadsto \color{blue}{\frac{\left(-t1\right) \cdot \frac{v}{u}}{u}} \]
      2. add-sqr-sqrt41.8%

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

        \[\leadsto \frac{\color{blue}{\sqrt{\left(-t1\right) \cdot \left(-t1\right)}} \cdot \frac{v}{u}}{u} \]
      4. sqr-neg45.4%

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

        \[\leadsto \frac{\color{blue}{\left(\sqrt{t1} \cdot \sqrt{t1}\right)} \cdot \frac{v}{u}}{u} \]
      6. add-sqr-sqrt37.7%

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

        \[\leadsto \frac{\color{blue}{\frac{t1 \cdot v}{u}}}{u} \]
      8. associate-*l/37.8%

        \[\leadsto \frac{\color{blue}{\frac{t1}{u} \cdot v}}{u} \]
      9. *-commutative37.8%

        \[\leadsto \frac{\color{blue}{v \cdot \frac{t1}{u}}}{u} \]
    10. Applied egg-rr37.8%

      \[\leadsto \color{blue}{\frac{v \cdot \frac{t1}{u}}{u}} \]
    11. Step-by-step derivation
      1. associate-*r/37.8%

        \[\leadsto \frac{\color{blue}{\frac{v \cdot t1}{u}}}{u} \]
      2. *-commutative37.8%

        \[\leadsto \frac{\frac{\color{blue}{t1 \cdot v}}{u}}{u} \]
      3. frac-2neg37.8%

        \[\leadsto \frac{\color{blue}{\frac{-t1 \cdot v}{-u}}}{u} \]
      4. add-sqr-sqrt23.2%

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

        \[\leadsto \frac{\frac{-t1 \cdot v}{\color{blue}{\sqrt{\left(-u\right) \cdot \left(-u\right)}}}}{u} \]
      6. sqr-neg50.8%

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

        \[\leadsto \frac{\frac{-t1 \cdot v}{\color{blue}{\sqrt{u} \cdot \sqrt{u}}}}{u} \]
      8. add-sqr-sqrt89.6%

        \[\leadsto \frac{\frac{-t1 \cdot v}{\color{blue}{u}}}{u} \]
      9. distribute-neg-frac89.6%

        \[\leadsto \frac{\color{blue}{-\frac{t1 \cdot v}{u}}}{u} \]
      10. *-commutative89.6%

        \[\leadsto \frac{-\frac{\color{blue}{v \cdot t1}}{u}}{u} \]
      11. associate-*r/88.7%

        \[\leadsto \frac{-\color{blue}{v \cdot \frac{t1}{u}}}{u} \]
      12. neg-sub088.7%

        \[\leadsto \frac{\color{blue}{0 - v \cdot \frac{t1}{u}}}{u} \]
      13. clear-num88.7%

        \[\leadsto \frac{0 - v \cdot \color{blue}{\frac{1}{\frac{u}{t1}}}}{u} \]
      14. un-div-inv88.9%

        \[\leadsto \frac{0 - \color{blue}{\frac{v}{\frac{u}{t1}}}}{u} \]
    12. Applied egg-rr88.9%

      \[\leadsto \frac{\color{blue}{0 - \frac{v}{\frac{u}{t1}}}}{u} \]
    13. Step-by-step derivation
      1. neg-sub088.9%

        \[\leadsto \frac{\color{blue}{-\frac{v}{\frac{u}{t1}}}}{u} \]
      2. distribute-neg-frac88.9%

        \[\leadsto \frac{\color{blue}{\frac{-v}{\frac{u}{t1}}}}{u} \]
    14. Simplified88.9%

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

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

Alternative 5: 66.6% accurate, 0.7× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;u \leq -3.9 \cdot 10^{+164} \lor \neg \left(u \leq 2.3 \cdot 10^{+43}\right):\\ \;\;\;\;\frac{t1}{\frac{u}{\frac{v}{u}}}\\ \mathbf{else}:\\ \;\;\;\;\frac{-v}{t1}\\ \end{array} \end{array} \]
(FPCore (u v t1)
 :precision binary64
 (if (or (<= u -3.9e+164) (not (<= u 2.3e+43)))
   (/ t1 (/ u (/ v u)))
   (/ (- v) t1)))
double code(double u, double v, double t1) {
	double tmp;
	if ((u <= -3.9e+164) || !(u <= 2.3e+43)) {
		tmp = t1 / (u / (v / u));
	} else {
		tmp = -v / t1;
	}
	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 ((u <= (-3.9d+164)) .or. (.not. (u <= 2.3d+43))) then
        tmp = t1 / (u / (v / u))
    else
        tmp = -v / t1
    end if
    code = tmp
end function
public static double code(double u, double v, double t1) {
	double tmp;
	if ((u <= -3.9e+164) || !(u <= 2.3e+43)) {
		tmp = t1 / (u / (v / u));
	} else {
		tmp = -v / t1;
	}
	return tmp;
}
def code(u, v, t1):
	tmp = 0
	if (u <= -3.9e+164) or not (u <= 2.3e+43):
		tmp = t1 / (u / (v / u))
	else:
		tmp = -v / t1
	return tmp
function code(u, v, t1)
	tmp = 0.0
	if ((u <= -3.9e+164) || !(u <= 2.3e+43))
		tmp = Float64(t1 / Float64(u / Float64(v / u)));
	else
		tmp = Float64(Float64(-v) / t1);
	end
	return tmp
end
function tmp_2 = code(u, v, t1)
	tmp = 0.0;
	if ((u <= -3.9e+164) || ~((u <= 2.3e+43)))
		tmp = t1 / (u / (v / u));
	else
		tmp = -v / t1;
	end
	tmp_2 = tmp;
end
code[u_, v_, t1_] := If[Or[LessEqual[u, -3.9e+164], N[Not[LessEqual[u, 2.3e+43]], $MachinePrecision]], N[(t1 / N[(u / N[(v / u), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[((-v) / t1), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;u \leq -3.9 \cdot 10^{+164} \lor \neg \left(u \leq 2.3 \cdot 10^{+43}\right):\\
\;\;\;\;\frac{t1}{\frac{u}{\frac{v}{u}}}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if u < -3.89999999999999985e164 or 2.3000000000000002e43 < u

    1. Initial program 81.9%

      \[\frac{\left(-t1\right) \cdot v}{\left(t1 + u\right) \cdot \left(t1 + u\right)} \]
    2. Step-by-step derivation
      1. times-frac99.9%

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

      \[\leadsto \color{blue}{\frac{-t1}{t1 + u} \cdot \frac{v}{t1 + u}} \]
    4. Add Preprocessing
    5. Taylor expanded in t1 around 0 91.4%

      \[\leadsto \color{blue}{\left(-1 \cdot \frac{t1}{u}\right)} \cdot \frac{v}{t1 + u} \]
    6. Step-by-step derivation
      1. associate-*r/91.4%

        \[\leadsto \color{blue}{\frac{-1 \cdot t1}{u}} \cdot \frac{v}{t1 + u} \]
      2. mul-1-neg91.4%

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

      \[\leadsto \color{blue}{\frac{-t1}{u}} \cdot \frac{v}{t1 + u} \]
    8. Taylor expanded in t1 around 0 90.4%

      \[\leadsto \frac{-t1}{u} \cdot \color{blue}{\frac{v}{u}} \]
    9. Step-by-step derivation
      1. associate-*l/90.3%

        \[\leadsto \color{blue}{\frac{\left(-t1\right) \cdot \frac{v}{u}}{u}} \]
      2. associate-/l*86.9%

        \[\leadsto \color{blue}{\frac{-t1}{\frac{u}{\frac{v}{u}}}} \]
      3. add-sqr-sqrt55.8%

        \[\leadsto \frac{\color{blue}{\sqrt{-t1} \cdot \sqrt{-t1}}}{\frac{u}{\frac{v}{u}}} \]
      4. sqrt-unprod63.9%

        \[\leadsto \frac{\color{blue}{\sqrt{\left(-t1\right) \cdot \left(-t1\right)}}}{\frac{u}{\frac{v}{u}}} \]
      5. sqr-neg63.9%

        \[\leadsto \frac{\sqrt{\color{blue}{t1 \cdot t1}}}{\frac{u}{\frac{v}{u}}} \]
      6. sqrt-unprod25.5%

        \[\leadsto \frac{\color{blue}{\sqrt{t1} \cdot \sqrt{t1}}}{\frac{u}{\frac{v}{u}}} \]
      7. add-sqr-sqrt74.8%

        \[\leadsto \frac{\color{blue}{t1}}{\frac{u}{\frac{v}{u}}} \]
    10. Applied egg-rr74.8%

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

    if -3.89999999999999985e164 < u < 2.3000000000000002e43

    1. Initial program 74.9%

      \[\frac{\left(-t1\right) \cdot v}{\left(t1 + u\right) \cdot \left(t1 + u\right)} \]
    2. Step-by-step derivation
      1. times-frac95.1%

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

      \[\leadsto \color{blue}{\frac{-t1}{t1 + u} \cdot \frac{v}{t1 + u}} \]
    4. Add Preprocessing
    5. Taylor expanded in t1 around inf 68.1%

      \[\leadsto \color{blue}{-1 \cdot \frac{v}{t1}} \]
    6. Step-by-step derivation
      1. associate-*r/68.1%

        \[\leadsto \color{blue}{\frac{-1 \cdot v}{t1}} \]
      2. neg-mul-168.1%

        \[\leadsto \frac{\color{blue}{-v}}{t1} \]
    7. Simplified68.1%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;u \leq -3.9 \cdot 10^{+164} \lor \neg \left(u \leq 2.3 \cdot 10^{+43}\right):\\ \;\;\;\;\frac{t1}{\frac{u}{\frac{v}{u}}}\\ \mathbf{else}:\\ \;\;\;\;\frac{-v}{t1}\\ \end{array} \]
  5. Add Preprocessing

Alternative 6: 67.4% accurate, 0.7× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;u \leq -3.5 \cdot 10^{+163} \lor \neg \left(u \leq 2.3 \cdot 10^{+43}\right):\\ \;\;\;\;\frac{t1}{\frac{u}{\frac{v}{u}}}\\ \mathbf{else}:\\ \;\;\;\;\frac{v}{u \cdot -2 - t1}\\ \end{array} \end{array} \]
(FPCore (u v t1)
 :precision binary64
 (if (or (<= u -3.5e+163) (not (<= u 2.3e+43)))
   (/ t1 (/ u (/ v u)))
   (/ v (- (* u -2.0) t1))))
double code(double u, double v, double t1) {
	double tmp;
	if ((u <= -3.5e+163) || !(u <= 2.3e+43)) {
		tmp = t1 / (u / (v / u));
	} else {
		tmp = v / ((u * -2.0) - t1);
	}
	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 ((u <= (-3.5d+163)) .or. (.not. (u <= 2.3d+43))) then
        tmp = t1 / (u / (v / u))
    else
        tmp = v / ((u * (-2.0d0)) - t1)
    end if
    code = tmp
end function
public static double code(double u, double v, double t1) {
	double tmp;
	if ((u <= -3.5e+163) || !(u <= 2.3e+43)) {
		tmp = t1 / (u / (v / u));
	} else {
		tmp = v / ((u * -2.0) - t1);
	}
	return tmp;
}
def code(u, v, t1):
	tmp = 0
	if (u <= -3.5e+163) or not (u <= 2.3e+43):
		tmp = t1 / (u / (v / u))
	else:
		tmp = v / ((u * -2.0) - t1)
	return tmp
function code(u, v, t1)
	tmp = 0.0
	if ((u <= -3.5e+163) || !(u <= 2.3e+43))
		tmp = Float64(t1 / Float64(u / Float64(v / u)));
	else
		tmp = Float64(v / Float64(Float64(u * -2.0) - t1));
	end
	return tmp
end
function tmp_2 = code(u, v, t1)
	tmp = 0.0;
	if ((u <= -3.5e+163) || ~((u <= 2.3e+43)))
		tmp = t1 / (u / (v / u));
	else
		tmp = v / ((u * -2.0) - t1);
	end
	tmp_2 = tmp;
end
code[u_, v_, t1_] := If[Or[LessEqual[u, -3.5e+163], N[Not[LessEqual[u, 2.3e+43]], $MachinePrecision]], N[(t1 / N[(u / N[(v / u), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(v / N[(N[(u * -2.0), $MachinePrecision] - t1), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;u \leq -3.5 \cdot 10^{+163} \lor \neg \left(u \leq 2.3 \cdot 10^{+43}\right):\\
\;\;\;\;\frac{t1}{\frac{u}{\frac{v}{u}}}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if u < -3.5000000000000003e163 or 2.3000000000000002e43 < u

    1. Initial program 81.9%

      \[\frac{\left(-t1\right) \cdot v}{\left(t1 + u\right) \cdot \left(t1 + u\right)} \]
    2. Step-by-step derivation
      1. times-frac99.9%

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

      \[\leadsto \color{blue}{\frac{-t1}{t1 + u} \cdot \frac{v}{t1 + u}} \]
    4. Add Preprocessing
    5. Taylor expanded in t1 around 0 91.4%

      \[\leadsto \color{blue}{\left(-1 \cdot \frac{t1}{u}\right)} \cdot \frac{v}{t1 + u} \]
    6. Step-by-step derivation
      1. associate-*r/91.4%

        \[\leadsto \color{blue}{\frac{-1 \cdot t1}{u}} \cdot \frac{v}{t1 + u} \]
      2. mul-1-neg91.4%

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

      \[\leadsto \color{blue}{\frac{-t1}{u}} \cdot \frac{v}{t1 + u} \]
    8. Taylor expanded in t1 around 0 90.4%

      \[\leadsto \frac{-t1}{u} \cdot \color{blue}{\frac{v}{u}} \]
    9. Step-by-step derivation
      1. associate-*l/90.3%

        \[\leadsto \color{blue}{\frac{\left(-t1\right) \cdot \frac{v}{u}}{u}} \]
      2. associate-/l*86.9%

        \[\leadsto \color{blue}{\frac{-t1}{\frac{u}{\frac{v}{u}}}} \]
      3. add-sqr-sqrt55.8%

        \[\leadsto \frac{\color{blue}{\sqrt{-t1} \cdot \sqrt{-t1}}}{\frac{u}{\frac{v}{u}}} \]
      4. sqrt-unprod63.9%

        \[\leadsto \frac{\color{blue}{\sqrt{\left(-t1\right) \cdot \left(-t1\right)}}}{\frac{u}{\frac{v}{u}}} \]
      5. sqr-neg63.9%

        \[\leadsto \frac{\sqrt{\color{blue}{t1 \cdot t1}}}{\frac{u}{\frac{v}{u}}} \]
      6. sqrt-unprod25.5%

        \[\leadsto \frac{\color{blue}{\sqrt{t1} \cdot \sqrt{t1}}}{\frac{u}{\frac{v}{u}}} \]
      7. add-sqr-sqrt74.8%

        \[\leadsto \frac{\color{blue}{t1}}{\frac{u}{\frac{v}{u}}} \]
    10. Applied egg-rr74.8%

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

    if -3.5000000000000003e163 < u < 2.3000000000000002e43

    1. Initial program 74.9%

      \[\frac{\left(-t1\right) \cdot v}{\left(t1 + u\right) \cdot \left(t1 + u\right)} \]
    2. Step-by-step derivation
      1. associate-/r*85.7%

        \[\leadsto \color{blue}{\frac{\frac{\left(-t1\right) \cdot v}{t1 + u}}{t1 + u}} \]
      2. *-commutative85.7%

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

        \[\leadsto \frac{\color{blue}{\frac{v}{\frac{t1 + u}{-t1}}}}{t1 + u} \]
      4. associate-/l/95.6%

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

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

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

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

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

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

        \[\leadsto \frac{v}{\left(t1 + u\right) \cdot \left(\frac{u}{-t1} + \left(-\color{blue}{1}\right)\right)} \]
      11. metadata-eval95.6%

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

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

      \[\leadsto \frac{v}{\color{blue}{-2 \cdot u + -1 \cdot t1}} \]
    6. Step-by-step derivation
      1. mul-1-neg68.6%

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

        \[\leadsto \frac{v}{\color{blue}{-2 \cdot u - t1}} \]
      3. *-commutative68.6%

        \[\leadsto \frac{v}{\color{blue}{u \cdot -2} - t1} \]
    7. Simplified68.6%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;u \leq -3.5 \cdot 10^{+163} \lor \neg \left(u \leq 2.3 \cdot 10^{+43}\right):\\ \;\;\;\;\frac{t1}{\frac{u}{\frac{v}{u}}}\\ \mathbf{else}:\\ \;\;\;\;\frac{v}{u \cdot -2 - t1}\\ \end{array} \]
  5. Add Preprocessing

Alternative 7: 58.2% accurate, 0.9× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;u \leq -6.5 \cdot 10^{+185} \lor \neg \left(u \leq 4.2 \cdot 10^{+204}\right):\\ \;\;\;\;\frac{v}{u}\\ \mathbf{else}:\\ \;\;\;\;\frac{-v}{t1}\\ \end{array} \end{array} \]
(FPCore (u v t1)
 :precision binary64
 (if (or (<= u -6.5e+185) (not (<= u 4.2e+204))) (/ v u) (/ (- v) t1)))
double code(double u, double v, double t1) {
	double tmp;
	if ((u <= -6.5e+185) || !(u <= 4.2e+204)) {
		tmp = v / u;
	} else {
		tmp = -v / t1;
	}
	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 ((u <= (-6.5d+185)) .or. (.not. (u <= 4.2d+204))) then
        tmp = v / u
    else
        tmp = -v / t1
    end if
    code = tmp
end function
public static double code(double u, double v, double t1) {
	double tmp;
	if ((u <= -6.5e+185) || !(u <= 4.2e+204)) {
		tmp = v / u;
	} else {
		tmp = -v / t1;
	}
	return tmp;
}
def code(u, v, t1):
	tmp = 0
	if (u <= -6.5e+185) or not (u <= 4.2e+204):
		tmp = v / u
	else:
		tmp = -v / t1
	return tmp
function code(u, v, t1)
	tmp = 0.0
	if ((u <= -6.5e+185) || !(u <= 4.2e+204))
		tmp = Float64(v / u);
	else
		tmp = Float64(Float64(-v) / t1);
	end
	return tmp
end
function tmp_2 = code(u, v, t1)
	tmp = 0.0;
	if ((u <= -6.5e+185) || ~((u <= 4.2e+204)))
		tmp = v / u;
	else
		tmp = -v / t1;
	end
	tmp_2 = tmp;
end
code[u_, v_, t1_] := If[Or[LessEqual[u, -6.5e+185], N[Not[LessEqual[u, 4.2e+204]], $MachinePrecision]], N[(v / u), $MachinePrecision], N[((-v) / t1), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;u \leq -6.5 \cdot 10^{+185} \lor \neg \left(u \leq 4.2 \cdot 10^{+204}\right):\\
\;\;\;\;\frac{v}{u}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if u < -6.5000000000000002e185 or 4.2000000000000001e204 < u

    1. Initial program 86.8%

      \[\frac{\left(-t1\right) \cdot v}{\left(t1 + u\right) \cdot \left(t1 + u\right)} \]
    2. Step-by-step derivation
      1. times-frac99.9%

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

      \[\leadsto \color{blue}{\frac{-t1}{t1 + u} \cdot \frac{v}{t1 + u}} \]
    4. Add Preprocessing
    5. Taylor expanded in t1 around 0 96.2%

      \[\leadsto \color{blue}{\left(-1 \cdot \frac{t1}{u}\right)} \cdot \frac{v}{t1 + u} \]
    6. Step-by-step derivation
      1. associate-*r/96.2%

        \[\leadsto \color{blue}{\frac{-1 \cdot t1}{u}} \cdot \frac{v}{t1 + u} \]
      2. mul-1-neg96.2%

        \[\leadsto \frac{\color{blue}{-t1}}{u} \cdot \frac{v}{t1 + u} \]
    7. Simplified96.2%

      \[\leadsto \color{blue}{\frac{-t1}{u}} \cdot \frac{v}{t1 + u} \]
    8. Step-by-step derivation
      1. expm1-log1p-u96.2%

        \[\leadsto \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\frac{-t1}{u} \cdot \frac{v}{t1 + u}\right)\right)} \]
      2. expm1-udef87.0%

        \[\leadsto \color{blue}{e^{\mathsf{log1p}\left(\frac{-t1}{u} \cdot \frac{v}{t1 + u}\right)} - 1} \]
    9. Applied egg-rr87.0%

      \[\leadsto \color{blue}{e^{\mathsf{log1p}\left(\frac{v \cdot \frac{t1}{t1 - u}}{u}\right)} - 1} \]
    10. Step-by-step derivation
      1. expm1-def96.3%

        \[\leadsto \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\frac{v \cdot \frac{t1}{t1 - u}}{u}\right)\right)} \]
      2. expm1-log1p96.3%

        \[\leadsto \color{blue}{\frac{v \cdot \frac{t1}{t1 - u}}{u}} \]
      3. associate-/l*90.8%

        \[\leadsto \color{blue}{\frac{v}{\frac{u}{\frac{t1}{t1 - u}}}} \]
    11. Simplified90.8%

      \[\leadsto \color{blue}{\frac{v}{\frac{u}{\frac{t1}{t1 - u}}}} \]
    12. Taylor expanded in u around 0 46.0%

      \[\leadsto \color{blue}{\frac{v}{u}} \]

    if -6.5000000000000002e185 < u < 4.2000000000000001e204

    1. Initial program 74.7%

      \[\frac{\left(-t1\right) \cdot v}{\left(t1 + u\right) \cdot \left(t1 + u\right)} \]
    2. Step-by-step derivation
      1. times-frac95.7%

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

      \[\leadsto \color{blue}{\frac{-t1}{t1 + u} \cdot \frac{v}{t1 + u}} \]
    4. Add Preprocessing
    5. Taylor expanded in t1 around inf 63.6%

      \[\leadsto \color{blue}{-1 \cdot \frac{v}{t1}} \]
    6. Step-by-step derivation
      1. associate-*r/63.6%

        \[\leadsto \color{blue}{\frac{-1 \cdot v}{t1}} \]
      2. neg-mul-163.6%

        \[\leadsto \frac{\color{blue}{-v}}{t1} \]
    7. Simplified63.6%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;u \leq -6.5 \cdot 10^{+185} \lor \neg \left(u \leq 4.2 \cdot 10^{+204}\right):\\ \;\;\;\;\frac{v}{u}\\ \mathbf{else}:\\ \;\;\;\;\frac{-v}{t1}\\ \end{array} \]
  5. Add Preprocessing

Alternative 8: 58.4% accurate, 0.9× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;u \leq -1.7 \cdot 10^{+168}:\\ \;\;\;\;\frac{v}{u} \cdot -0.5\\ \mathbf{elif}\;u \leq 3.4 \cdot 10^{+204}:\\ \;\;\;\;\frac{-v}{t1}\\ \mathbf{else}:\\ \;\;\;\;\frac{v}{u}\\ \end{array} \end{array} \]
(FPCore (u v t1)
 :precision binary64
 (if (<= u -1.7e+168)
   (* (/ v u) -0.5)
   (if (<= u 3.4e+204) (/ (- v) t1) (/ v u))))
double code(double u, double v, double t1) {
	double tmp;
	if (u <= -1.7e+168) {
		tmp = (v / u) * -0.5;
	} else if (u <= 3.4e+204) {
		tmp = -v / t1;
	} else {
		tmp = v / 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 (u <= (-1.7d+168)) then
        tmp = (v / u) * (-0.5d0)
    else if (u <= 3.4d+204) then
        tmp = -v / t1
    else
        tmp = v / u
    end if
    code = tmp
end function
public static double code(double u, double v, double t1) {
	double tmp;
	if (u <= -1.7e+168) {
		tmp = (v / u) * -0.5;
	} else if (u <= 3.4e+204) {
		tmp = -v / t1;
	} else {
		tmp = v / u;
	}
	return tmp;
}
def code(u, v, t1):
	tmp = 0
	if u <= -1.7e+168:
		tmp = (v / u) * -0.5
	elif u <= 3.4e+204:
		tmp = -v / t1
	else:
		tmp = v / u
	return tmp
function code(u, v, t1)
	tmp = 0.0
	if (u <= -1.7e+168)
		tmp = Float64(Float64(v / u) * -0.5);
	elseif (u <= 3.4e+204)
		tmp = Float64(Float64(-v) / t1);
	else
		tmp = Float64(v / u);
	end
	return tmp
end
function tmp_2 = code(u, v, t1)
	tmp = 0.0;
	if (u <= -1.7e+168)
		tmp = (v / u) * -0.5;
	elseif (u <= 3.4e+204)
		tmp = -v / t1;
	else
		tmp = v / u;
	end
	tmp_2 = tmp;
end
code[u_, v_, t1_] := If[LessEqual[u, -1.7e+168], N[(N[(v / u), $MachinePrecision] * -0.5), $MachinePrecision], If[LessEqual[u, 3.4e+204], N[((-v) / t1), $MachinePrecision], N[(v / u), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;u \leq -1.7 \cdot 10^{+168}:\\
\;\;\;\;\frac{v}{u} \cdot -0.5\\

\mathbf{elif}\;u \leq 3.4 \cdot 10^{+204}:\\
\;\;\;\;\frac{-v}{t1}\\

\mathbf{else}:\\
\;\;\;\;\frac{v}{u}\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if u < -1.70000000000000001e168

    1. Initial program 85.2%

      \[\frac{\left(-t1\right) \cdot v}{\left(t1 + u\right) \cdot \left(t1 + u\right)} \]
    2. Step-by-step derivation
      1. associate-/r*96.9%

        \[\leadsto \color{blue}{\frac{\frac{\left(-t1\right) \cdot v}{t1 + u}}{t1 + u}} \]
      2. *-commutative96.9%

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

        \[\leadsto \frac{\color{blue}{\frac{v}{\frac{t1 + u}{-t1}}}}{t1 + u} \]
      4. associate-/l/96.9%

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

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

        \[\leadsto \frac{v}{\left(t1 + u\right) \cdot \frac{u + \color{blue}{\left(-\left(-t1\right)\right)}}{-t1}} \]
      7. unsub-neg96.9%

        \[\leadsto \frac{v}{\left(t1 + u\right) \cdot \frac{\color{blue}{u - \left(-t1\right)}}{-t1}} \]
      8. div-sub96.9%

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

        \[\leadsto \frac{v}{\left(t1 + u\right) \cdot \color{blue}{\left(\frac{u}{-t1} + \left(-\frac{-t1}{-t1}\right)\right)}} \]
      10. *-inverses96.9%

        \[\leadsto \frac{v}{\left(t1 + u\right) \cdot \left(\frac{u}{-t1} + \left(-\color{blue}{1}\right)\right)} \]
      11. metadata-eval96.9%

        \[\leadsto \frac{v}{\left(t1 + u\right) \cdot \left(\frac{u}{-t1} + \color{blue}{-1}\right)} \]
    3. Simplified96.9%

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

      \[\leadsto \frac{v}{\color{blue}{-2 \cdot u + -1 \cdot t1}} \]
    6. Step-by-step derivation
      1. mul-1-neg52.7%

        \[\leadsto \frac{v}{-2 \cdot u + \color{blue}{\left(-t1\right)}} \]
      2. unsub-neg52.7%

        \[\leadsto \frac{v}{\color{blue}{-2 \cdot u - t1}} \]
      3. *-commutative52.7%

        \[\leadsto \frac{v}{\color{blue}{u \cdot -2} - t1} \]
    7. Simplified52.7%

      \[\leadsto \frac{v}{\color{blue}{u \cdot -2 - t1}} \]
    8. Taylor expanded in u around inf 45.1%

      \[\leadsto \color{blue}{-0.5 \cdot \frac{v}{u}} \]

    if -1.70000000000000001e168 < u < 3.4000000000000001e204

    1. Initial program 74.6%

      \[\frac{\left(-t1\right) \cdot v}{\left(t1 + u\right) \cdot \left(t1 + u\right)} \]
    2. Step-by-step derivation
      1. times-frac95.7%

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

      \[\leadsto \color{blue}{\frac{-t1}{t1 + u} \cdot \frac{v}{t1 + u}} \]
    4. Add Preprocessing
    5. Taylor expanded in t1 around inf 64.3%

      \[\leadsto \color{blue}{-1 \cdot \frac{v}{t1}} \]
    6. Step-by-step derivation
      1. associate-*r/64.3%

        \[\leadsto \color{blue}{\frac{-1 \cdot v}{t1}} \]
      2. neg-mul-164.3%

        \[\leadsto \frac{\color{blue}{-v}}{t1} \]
    7. Simplified64.3%

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

    if 3.4000000000000001e204 < u

    1. Initial program 87.2%

      \[\frac{\left(-t1\right) \cdot v}{\left(t1 + u\right) \cdot \left(t1 + u\right)} \]
    2. Step-by-step derivation
      1. times-frac99.9%

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

      \[\leadsto \color{blue}{\frac{-t1}{t1 + u} \cdot \frac{v}{t1 + u}} \]
    4. Add Preprocessing
    5. Taylor expanded in t1 around 0 99.9%

      \[\leadsto \color{blue}{\left(-1 \cdot \frac{t1}{u}\right)} \cdot \frac{v}{t1 + u} \]
    6. Step-by-step derivation
      1. associate-*r/99.9%

        \[\leadsto \color{blue}{\frac{-1 \cdot t1}{u}} \cdot \frac{v}{t1 + u} \]
      2. mul-1-neg99.9%

        \[\leadsto \frac{\color{blue}{-t1}}{u} \cdot \frac{v}{t1 + u} \]
    7. Simplified99.9%

      \[\leadsto \color{blue}{\frac{-t1}{u}} \cdot \frac{v}{t1 + u} \]
    8. Step-by-step derivation
      1. expm1-log1p-u99.9%

        \[\leadsto \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\frac{-t1}{u} \cdot \frac{v}{t1 + u}\right)\right)} \]
      2. expm1-udef87.4%

        \[\leadsto \color{blue}{e^{\mathsf{log1p}\left(\frac{-t1}{u} \cdot \frac{v}{t1 + u}\right)} - 1} \]
    9. Applied egg-rr87.4%

      \[\leadsto \color{blue}{e^{\mathsf{log1p}\left(\frac{v \cdot \frac{t1}{t1 - u}}{u}\right)} - 1} \]
    10. Step-by-step derivation
      1. expm1-def99.9%

        \[\leadsto \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\frac{v \cdot \frac{t1}{t1 - u}}{u}\right)\right)} \]
      2. expm1-log1p99.9%

        \[\leadsto \color{blue}{\frac{v \cdot \frac{t1}{t1 - u}}{u}} \]
      3. associate-/l*91.6%

        \[\leadsto \color{blue}{\frac{v}{\frac{u}{\frac{t1}{t1 - u}}}} \]
    11. Simplified91.6%

      \[\leadsto \color{blue}{\frac{v}{\frac{u}{\frac{t1}{t1 - u}}}} \]
    12. Taylor expanded in u around 0 44.0%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;u \leq -1.7 \cdot 10^{+168}:\\ \;\;\;\;\frac{v}{u} \cdot -0.5\\ \mathbf{elif}\;u \leq 3.4 \cdot 10^{+204}:\\ \;\;\;\;\frac{-v}{t1}\\ \mathbf{else}:\\ \;\;\;\;\frac{v}{u}\\ \end{array} \]
  5. Add Preprocessing

Alternative 9: 17.5% accurate, 4.0× speedup?

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

\\
\frac{v}{u}
\end{array}
Derivation
  1. Initial program 77.0%

    \[\frac{\left(-t1\right) \cdot v}{\left(t1 + u\right) \cdot \left(t1 + u\right)} \]
  2. Step-by-step derivation
    1. times-frac96.6%

      \[\leadsto \color{blue}{\frac{-t1}{t1 + u} \cdot \frac{v}{t1 + u}} \]
  3. Simplified96.6%

    \[\leadsto \color{blue}{\frac{-t1}{t1 + u} \cdot \frac{v}{t1 + u}} \]
  4. Add Preprocessing
  5. Taylor expanded in t1 around 0 51.7%

    \[\leadsto \color{blue}{\left(-1 \cdot \frac{t1}{u}\right)} \cdot \frac{v}{t1 + u} \]
  6. Step-by-step derivation
    1. associate-*r/51.7%

      \[\leadsto \color{blue}{\frac{-1 \cdot t1}{u}} \cdot \frac{v}{t1 + u} \]
    2. mul-1-neg51.7%

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

    \[\leadsto \color{blue}{\frac{-t1}{u}} \cdot \frac{v}{t1 + u} \]
  8. Step-by-step derivation
    1. expm1-log1p-u47.2%

      \[\leadsto \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\frac{-t1}{u} \cdot \frac{v}{t1 + u}\right)\right)} \]
    2. expm1-udef36.4%

      \[\leadsto \color{blue}{e^{\mathsf{log1p}\left(\frac{-t1}{u} \cdot \frac{v}{t1 + u}\right)} - 1} \]
  9. Applied egg-rr41.0%

    \[\leadsto \color{blue}{e^{\mathsf{log1p}\left(\frac{v \cdot \frac{t1}{t1 - u}}{u}\right)} - 1} \]
  10. Step-by-step derivation
    1. expm1-def46.9%

      \[\leadsto \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\frac{v \cdot \frac{t1}{t1 - u}}{u}\right)\right)} \]
    2. expm1-log1p51.3%

      \[\leadsto \color{blue}{\frac{v \cdot \frac{t1}{t1 - u}}{u}} \]
    3. associate-/l*47.7%

      \[\leadsto \color{blue}{\frac{v}{\frac{u}{\frac{t1}{t1 - u}}}} \]
  11. Simplified47.7%

    \[\leadsto \color{blue}{\frac{v}{\frac{u}{\frac{t1}{t1 - u}}}} \]
  12. Taylor expanded in u around 0 16.2%

    \[\leadsto \color{blue}{\frac{v}{u}} \]
  13. Final simplification16.2%

    \[\leadsto \frac{v}{u} \]
  14. Add Preprocessing

Reproduce

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