
(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:
Herbie found 14 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(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}
(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}
Initial program 72.5%
times-frac98.9%
distribute-frac-neg98.9%
distribute-neg-frac298.9%
+-commutative98.9%
distribute-neg-in98.9%
unsub-neg98.9%
Simplified98.9%
Final simplification98.9%
(FPCore (u v t1)
:precision binary64
(let* ((t_1 (- (- u) t1)) (t_2 (* t1 (/ v (* t_1 (+ t1 u))))))
(if (<= t1 -3.8e+124)
(/ v (- u t1))
(if (<= t1 -1.65e-154)
t_2
(if (<= t1 2.8e-195)
(* (/ t1 (- u)) (/ v u))
(if (<= t1 1.75e+66) t_2 (/ v t_1)))))))
double code(double u, double v, double t1) {
double t_1 = -u - t1;
double t_2 = t1 * (v / (t_1 * (t1 + u)));
double tmp;
if (t1 <= -3.8e+124) {
tmp = v / (u - t1);
} else if (t1 <= -1.65e-154) {
tmp = t_2;
} else if (t1 <= 2.8e-195) {
tmp = (t1 / -u) * (v / u);
} else if (t1 <= 1.75e+66) {
tmp = t_2;
} else {
tmp = v / t_1;
}
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) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = -u - t1
t_2 = t1 * (v / (t_1 * (t1 + u)))
if (t1 <= (-3.8d+124)) then
tmp = v / (u - t1)
else if (t1 <= (-1.65d-154)) then
tmp = t_2
else if (t1 <= 2.8d-195) then
tmp = (t1 / -u) * (v / u)
else if (t1 <= 1.75d+66) then
tmp = t_2
else
tmp = v / t_1
end if
code = tmp
end function
public static double code(double u, double v, double t1) {
double t_1 = -u - t1;
double t_2 = t1 * (v / (t_1 * (t1 + u)));
double tmp;
if (t1 <= -3.8e+124) {
tmp = v / (u - t1);
} else if (t1 <= -1.65e-154) {
tmp = t_2;
} else if (t1 <= 2.8e-195) {
tmp = (t1 / -u) * (v / u);
} else if (t1 <= 1.75e+66) {
tmp = t_2;
} else {
tmp = v / t_1;
}
return tmp;
}
def code(u, v, t1): t_1 = -u - t1 t_2 = t1 * (v / (t_1 * (t1 + u))) tmp = 0 if t1 <= -3.8e+124: tmp = v / (u - t1) elif t1 <= -1.65e-154: tmp = t_2 elif t1 <= 2.8e-195: tmp = (t1 / -u) * (v / u) elif t1 <= 1.75e+66: tmp = t_2 else: tmp = v / t_1 return tmp
function code(u, v, t1) t_1 = Float64(Float64(-u) - t1) t_2 = Float64(t1 * Float64(v / Float64(t_1 * Float64(t1 + u)))) tmp = 0.0 if (t1 <= -3.8e+124) tmp = Float64(v / Float64(u - t1)); elseif (t1 <= -1.65e-154) tmp = t_2; elseif (t1 <= 2.8e-195) tmp = Float64(Float64(t1 / Float64(-u)) * Float64(v / u)); elseif (t1 <= 1.75e+66) tmp = t_2; else tmp = Float64(v / t_1); end return tmp end
function tmp_2 = code(u, v, t1) t_1 = -u - t1; t_2 = t1 * (v / (t_1 * (t1 + u))); tmp = 0.0; if (t1 <= -3.8e+124) tmp = v / (u - t1); elseif (t1 <= -1.65e-154) tmp = t_2; elseif (t1 <= 2.8e-195) tmp = (t1 / -u) * (v / u); elseif (t1 <= 1.75e+66) tmp = t_2; else tmp = v / t_1; end tmp_2 = tmp; end
code[u_, v_, t1_] := Block[{t$95$1 = N[((-u) - t1), $MachinePrecision]}, Block[{t$95$2 = N[(t1 * N[(v / N[(t$95$1 * N[(t1 + u), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t1, -3.8e+124], N[(v / N[(u - t1), $MachinePrecision]), $MachinePrecision], If[LessEqual[t1, -1.65e-154], t$95$2, If[LessEqual[t1, 2.8e-195], N[(N[(t1 / (-u)), $MachinePrecision] * N[(v / u), $MachinePrecision]), $MachinePrecision], If[LessEqual[t1, 1.75e+66], t$95$2, N[(v / t$95$1), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(-u\right) - t1\\
t_2 := t1 \cdot \frac{v}{t\_1 \cdot \left(t1 + u\right)}\\
\mathbf{if}\;t1 \leq -3.8 \cdot 10^{+124}:\\
\;\;\;\;\frac{v}{u - t1}\\
\mathbf{elif}\;t1 \leq -1.65 \cdot 10^{-154}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;t1 \leq 2.8 \cdot 10^{-195}:\\
\;\;\;\;\frac{t1}{-u} \cdot \frac{v}{u}\\
\mathbf{elif}\;t1 \leq 1.75 \cdot 10^{+66}:\\
\;\;\;\;t\_2\\
\mathbf{else}:\\
\;\;\;\;\frac{v}{t\_1}\\
\end{array}
\end{array}
if t1 < -3.7999999999999998e124Initial program 37.8%
times-frac100.0%
distribute-frac-neg100.0%
distribute-neg-frac2100.0%
+-commutative100.0%
distribute-neg-in100.0%
unsub-neg100.0%
Simplified100.0%
Taylor expanded in t1 around inf 90.4%
mul-1-neg90.4%
frac-2neg90.4%
distribute-neg-frac290.4%
add-sqr-sqrt40.0%
sqrt-unprod51.7%
sqr-neg51.7%
sqrt-unprod23.5%
add-sqr-sqrt34.0%
distribute-neg-in34.0%
add-sqr-sqrt34.0%
sqrt-unprod34.8%
sqr-neg34.8%
sqrt-unprod0.0%
add-sqr-sqrt90.5%
sub-neg90.5%
Applied egg-rr90.5%
sub-neg90.5%
distribute-neg-in90.5%
remove-double-neg90.5%
Simplified90.5%
Taylor expanded in v around 0 90.5%
if -3.7999999999999998e124 < t1 < -1.65000000000000014e-154 or 2.80000000000000003e-195 < t1 < 1.7499999999999999e66Initial program 89.6%
associate-/l*95.5%
Simplified95.5%
if -1.65000000000000014e-154 < t1 < 2.80000000000000003e-195Initial program 63.5%
times-frac96.0%
distribute-frac-neg96.0%
distribute-neg-frac296.0%
+-commutative96.0%
distribute-neg-in96.0%
unsub-neg96.0%
Simplified96.0%
Taylor expanded in t1 around 0 86.0%
associate-*r/86.0%
mul-1-neg86.0%
Simplified86.0%
Taylor expanded in t1 around 0 86.0%
if 1.7499999999999999e66 < t1 Initial program 70.3%
associate-*l/72.9%
*-commutative72.9%
Simplified72.9%
associate-*r/70.3%
times-frac100.0%
*-commutative100.0%
frac-2neg100.0%
+-commutative100.0%
distribute-neg-in100.0%
sub-neg100.0%
associate-*r/100.0%
add-sqr-sqrt0.0%
sqrt-unprod10.7%
sqr-neg10.7%
sqrt-unprod45.4%
add-sqr-sqrt45.4%
sub-neg45.4%
+-commutative45.4%
add-sqr-sqrt0.0%
sqrt-unprod73.1%
sqr-neg73.1%
sqrt-unprod97.6%
add-sqr-sqrt48.8%
sqrt-unprod97.6%
sqr-neg97.6%
sqrt-unprod50.9%
Applied egg-rr100.0%
Taylor expanded in t1 around inf 97.9%
mul-1-neg97.9%
Simplified97.9%
Final simplification93.0%
(FPCore (u v t1)
:precision binary64
(let* ((t_1 (* v (/ (- t1) (* (+ t1 u) (+ t1 u))))))
(if (<= t1 -7.2e+129)
(/ v (- u t1))
(if (<= t1 -1.6e-140)
t_1
(if (<= t1 1.3e-193)
(* (/ t1 (- u)) (/ v u))
(if (<= t1 3.3e+66) t_1 (/ v (- (- u) t1))))))))
double code(double u, double v, double t1) {
double t_1 = v * (-t1 / ((t1 + u) * (t1 + u)));
double tmp;
if (t1 <= -7.2e+129) {
tmp = v / (u - t1);
} else if (t1 <= -1.6e-140) {
tmp = t_1;
} else if (t1 <= 1.3e-193) {
tmp = (t1 / -u) * (v / u);
} else if (t1 <= 3.3e+66) {
tmp = t_1;
} else {
tmp = v / (-u - 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) :: t_1
real(8) :: tmp
t_1 = v * (-t1 / ((t1 + u) * (t1 + u)))
if (t1 <= (-7.2d+129)) then
tmp = v / (u - t1)
else if (t1 <= (-1.6d-140)) then
tmp = t_1
else if (t1 <= 1.3d-193) then
tmp = (t1 / -u) * (v / u)
else if (t1 <= 3.3d+66) then
tmp = t_1
else
tmp = v / (-u - t1)
end if
code = tmp
end function
public static double code(double u, double v, double t1) {
double t_1 = v * (-t1 / ((t1 + u) * (t1 + u)));
double tmp;
if (t1 <= -7.2e+129) {
tmp = v / (u - t1);
} else if (t1 <= -1.6e-140) {
tmp = t_1;
} else if (t1 <= 1.3e-193) {
tmp = (t1 / -u) * (v / u);
} else if (t1 <= 3.3e+66) {
tmp = t_1;
} else {
tmp = v / (-u - t1);
}
return tmp;
}
def code(u, v, t1): t_1 = v * (-t1 / ((t1 + u) * (t1 + u))) tmp = 0 if t1 <= -7.2e+129: tmp = v / (u - t1) elif t1 <= -1.6e-140: tmp = t_1 elif t1 <= 1.3e-193: tmp = (t1 / -u) * (v / u) elif t1 <= 3.3e+66: tmp = t_1 else: tmp = v / (-u - t1) return tmp
function code(u, v, t1) t_1 = Float64(v * Float64(Float64(-t1) / Float64(Float64(t1 + u) * Float64(t1 + u)))) tmp = 0.0 if (t1 <= -7.2e+129) tmp = Float64(v / Float64(u - t1)); elseif (t1 <= -1.6e-140) tmp = t_1; elseif (t1 <= 1.3e-193) tmp = Float64(Float64(t1 / Float64(-u)) * Float64(v / u)); elseif (t1 <= 3.3e+66) tmp = t_1; else tmp = Float64(v / Float64(Float64(-u) - t1)); end return tmp end
function tmp_2 = code(u, v, t1) t_1 = v * (-t1 / ((t1 + u) * (t1 + u))); tmp = 0.0; if (t1 <= -7.2e+129) tmp = v / (u - t1); elseif (t1 <= -1.6e-140) tmp = t_1; elseif (t1 <= 1.3e-193) tmp = (t1 / -u) * (v / u); elseif (t1 <= 3.3e+66) tmp = t_1; else tmp = v / (-u - t1); end tmp_2 = tmp; end
code[u_, v_, t1_] := Block[{t$95$1 = N[(v * N[((-t1) / N[(N[(t1 + u), $MachinePrecision] * N[(t1 + u), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t1, -7.2e+129], N[(v / N[(u - t1), $MachinePrecision]), $MachinePrecision], If[LessEqual[t1, -1.6e-140], t$95$1, If[LessEqual[t1, 1.3e-193], N[(N[(t1 / (-u)), $MachinePrecision] * N[(v / u), $MachinePrecision]), $MachinePrecision], If[LessEqual[t1, 3.3e+66], t$95$1, N[(v / N[((-u) - t1), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := v \cdot \frac{-t1}{\left(t1 + u\right) \cdot \left(t1 + u\right)}\\
\mathbf{if}\;t1 \leq -7.2 \cdot 10^{+129}:\\
\;\;\;\;\frac{v}{u - t1}\\
\mathbf{elif}\;t1 \leq -1.6 \cdot 10^{-140}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t1 \leq 1.3 \cdot 10^{-193}:\\
\;\;\;\;\frac{t1}{-u} \cdot \frac{v}{u}\\
\mathbf{elif}\;t1 \leq 3.3 \cdot 10^{+66}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;\frac{v}{\left(-u\right) - t1}\\
\end{array}
\end{array}
if t1 < -7.2000000000000002e129Initial program 37.8%
times-frac100.0%
distribute-frac-neg100.0%
distribute-neg-frac2100.0%
+-commutative100.0%
distribute-neg-in100.0%
unsub-neg100.0%
Simplified100.0%
Taylor expanded in t1 around inf 90.4%
mul-1-neg90.4%
frac-2neg90.4%
distribute-neg-frac290.4%
add-sqr-sqrt40.0%
sqrt-unprod51.7%
sqr-neg51.7%
sqrt-unprod23.5%
add-sqr-sqrt34.0%
distribute-neg-in34.0%
add-sqr-sqrt34.0%
sqrt-unprod34.8%
sqr-neg34.8%
sqrt-unprod0.0%
add-sqr-sqrt90.5%
sub-neg90.5%
Applied egg-rr90.5%
sub-neg90.5%
distribute-neg-in90.5%
remove-double-neg90.5%
Simplified90.5%
Taylor expanded in v around 0 90.5%
if -7.2000000000000002e129 < t1 < -1.6000000000000001e-140 or 1.30000000000000004e-193 < t1 < 3.3000000000000001e66Initial program 89.2%
associate-*l/95.1%
*-commutative95.1%
Simplified95.1%
if -1.6000000000000001e-140 < t1 < 1.30000000000000004e-193Initial program 66.0%
times-frac96.2%
distribute-frac-neg96.2%
distribute-neg-frac296.2%
+-commutative96.2%
distribute-neg-in96.2%
unsub-neg96.2%
Simplified96.2%
Taylor expanded in t1 around 0 86.9%
associate-*r/86.9%
mul-1-neg86.9%
Simplified86.9%
Taylor expanded in t1 around 0 87.0%
if 3.3000000000000001e66 < t1 Initial program 70.3%
associate-*l/72.9%
*-commutative72.9%
Simplified72.9%
associate-*r/70.3%
times-frac100.0%
*-commutative100.0%
frac-2neg100.0%
+-commutative100.0%
distribute-neg-in100.0%
sub-neg100.0%
associate-*r/100.0%
add-sqr-sqrt0.0%
sqrt-unprod10.7%
sqr-neg10.7%
sqrt-unprod45.4%
add-sqr-sqrt45.4%
sub-neg45.4%
+-commutative45.4%
add-sqr-sqrt0.0%
sqrt-unprod73.1%
sqr-neg73.1%
sqrt-unprod97.6%
add-sqr-sqrt48.8%
sqrt-unprod97.6%
sqr-neg97.6%
sqrt-unprod50.9%
Applied egg-rr100.0%
Taylor expanded in t1 around inf 97.9%
mul-1-neg97.9%
Simplified97.9%
Final simplification92.9%
(FPCore (u v t1) :precision binary64 (if (or (<= u -1.3e-49) (not (<= u 4.1e-34))) (* (/ v (+ t1 u)) (/ t1 (- u))) (/ v (- t1))))
double code(double u, double v, double t1) {
double tmp;
if ((u <= -1.3e-49) || !(u <= 4.1e-34)) {
tmp = (v / (t1 + u)) * (t1 / -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 <= (-1.3d-49)) .or. (.not. (u <= 4.1d-34))) then
tmp = (v / (t1 + u)) * (t1 / -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 <= -1.3e-49) || !(u <= 4.1e-34)) {
tmp = (v / (t1 + u)) * (t1 / -u);
} else {
tmp = v / -t1;
}
return tmp;
}
def code(u, v, t1): tmp = 0 if (u <= -1.3e-49) or not (u <= 4.1e-34): tmp = (v / (t1 + u)) * (t1 / -u) else: tmp = v / -t1 return tmp
function code(u, v, t1) tmp = 0.0 if ((u <= -1.3e-49) || !(u <= 4.1e-34)) tmp = Float64(Float64(v / Float64(t1 + u)) * Float64(t1 / Float64(-u))); else tmp = Float64(v / Float64(-t1)); end return tmp end
function tmp_2 = code(u, v, t1) tmp = 0.0; if ((u <= -1.3e-49) || ~((u <= 4.1e-34))) tmp = (v / (t1 + u)) * (t1 / -u); else tmp = v / -t1; end tmp_2 = tmp; end
code[u_, v_, t1_] := If[Or[LessEqual[u, -1.3e-49], N[Not[LessEqual[u, 4.1e-34]], $MachinePrecision]], N[(N[(v / N[(t1 + u), $MachinePrecision]), $MachinePrecision] * N[(t1 / (-u)), $MachinePrecision]), $MachinePrecision], N[(v / (-t1)), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;u \leq -1.3 \cdot 10^{-49} \lor \neg \left(u \leq 4.1 \cdot 10^{-34}\right):\\
\;\;\;\;\frac{v}{t1 + u} \cdot \frac{t1}{-u}\\
\mathbf{else}:\\
\;\;\;\;\frac{v}{-t1}\\
\end{array}
\end{array}
if u < -1.29999999999999997e-49 or 4.1000000000000004e-34 < u Initial program 81.6%
times-frac99.4%
distribute-frac-neg99.4%
distribute-neg-frac299.4%
+-commutative99.4%
distribute-neg-in99.4%
unsub-neg99.4%
Simplified99.4%
Taylor expanded in t1 around 0 81.9%
associate-*r/81.9%
mul-1-neg81.9%
Simplified81.9%
if -1.29999999999999997e-49 < u < 4.1000000000000004e-34Initial program 63.0%
associate-*l/73.7%
*-commutative73.7%
Simplified73.7%
Taylor expanded in t1 around inf 80.7%
associate-*r/80.7%
neg-mul-180.7%
Simplified80.7%
Final simplification81.3%
(FPCore (u v t1) :precision binary64 (if (or (<= t1 -3e+22) (not (<= t1 2.5e-119))) (/ v (- u t1)) (* (/ t1 (- u)) (/ v u))))
double code(double u, double v, double t1) {
double tmp;
if ((t1 <= -3e+22) || !(t1 <= 2.5e-119)) {
tmp = v / (u - 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 <= (-3d+22)) .or. (.not. (t1 <= 2.5d-119))) then
tmp = v / (u - 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 <= -3e+22) || !(t1 <= 2.5e-119)) {
tmp = v / (u - t1);
} else {
tmp = (t1 / -u) * (v / u);
}
return tmp;
}
def code(u, v, t1): tmp = 0 if (t1 <= -3e+22) or not (t1 <= 2.5e-119): tmp = v / (u - t1) else: tmp = (t1 / -u) * (v / u) return tmp
function code(u, v, t1) tmp = 0.0 if ((t1 <= -3e+22) || !(t1 <= 2.5e-119)) tmp = Float64(v / Float64(u - t1)); else tmp = Float64(Float64(t1 / Float64(-u)) * Float64(v / u)); end return tmp end
function tmp_2 = code(u, v, t1) tmp = 0.0; if ((t1 <= -3e+22) || ~((t1 <= 2.5e-119))) tmp = v / (u - t1); else tmp = (t1 / -u) * (v / u); end tmp_2 = tmp; end
code[u_, v_, t1_] := If[Or[LessEqual[t1, -3e+22], N[Not[LessEqual[t1, 2.5e-119]], $MachinePrecision]], N[(v / N[(u - t1), $MachinePrecision]), $MachinePrecision], N[(N[(t1 / (-u)), $MachinePrecision] * N[(v / u), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t1 \leq -3 \cdot 10^{+22} \lor \neg \left(t1 \leq 2.5 \cdot 10^{-119}\right):\\
\;\;\;\;\frac{v}{u - t1}\\
\mathbf{else}:\\
\;\;\;\;\frac{t1}{-u} \cdot \frac{v}{u}\\
\end{array}
\end{array}
if t1 < -3e22 or 2.49999999999999996e-119 < t1 Initial program 68.4%
times-frac100.0%
distribute-frac-neg100.0%
distribute-neg-frac2100.0%
+-commutative100.0%
distribute-neg-in100.0%
unsub-neg100.0%
Simplified100.0%
Taylor expanded in t1 around inf 83.3%
mul-1-neg83.3%
frac-2neg83.3%
distribute-neg-frac283.3%
add-sqr-sqrt37.4%
sqrt-unprod41.4%
sqr-neg41.4%
sqrt-unprod16.6%
add-sqr-sqrt28.4%
distribute-neg-in28.4%
add-sqr-sqrt11.7%
sqrt-unprod49.8%
sqr-neg49.8%
sqrt-unprod45.2%
add-sqr-sqrt83.5%
sub-neg83.5%
Applied egg-rr83.5%
sub-neg83.5%
distribute-neg-in83.5%
remove-double-neg83.5%
Simplified83.5%
Taylor expanded in v around 0 83.5%
if -3e22 < t1 < 2.49999999999999996e-119Initial program 77.7%
times-frac97.7%
distribute-frac-neg97.7%
distribute-neg-frac297.7%
+-commutative97.7%
distribute-neg-in97.7%
unsub-neg97.7%
Simplified97.7%
Taylor expanded in t1 around 0 76.5%
associate-*r/76.5%
mul-1-neg76.5%
Simplified76.5%
Taylor expanded in t1 around 0 77.7%
Final simplification80.9%
(FPCore (u v t1) :precision binary64 (if (or (<= t1 -1.4e+18) (not (<= t1 1.6e-121))) (/ v (- u t1)) (* t1 (/ (/ v u) (- u)))))
double code(double u, double v, double t1) {
double tmp;
if ((t1 <= -1.4e+18) || !(t1 <= 1.6e-121)) {
tmp = v / (u - t1);
} else {
tmp = t1 * ((v / 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 <= (-1.4d+18)) .or. (.not. (t1 <= 1.6d-121))) then
tmp = v / (u - t1)
else
tmp = t1 * ((v / u) / -u)
end if
code = tmp
end function
public static double code(double u, double v, double t1) {
double tmp;
if ((t1 <= -1.4e+18) || !(t1 <= 1.6e-121)) {
tmp = v / (u - t1);
} else {
tmp = t1 * ((v / u) / -u);
}
return tmp;
}
def code(u, v, t1): tmp = 0 if (t1 <= -1.4e+18) or not (t1 <= 1.6e-121): tmp = v / (u - t1) else: tmp = t1 * ((v / u) / -u) return tmp
function code(u, v, t1) tmp = 0.0 if ((t1 <= -1.4e+18) || !(t1 <= 1.6e-121)) tmp = Float64(v / Float64(u - t1)); else tmp = Float64(t1 * Float64(Float64(v / u) / Float64(-u))); end return tmp end
function tmp_2 = code(u, v, t1) tmp = 0.0; if ((t1 <= -1.4e+18) || ~((t1 <= 1.6e-121))) tmp = v / (u - t1); else tmp = t1 * ((v / u) / -u); end tmp_2 = tmp; end
code[u_, v_, t1_] := If[Or[LessEqual[t1, -1.4e+18], N[Not[LessEqual[t1, 1.6e-121]], $MachinePrecision]], N[(v / N[(u - t1), $MachinePrecision]), $MachinePrecision], N[(t1 * N[(N[(v / u), $MachinePrecision] / (-u)), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t1 \leq -1.4 \cdot 10^{+18} \lor \neg \left(t1 \leq 1.6 \cdot 10^{-121}\right):\\
\;\;\;\;\frac{v}{u - t1}\\
\mathbf{else}:\\
\;\;\;\;t1 \cdot \frac{\frac{v}{u}}{-u}\\
\end{array}
\end{array}
if t1 < -1.4e18 or 1.60000000000000009e-121 < t1 Initial program 68.4%
times-frac100.0%
distribute-frac-neg100.0%
distribute-neg-frac2100.0%
+-commutative100.0%
distribute-neg-in100.0%
unsub-neg100.0%
Simplified100.0%
Taylor expanded in t1 around inf 83.3%
mul-1-neg83.3%
frac-2neg83.3%
distribute-neg-frac283.3%
add-sqr-sqrt37.4%
sqrt-unprod41.4%
sqr-neg41.4%
sqrt-unprod16.6%
add-sqr-sqrt28.4%
distribute-neg-in28.4%
add-sqr-sqrt11.7%
sqrt-unprod49.8%
sqr-neg49.8%
sqrt-unprod45.2%
add-sqr-sqrt83.5%
sub-neg83.5%
Applied egg-rr83.5%
sub-neg83.5%
distribute-neg-in83.5%
remove-double-neg83.5%
Simplified83.5%
Taylor expanded in v around 0 83.5%
if -1.4e18 < t1 < 1.60000000000000009e-121Initial program 77.7%
associate-/l*83.0%
Simplified83.0%
Taylor expanded in t1 around 0 66.8%
Taylor expanded in t1 around 0 68.0%
associate-/r*74.0%
div-inv74.0%
Applied egg-rr74.0%
associate-*r/74.0%
*-rgt-identity74.0%
Simplified74.0%
Final simplification79.2%
(FPCore (u v t1) :precision binary64 (if (or (<= u -5e-46) (not (<= u 1.3e-33))) (* t1 (/ v (* u (- u)))) (/ v (- t1))))
double code(double u, double v, double t1) {
double tmp;
if ((u <= -5e-46) || !(u <= 1.3e-33)) {
tmp = t1 * (v / (u * -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 <= (-5d-46)) .or. (.not. (u <= 1.3d-33))) then
tmp = t1 * (v / (u * -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 <= -5e-46) || !(u <= 1.3e-33)) {
tmp = t1 * (v / (u * -u));
} else {
tmp = v / -t1;
}
return tmp;
}
def code(u, v, t1): tmp = 0 if (u <= -5e-46) or not (u <= 1.3e-33): tmp = t1 * (v / (u * -u)) else: tmp = v / -t1 return tmp
function code(u, v, t1) tmp = 0.0 if ((u <= -5e-46) || !(u <= 1.3e-33)) tmp = Float64(t1 * Float64(v / Float64(u * Float64(-u)))); else tmp = Float64(v / Float64(-t1)); end return tmp end
function tmp_2 = code(u, v, t1) tmp = 0.0; if ((u <= -5e-46) || ~((u <= 1.3e-33))) tmp = t1 * (v / (u * -u)); else tmp = v / -t1; end tmp_2 = tmp; end
code[u_, v_, t1_] := If[Or[LessEqual[u, -5e-46], N[Not[LessEqual[u, 1.3e-33]], $MachinePrecision]], N[(t1 * N[(v / N[(u * (-u)), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(v / (-t1)), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;u \leq -5 \cdot 10^{-46} \lor \neg \left(u \leq 1.3 \cdot 10^{-33}\right):\\
\;\;\;\;t1 \cdot \frac{v}{u \cdot \left(-u\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{v}{-t1}\\
\end{array}
\end{array}
if u < -4.99999999999999992e-46 or 1.29999999999999997e-33 < u Initial program 81.6%
associate-/l*83.4%
Simplified83.4%
Taylor expanded in t1 around 0 76.7%
Taylor expanded in t1 around 0 73.3%
if -4.99999999999999992e-46 < u < 1.29999999999999997e-33Initial program 63.0%
associate-*l/73.7%
*-commutative73.7%
Simplified73.7%
Taylor expanded in t1 around inf 80.7%
associate-*r/80.7%
neg-mul-180.7%
Simplified80.7%
Final simplification76.9%
(FPCore (u v t1) :precision binary64 (if (or (<= u -1.65e+181) (not (<= u 6.8e+202))) (/ v (* u (/ u t1))) (/ v (- u t1))))
double code(double u, double v, double t1) {
double tmp;
if ((u <= -1.65e+181) || !(u <= 6.8e+202)) {
tmp = v / (u * (u / t1));
} else {
tmp = v / (u - 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 <= (-1.65d+181)) .or. (.not. (u <= 6.8d+202))) then
tmp = v / (u * (u / t1))
else
tmp = v / (u - t1)
end if
code = tmp
end function
public static double code(double u, double v, double t1) {
double tmp;
if ((u <= -1.65e+181) || !(u <= 6.8e+202)) {
tmp = v / (u * (u / t1));
} else {
tmp = v / (u - t1);
}
return tmp;
}
def code(u, v, t1): tmp = 0 if (u <= -1.65e+181) or not (u <= 6.8e+202): tmp = v / (u * (u / t1)) else: tmp = v / (u - t1) return tmp
function code(u, v, t1) tmp = 0.0 if ((u <= -1.65e+181) || !(u <= 6.8e+202)) tmp = Float64(v / Float64(u * Float64(u / t1))); else tmp = Float64(v / Float64(u - t1)); end return tmp end
function tmp_2 = code(u, v, t1) tmp = 0.0; if ((u <= -1.65e+181) || ~((u <= 6.8e+202))) tmp = v / (u * (u / t1)); else tmp = v / (u - t1); end tmp_2 = tmp; end
code[u_, v_, t1_] := If[Or[LessEqual[u, -1.65e+181], N[Not[LessEqual[u, 6.8e+202]], $MachinePrecision]], N[(v / N[(u * N[(u / t1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(v / N[(u - t1), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;u \leq -1.65 \cdot 10^{+181} \lor \neg \left(u \leq 6.8 \cdot 10^{+202}\right):\\
\;\;\;\;\frac{v}{u \cdot \frac{u}{t1}}\\
\mathbf{else}:\\
\;\;\;\;\frac{v}{u - t1}\\
\end{array}
\end{array}
if u < -1.65000000000000008e181 or 6.8e202 < u Initial program 84.2%
times-frac99.3%
distribute-frac-neg99.3%
distribute-neg-frac299.3%
+-commutative99.3%
distribute-neg-in99.3%
unsub-neg99.3%
Simplified99.3%
Taylor expanded in t1 around 0 95.9%
associate-*r/95.9%
mul-1-neg95.9%
Simplified95.9%
Taylor expanded in t1 around 0 95.8%
clear-num95.7%
frac-times89.5%
*-un-lft-identity89.5%
add-sqr-sqrt40.0%
sqrt-unprod72.8%
sqr-neg72.8%
sqrt-unprod49.5%
add-sqr-sqrt84.3%
Applied egg-rr84.3%
if -1.65000000000000008e181 < u < 6.8e202Initial program 70.1%
times-frac98.9%
distribute-frac-neg98.9%
distribute-neg-frac298.9%
+-commutative98.9%
distribute-neg-in98.9%
unsub-neg98.9%
Simplified98.9%
Taylor expanded in t1 around inf 63.2%
mul-1-neg63.2%
frac-2neg63.2%
distribute-neg-frac263.2%
add-sqr-sqrt29.5%
sqrt-unprod32.7%
sqr-neg32.7%
sqrt-unprod9.9%
add-sqr-sqrt16.5%
distribute-neg-in16.5%
add-sqr-sqrt8.1%
sqrt-unprod32.6%
sqr-neg32.6%
sqrt-unprod29.3%
add-sqr-sqrt64.4%
sub-neg64.4%
Applied egg-rr64.4%
sub-neg64.4%
distribute-neg-in64.4%
remove-double-neg64.4%
Simplified64.4%
Taylor expanded in v around 0 64.4%
Final simplification67.8%
(FPCore (u v t1) :precision binary64 (if (<= t1 -1.2e+198) (/ v (- u t1)) (* t1 (/ (/ v (+ t1 u)) (- (- u) t1)))))
double code(double u, double v, double t1) {
double tmp;
if (t1 <= -1.2e+198) {
tmp = v / (u - t1);
} else {
tmp = t1 * ((v / (t1 + u)) / (-u - 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 (t1 <= (-1.2d+198)) then
tmp = v / (u - t1)
else
tmp = t1 * ((v / (t1 + u)) / (-u - t1))
end if
code = tmp
end function
public static double code(double u, double v, double t1) {
double tmp;
if (t1 <= -1.2e+198) {
tmp = v / (u - t1);
} else {
tmp = t1 * ((v / (t1 + u)) / (-u - t1));
}
return tmp;
}
def code(u, v, t1): tmp = 0 if t1 <= -1.2e+198: tmp = v / (u - t1) else: tmp = t1 * ((v / (t1 + u)) / (-u - t1)) return tmp
function code(u, v, t1) tmp = 0.0 if (t1 <= -1.2e+198) tmp = Float64(v / Float64(u - t1)); else tmp = Float64(t1 * Float64(Float64(v / Float64(t1 + u)) / Float64(Float64(-u) - t1))); end return tmp end
function tmp_2 = code(u, v, t1) tmp = 0.0; if (t1 <= -1.2e+198) tmp = v / (u - t1); else tmp = t1 * ((v / (t1 + u)) / (-u - t1)); end tmp_2 = tmp; end
code[u_, v_, t1_] := If[LessEqual[t1, -1.2e+198], N[(v / N[(u - t1), $MachinePrecision]), $MachinePrecision], N[(t1 * N[(N[(v / N[(t1 + u), $MachinePrecision]), $MachinePrecision] / N[((-u) - t1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t1 \leq -1.2 \cdot 10^{+198}:\\
\;\;\;\;\frac{v}{u - t1}\\
\mathbf{else}:\\
\;\;\;\;t1 \cdot \frac{\frac{v}{t1 + u}}{\left(-u\right) - t1}\\
\end{array}
\end{array}
if t1 < -1.2000000000000001e198Initial program 34.2%
times-frac100.0%
distribute-frac-neg100.0%
distribute-neg-frac2100.0%
+-commutative100.0%
distribute-neg-in100.0%
unsub-neg100.0%
Simplified100.0%
Taylor expanded in t1 around inf 96.4%
mul-1-neg96.4%
frac-2neg96.4%
distribute-neg-frac296.4%
add-sqr-sqrt38.4%
sqrt-unprod51.7%
sqr-neg51.7%
sqrt-unprod24.2%
add-sqr-sqrt35.7%
distribute-neg-in35.7%
add-sqr-sqrt35.7%
sqrt-unprod36.5%
sqr-neg36.5%
sqrt-unprod0.0%
add-sqr-sqrt96.6%
sub-neg96.6%
Applied egg-rr96.6%
sub-neg96.6%
distribute-neg-in96.6%
remove-double-neg96.6%
Simplified96.6%
Taylor expanded in v around 0 96.6%
if -1.2000000000000001e198 < t1 Initial program 76.9%
associate-/l*81.9%
Simplified81.9%
associate-/r*92.6%
div-inv92.5%
Applied egg-rr92.5%
associate-*r/92.6%
*-rgt-identity92.6%
Simplified92.6%
Final simplification93.0%
(FPCore (u v t1) :precision binary64 (if (or (<= u -2.4e+181) (not (<= u 8.8e+198))) (/ v u) (/ v (- t1))))
double code(double u, double v, double t1) {
double tmp;
if ((u <= -2.4e+181) || !(u <= 8.8e+198)) {
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 <= (-2.4d+181)) .or. (.not. (u <= 8.8d+198))) 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 <= -2.4e+181) || !(u <= 8.8e+198)) {
tmp = v / u;
} else {
tmp = v / -t1;
}
return tmp;
}
def code(u, v, t1): tmp = 0 if (u <= -2.4e+181) or not (u <= 8.8e+198): tmp = v / u else: tmp = v / -t1 return tmp
function code(u, v, t1) tmp = 0.0 if ((u <= -2.4e+181) || !(u <= 8.8e+198)) tmp = Float64(v / u); else tmp = Float64(v / Float64(-t1)); end return tmp end
function tmp_2 = code(u, v, t1) tmp = 0.0; if ((u <= -2.4e+181) || ~((u <= 8.8e+198))) tmp = v / u; else tmp = v / -t1; end tmp_2 = tmp; end
code[u_, v_, t1_] := If[Or[LessEqual[u, -2.4e+181], N[Not[LessEqual[u, 8.8e+198]], $MachinePrecision]], N[(v / u), $MachinePrecision], N[(v / (-t1)), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;u \leq -2.4 \cdot 10^{+181} \lor \neg \left(u \leq 8.8 \cdot 10^{+198}\right):\\
\;\;\;\;\frac{v}{u}\\
\mathbf{else}:\\
\;\;\;\;\frac{v}{-t1}\\
\end{array}
\end{array}
if u < -2.40000000000000002e181 or 8.7999999999999998e198 < u Initial program 84.6%
times-frac99.3%
distribute-frac-neg99.3%
distribute-neg-frac299.3%
+-commutative99.3%
distribute-neg-in99.3%
unsub-neg99.3%
Simplified99.3%
Taylor expanded in t1 around inf 45.2%
mul-1-neg45.2%
frac-2neg45.2%
distribute-neg-frac245.2%
add-sqr-sqrt21.5%
sqrt-unprod44.8%
sqr-neg44.8%
sqrt-unprod23.7%
add-sqr-sqrt43.2%
distribute-neg-in43.2%
add-sqr-sqrt19.7%
sqrt-unprod43.2%
sqr-neg43.2%
sqrt-unprod23.5%
add-sqr-sqrt45.3%
sub-neg45.3%
Applied egg-rr45.3%
sub-neg45.3%
distribute-neg-in45.3%
remove-double-neg45.3%
Simplified45.3%
Taylor expanded in t1 around 0 43.2%
if -2.40000000000000002e181 < u < 8.7999999999999998e198Initial program 70.0%
associate-*l/75.6%
*-commutative75.6%
Simplified75.6%
Taylor expanded in t1 around inf 62.6%
associate-*r/62.6%
neg-mul-162.6%
Simplified62.6%
Final simplification59.2%
(FPCore (u v t1) :precision binary64 (if (<= u -1.9e+181) (/ v (- u)) (if (<= u 2.5e+200) (/ v (- t1)) (/ v u))))
double code(double u, double v, double t1) {
double tmp;
if (u <= -1.9e+181) {
tmp = v / -u;
} else if (u <= 2.5e+200) {
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.9d+181)) then
tmp = v / -u
else if (u <= 2.5d+200) 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.9e+181) {
tmp = v / -u;
} else if (u <= 2.5e+200) {
tmp = v / -t1;
} else {
tmp = v / u;
}
return tmp;
}
def code(u, v, t1): tmp = 0 if u <= -1.9e+181: tmp = v / -u elif u <= 2.5e+200: tmp = v / -t1 else: tmp = v / u return tmp
function code(u, v, t1) tmp = 0.0 if (u <= -1.9e+181) tmp = Float64(v / Float64(-u)); elseif (u <= 2.5e+200) tmp = Float64(v / Float64(-t1)); else tmp = Float64(v / u); end return tmp end
function tmp_2 = code(u, v, t1) tmp = 0.0; if (u <= -1.9e+181) tmp = v / -u; elseif (u <= 2.5e+200) tmp = v / -t1; else tmp = v / u; end tmp_2 = tmp; end
code[u_, v_, t1_] := If[LessEqual[u, -1.9e+181], N[(v / (-u)), $MachinePrecision], If[LessEqual[u, 2.5e+200], N[(v / (-t1)), $MachinePrecision], N[(v / u), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;u \leq -1.9 \cdot 10^{+181}:\\
\;\;\;\;\frac{v}{-u}\\
\mathbf{elif}\;u \leq 2.5 \cdot 10^{+200}:\\
\;\;\;\;\frac{v}{-t1}\\
\mathbf{else}:\\
\;\;\;\;\frac{v}{u}\\
\end{array}
\end{array}
if u < -1.9000000000000001e181Initial program 86.9%
times-frac100.0%
distribute-frac-neg100.0%
distribute-neg-frac2100.0%
+-commutative100.0%
distribute-neg-in100.0%
unsub-neg100.0%
Simplified100.0%
Taylor expanded in t1 around inf 41.3%
Taylor expanded in t1 around 0 38.2%
associate-*r/38.2%
mul-1-neg38.2%
Simplified38.2%
if -1.9000000000000001e181 < u < 2.50000000000000009e200Initial program 70.3%
associate-*l/75.9%
*-commutative75.9%
Simplified75.9%
Taylor expanded in t1 around inf 62.9%
associate-*r/62.9%
neg-mul-162.9%
Simplified62.9%
if 2.50000000000000009e200 < u Initial program 75.9%
times-frac98.1%
distribute-frac-neg98.1%
distribute-neg-frac298.1%
+-commutative98.1%
distribute-neg-in98.1%
unsub-neg98.1%
Simplified98.1%
Taylor expanded in t1 around inf 49.4%
mul-1-neg49.4%
frac-2neg49.4%
distribute-neg-frac249.4%
add-sqr-sqrt13.7%
sqrt-unprod48.9%
sqr-neg48.9%
sqrt-unprod35.7%
add-sqr-sqrt50.0%
distribute-neg-in50.0%
add-sqr-sqrt19.9%
sqrt-unprod49.7%
sqr-neg49.7%
sqrt-unprod30.1%
add-sqr-sqrt50.0%
sub-neg50.0%
Applied egg-rr50.0%
sub-neg50.0%
distribute-neg-in50.0%
remove-double-neg50.0%
Simplified50.0%
Taylor expanded in t1 around 0 50.0%
Final simplification59.2%
(FPCore (u v t1) :precision binary64 (if (or (<= t1 -7.4e+205) (not (<= t1 2.6e+76))) (/ v t1) (/ v u)))
double code(double u, double v, double t1) {
double tmp;
if ((t1 <= -7.4e+205) || !(t1 <= 2.6e+76)) {
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 ((t1 <= (-7.4d+205)) .or. (.not. (t1 <= 2.6d+76))) 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 ((t1 <= -7.4e+205) || !(t1 <= 2.6e+76)) {
tmp = v / t1;
} else {
tmp = v / u;
}
return tmp;
}
def code(u, v, t1): tmp = 0 if (t1 <= -7.4e+205) or not (t1 <= 2.6e+76): tmp = v / t1 else: tmp = v / u return tmp
function code(u, v, t1) tmp = 0.0 if ((t1 <= -7.4e+205) || !(t1 <= 2.6e+76)) tmp = Float64(v / t1); else tmp = Float64(v / u); end return tmp end
function tmp_2 = code(u, v, t1) tmp = 0.0; if ((t1 <= -7.4e+205) || ~((t1 <= 2.6e+76))) tmp = v / t1; else tmp = v / u; end tmp_2 = tmp; end
code[u_, v_, t1_] := If[Or[LessEqual[t1, -7.4e+205], N[Not[LessEqual[t1, 2.6e+76]], $MachinePrecision]], N[(v / t1), $MachinePrecision], N[(v / u), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t1 \leq -7.4 \cdot 10^{+205} \lor \neg \left(t1 \leq 2.6 \cdot 10^{+76}\right):\\
\;\;\;\;\frac{v}{t1}\\
\mathbf{else}:\\
\;\;\;\;\frac{v}{u}\\
\end{array}
\end{array}
if t1 < -7.39999999999999961e205 or 2.5999999999999999e76 < t1 Initial program 54.9%
associate-*l/57.7%
*-commutative57.7%
Simplified57.7%
Taylor expanded in t1 around inf 97.1%
associate-*r/97.1%
neg-mul-197.1%
Simplified97.1%
neg-sub097.1%
sub-neg97.1%
add-sqr-sqrt38.7%
sqrt-unprod54.6%
sqr-neg54.6%
sqrt-unprod26.7%
add-sqr-sqrt39.7%
Applied egg-rr39.7%
+-lft-identity39.7%
Simplified39.7%
if -7.39999999999999961e205 < t1 < 2.5999999999999999e76Initial program 78.2%
times-frac98.6%
distribute-frac-neg98.6%
distribute-neg-frac298.6%
+-commutative98.6%
distribute-neg-in98.6%
unsub-neg98.6%
Simplified98.6%
Taylor expanded in t1 around inf 48.0%
mul-1-neg48.0%
frac-2neg48.0%
distribute-neg-frac248.0%
add-sqr-sqrt24.9%
sqrt-unprod28.2%
sqr-neg28.2%
sqrt-unprod7.3%
add-sqr-sqrt14.7%
distribute-neg-in14.7%
add-sqr-sqrt8.2%
sqrt-unprod26.6%
sqr-neg26.6%
sqrt-unprod18.5%
add-sqr-sqrt49.4%
sub-neg49.4%
Applied egg-rr49.4%
sub-neg49.4%
distribute-neg-in49.4%
remove-double-neg49.4%
Simplified49.4%
Taylor expanded in t1 around 0 15.4%
Final simplification21.3%
(FPCore (u v t1) :precision binary64 (/ v (- u t1)))
double code(double u, double v, double t1) {
return v / (u - t1);
}
real(8) function code(u, v, t1)
real(8), intent (in) :: u
real(8), intent (in) :: v
real(8), intent (in) :: t1
code = v / (u - t1)
end function
public static double code(double u, double v, double t1) {
return v / (u - t1);
}
def code(u, v, t1): return v / (u - t1)
function code(u, v, t1) return Float64(v / Float64(u - t1)) end
function tmp = code(u, v, t1) tmp = v / (u - t1); end
code[u_, v_, t1_] := N[(v / N[(u - t1), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{v}{u - t1}
\end{array}
Initial program 72.5%
times-frac98.9%
distribute-frac-neg98.9%
distribute-neg-frac298.9%
+-commutative98.9%
distribute-neg-in98.9%
unsub-neg98.9%
Simplified98.9%
Taylor expanded in t1 around inf 59.9%
mul-1-neg59.9%
frac-2neg59.9%
distribute-neg-frac259.9%
add-sqr-sqrt28.2%
sqrt-unprod34.5%
sqr-neg34.5%
sqrt-unprod12.0%
add-sqr-sqrt20.8%
distribute-neg-in20.8%
add-sqr-sqrt9.8%
sqrt-unprod34.2%
sqr-neg34.2%
sqrt-unprod28.4%
add-sqr-sqrt60.9%
sub-neg60.9%
Applied egg-rr60.9%
sub-neg60.9%
distribute-neg-in60.9%
remove-double-neg60.9%
Simplified60.9%
Taylor expanded in v around 0 60.9%
(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(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}
Initial program 72.5%
associate-*l/77.2%
*-commutative77.2%
Simplified77.2%
Taylor expanded in t1 around inf 54.2%
associate-*r/54.2%
neg-mul-154.2%
Simplified54.2%
neg-sub054.2%
sub-neg54.2%
add-sqr-sqrt25.5%
sqrt-unprod31.2%
sqr-neg31.2%
sqrt-unprod7.7%
add-sqr-sqrt12.6%
Applied egg-rr12.6%
+-lft-identity12.6%
Simplified12.6%
herbie shell --seed 2024139
(FPCore (u v t1)
:name "Rosa's DopplerBench"
:precision binary64
(/ (* (- t1) v) (* (+ t1 u) (+ t1 u))))