
(FPCore (x1 y1 x2 y2)
:precision binary64
(let* ((t_0 (* (* 128.0 128.0) 128.0)))
(*
(*
(* (/ (+ (* (/ x1 t_0) y1) (* (/ x2 t_0) y2)) (+ y1 y2)) 128.0)
128.0)
128.0)))double code(double x1, double y1, double x2, double y2) {
double t_0 = (128.0 * 128.0) * 128.0;
return ((((((x1 / t_0) * y1) + ((x2 / t_0) * y2)) / (y1 + y2)) * 128.0) * 128.0) * 128.0;
}
real(8) function code(x1, y1, x2, y2)
real(8), intent (in) :: x1
real(8), intent (in) :: y1
real(8), intent (in) :: x2
real(8), intent (in) :: y2
real(8) :: t_0
t_0 = (128.0d0 * 128.0d0) * 128.0d0
code = ((((((x1 / t_0) * y1) + ((x2 / t_0) * y2)) / (y1 + y2)) * 128.0d0) * 128.0d0) * 128.0d0
end function
public static double code(double x1, double y1, double x2, double y2) {
double t_0 = (128.0 * 128.0) * 128.0;
return ((((((x1 / t_0) * y1) + ((x2 / t_0) * y2)) / (y1 + y2)) * 128.0) * 128.0) * 128.0;
}
def code(x1, y1, x2, y2): t_0 = (128.0 * 128.0) * 128.0 return ((((((x1 / t_0) * y1) + ((x2 / t_0) * y2)) / (y1 + y2)) * 128.0) * 128.0) * 128.0
function code(x1, y1, x2, y2) t_0 = Float64(Float64(128.0 * 128.0) * 128.0) return Float64(Float64(Float64(Float64(Float64(Float64(Float64(x1 / t_0) * y1) + Float64(Float64(x2 / t_0) * y2)) / Float64(y1 + y2)) * 128.0) * 128.0) * 128.0) end
function tmp = code(x1, y1, x2, y2) t_0 = (128.0 * 128.0) * 128.0; tmp = ((((((x1 / t_0) * y1) + ((x2 / t_0) * y2)) / (y1 + y2)) * 128.0) * 128.0) * 128.0; end
code[x1_, y1_, x2_, y2_] := Block[{t$95$0 = N[(N[(128.0 * 128.0), $MachinePrecision] * 128.0), $MachinePrecision]}, N[(N[(N[(N[(N[(N[(N[(x1 / t$95$0), $MachinePrecision] * y1), $MachinePrecision] + N[(N[(x2 / t$95$0), $MachinePrecision] * y2), $MachinePrecision]), $MachinePrecision] / N[(y1 + y2), $MachinePrecision]), $MachinePrecision] * 128.0), $MachinePrecision] * 128.0), $MachinePrecision] * 128.0), $MachinePrecision]]
\begin{array}{l}
t_0 := \left(128 \cdot 128\right) \cdot 128\\
\left(\left(\frac{\frac{x1}{t\_0} \cdot y1 + \frac{x2}{t\_0} \cdot y2}{y1 + y2} \cdot 128\right) \cdot 128\right) \cdot 128
\end{array}
Herbie found 13 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x1 y1 x2 y2)
:precision binary64
(let* ((t_0 (* (* 128.0 128.0) 128.0)))
(*
(*
(* (/ (+ (* (/ x1 t_0) y1) (* (/ x2 t_0) y2)) (+ y1 y2)) 128.0)
128.0)
128.0)))double code(double x1, double y1, double x2, double y2) {
double t_0 = (128.0 * 128.0) * 128.0;
return ((((((x1 / t_0) * y1) + ((x2 / t_0) * y2)) / (y1 + y2)) * 128.0) * 128.0) * 128.0;
}
real(8) function code(x1, y1, x2, y2)
real(8), intent (in) :: x1
real(8), intent (in) :: y1
real(8), intent (in) :: x2
real(8), intent (in) :: y2
real(8) :: t_0
t_0 = (128.0d0 * 128.0d0) * 128.0d0
code = ((((((x1 / t_0) * y1) + ((x2 / t_0) * y2)) / (y1 + y2)) * 128.0d0) * 128.0d0) * 128.0d0
end function
public static double code(double x1, double y1, double x2, double y2) {
double t_0 = (128.0 * 128.0) * 128.0;
return ((((((x1 / t_0) * y1) + ((x2 / t_0) * y2)) / (y1 + y2)) * 128.0) * 128.0) * 128.0;
}
def code(x1, y1, x2, y2): t_0 = (128.0 * 128.0) * 128.0 return ((((((x1 / t_0) * y1) + ((x2 / t_0) * y2)) / (y1 + y2)) * 128.0) * 128.0) * 128.0
function code(x1, y1, x2, y2) t_0 = Float64(Float64(128.0 * 128.0) * 128.0) return Float64(Float64(Float64(Float64(Float64(Float64(Float64(x1 / t_0) * y1) + Float64(Float64(x2 / t_0) * y2)) / Float64(y1 + y2)) * 128.0) * 128.0) * 128.0) end
function tmp = code(x1, y1, x2, y2) t_0 = (128.0 * 128.0) * 128.0; tmp = ((((((x1 / t_0) * y1) + ((x2 / t_0) * y2)) / (y1 + y2)) * 128.0) * 128.0) * 128.0; end
code[x1_, y1_, x2_, y2_] := Block[{t$95$0 = N[(N[(128.0 * 128.0), $MachinePrecision] * 128.0), $MachinePrecision]}, N[(N[(N[(N[(N[(N[(N[(x1 / t$95$0), $MachinePrecision] * y1), $MachinePrecision] + N[(N[(x2 / t$95$0), $MachinePrecision] * y2), $MachinePrecision]), $MachinePrecision] / N[(y1 + y2), $MachinePrecision]), $MachinePrecision] * 128.0), $MachinePrecision] * 128.0), $MachinePrecision] * 128.0), $MachinePrecision]]
\begin{array}{l}
t_0 := \left(128 \cdot 128\right) \cdot 128\\
\left(\left(\frac{\frac{x1}{t\_0} \cdot y1 + \frac{x2}{t\_0} \cdot y2}{y1 + y2} \cdot 128\right) \cdot 128\right) \cdot 128
\end{array}
(FPCore (x1 y1 x2 y2)
:precision binary64
(*
(*
(*
(fma
(/ (* y2 4.76837158203125e-7) (+ y1 y2))
x2
(* (* x1 4.76837158203125e-7) (/ y1 (+ y1 y2))))
128.0)
128.0)
128.0))double code(double x1, double y1, double x2, double y2) {
return ((fma(((y2 * 4.76837158203125e-7) / (y1 + y2)), x2, ((x1 * 4.76837158203125e-7) * (y1 / (y1 + y2)))) * 128.0) * 128.0) * 128.0;
}
function code(x1, y1, x2, y2) return Float64(Float64(Float64(fma(Float64(Float64(y2 * 4.76837158203125e-7) / Float64(y1 + y2)), x2, Float64(Float64(x1 * 4.76837158203125e-7) * Float64(y1 / Float64(y1 + y2)))) * 128.0) * 128.0) * 128.0) end
code[x1_, y1_, x2_, y2_] := N[(N[(N[(N[(N[(N[(y2 * 4.76837158203125e-7), $MachinePrecision] / N[(y1 + y2), $MachinePrecision]), $MachinePrecision] * x2 + N[(N[(x1 * 4.76837158203125e-7), $MachinePrecision] * N[(y1 / N[(y1 + y2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * 128.0), $MachinePrecision] * 128.0), $MachinePrecision] * 128.0), $MachinePrecision]
\left(\left(\mathsf{fma}\left(\frac{y2 \cdot 4.76837158203125 \cdot 10^{-7}}{y1 + y2}, x2, \left(x1 \cdot 4.76837158203125 \cdot 10^{-7}\right) \cdot \frac{y1}{y1 + y2}\right) \cdot 128\right) \cdot 128\right) \cdot 128
Initial program 77.8%
lift-/.f64N/A
mult-flipN/A
*-commutativeN/A
lift-+.f64N/A
+-commutativeN/A
distribute-lft-inN/A
*-commutativeN/A
mult-flipN/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
*-commutativeN/A
mult-flipN/A
Applied rewrites99.6%
lift-fma.f64N/A
lift-*.f64N/A
associate-*r*N/A
lower-fma.f64N/A
lift-/.f64N/A
lift-+.f64N/A
+-commutativeN/A
lift-+.f64N/A
associate-*l/N/A
lower-/.f64N/A
lower-*.f6499.6%
lift-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
metadata-evalN/A
metadata-evalN/A
metadata-evalN/A
mult-flip-revN/A
lift-/.f64N/A
lift-+.f64N/A
+-commutativeN/A
lift-+.f64N/A
frac-timesN/A
Applied rewrites99.7%
(FPCore (x1 y1 x2 y2)
:precision binary64
(*
(*
(*
(fma
(/ y2 (+ y2 y1))
(* 4.76837158203125e-7 x2)
(* (* 4.76837158203125e-7 y1) (/ x1 (+ y2 y1))))
128.0)
128.0)
128.0))double code(double x1, double y1, double x2, double y2) {
return ((fma((y2 / (y2 + y1)), (4.76837158203125e-7 * x2), ((4.76837158203125e-7 * y1) * (x1 / (y2 + y1)))) * 128.0) * 128.0) * 128.0;
}
function code(x1, y1, x2, y2) return Float64(Float64(Float64(fma(Float64(y2 / Float64(y2 + y1)), Float64(4.76837158203125e-7 * x2), Float64(Float64(4.76837158203125e-7 * y1) * Float64(x1 / Float64(y2 + y1)))) * 128.0) * 128.0) * 128.0) end
code[x1_, y1_, x2_, y2_] := N[(N[(N[(N[(N[(y2 / N[(y2 + y1), $MachinePrecision]), $MachinePrecision] * N[(4.76837158203125e-7 * x2), $MachinePrecision] + N[(N[(4.76837158203125e-7 * y1), $MachinePrecision] * N[(x1 / N[(y2 + y1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * 128.0), $MachinePrecision] * 128.0), $MachinePrecision] * 128.0), $MachinePrecision]
\left(\left(\mathsf{fma}\left(\frac{y2}{y2 + y1}, 4.76837158203125 \cdot 10^{-7} \cdot x2, \left(4.76837158203125 \cdot 10^{-7} \cdot y1\right) \cdot \frac{x1}{y2 + y1}\right) \cdot 128\right) \cdot 128\right) \cdot 128
Initial program 77.8%
lift-/.f64N/A
mult-flipN/A
*-commutativeN/A
lift-+.f64N/A
+-commutativeN/A
distribute-lft-inN/A
*-commutativeN/A
mult-flipN/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
*-commutativeN/A
mult-flipN/A
Applied rewrites99.6%
(FPCore (x1 y1 x2 y2)
:precision binary64
(*
(*
(*
(fma
(/ y1 (+ y2 y1))
(* 4.76837158203125e-7 x1)
(* (* 4.76837158203125e-7 y2) (/ x2 (+ y2 y1))))
128.0)
128.0)
128.0))double code(double x1, double y1, double x2, double y2) {
return ((fma((y1 / (y2 + y1)), (4.76837158203125e-7 * x1), ((4.76837158203125e-7 * y2) * (x2 / (y2 + y1)))) * 128.0) * 128.0) * 128.0;
}
function code(x1, y1, x2, y2) return Float64(Float64(Float64(fma(Float64(y1 / Float64(y2 + y1)), Float64(4.76837158203125e-7 * x1), Float64(Float64(4.76837158203125e-7 * y2) * Float64(x2 / Float64(y2 + y1)))) * 128.0) * 128.0) * 128.0) end
code[x1_, y1_, x2_, y2_] := N[(N[(N[(N[(N[(y1 / N[(y2 + y1), $MachinePrecision]), $MachinePrecision] * N[(4.76837158203125e-7 * x1), $MachinePrecision] + N[(N[(4.76837158203125e-7 * y2), $MachinePrecision] * N[(x2 / N[(y2 + y1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * 128.0), $MachinePrecision] * 128.0), $MachinePrecision] * 128.0), $MachinePrecision]
\left(\left(\mathsf{fma}\left(\frac{y1}{y2 + y1}, 4.76837158203125 \cdot 10^{-7} \cdot x1, \left(4.76837158203125 \cdot 10^{-7} \cdot y2\right) \cdot \frac{x2}{y2 + y1}\right) \cdot 128\right) \cdot 128\right) \cdot 128
Initial program 77.8%
lift-/.f64N/A
lift-+.f64N/A
div-addN/A
mult-flipN/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
mult-flipN/A
lower-fma.f64N/A
Applied rewrites99.6%
(FPCore (x1 y1 x2 y2)
:precision binary64
(let* ((t_0 (* (* 128.0 128.0) 128.0)))
(if (<=
(*
(*
(*
(/ (+ (* (/ x1 t_0) y1) (* (/ x2 t_0) y2)) (+ y1 y2))
128.0)
128.0)
128.0)
0.0)
(*
(*
(*
(fma
1.0
(* 4.76837158203125e-7 x2)
(* (* 4.76837158203125e-7 y1) (/ x1 (+ y2 y1))))
128.0)
128.0)
128.0)
(+ (/ (* x1 y1) (+ y1 y2)) (/ (* x2 y2) (+ y1 y2))))))double code(double x1, double y1, double x2, double y2) {
double t_0 = (128.0 * 128.0) * 128.0;
double tmp;
if ((((((((x1 / t_0) * y1) + ((x2 / t_0) * y2)) / (y1 + y2)) * 128.0) * 128.0) * 128.0) <= 0.0) {
tmp = ((fma(1.0, (4.76837158203125e-7 * x2), ((4.76837158203125e-7 * y1) * (x1 / (y2 + y1)))) * 128.0) * 128.0) * 128.0;
} else {
tmp = ((x1 * y1) / (y1 + y2)) + ((x2 * y2) / (y1 + y2));
}
return tmp;
}
function code(x1, y1, x2, y2) t_0 = Float64(Float64(128.0 * 128.0) * 128.0) tmp = 0.0 if (Float64(Float64(Float64(Float64(Float64(Float64(Float64(x1 / t_0) * y1) + Float64(Float64(x2 / t_0) * y2)) / Float64(y1 + y2)) * 128.0) * 128.0) * 128.0) <= 0.0) tmp = Float64(Float64(Float64(fma(1.0, Float64(4.76837158203125e-7 * x2), Float64(Float64(4.76837158203125e-7 * y1) * Float64(x1 / Float64(y2 + y1)))) * 128.0) * 128.0) * 128.0); else tmp = Float64(Float64(Float64(x1 * y1) / Float64(y1 + y2)) + Float64(Float64(x2 * y2) / Float64(y1 + y2))); end return tmp end
code[x1_, y1_, x2_, y2_] := Block[{t$95$0 = N[(N[(128.0 * 128.0), $MachinePrecision] * 128.0), $MachinePrecision]}, If[LessEqual[N[(N[(N[(N[(N[(N[(N[(x1 / t$95$0), $MachinePrecision] * y1), $MachinePrecision] + N[(N[(x2 / t$95$0), $MachinePrecision] * y2), $MachinePrecision]), $MachinePrecision] / N[(y1 + y2), $MachinePrecision]), $MachinePrecision] * 128.0), $MachinePrecision] * 128.0), $MachinePrecision] * 128.0), $MachinePrecision], 0.0], N[(N[(N[(N[(1.0 * N[(4.76837158203125e-7 * x2), $MachinePrecision] + N[(N[(4.76837158203125e-7 * y1), $MachinePrecision] * N[(x1 / N[(y2 + y1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * 128.0), $MachinePrecision] * 128.0), $MachinePrecision] * 128.0), $MachinePrecision], N[(N[(N[(x1 * y1), $MachinePrecision] / N[(y1 + y2), $MachinePrecision]), $MachinePrecision] + N[(N[(x2 * y2), $MachinePrecision] / N[(y1 + y2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
t_0 := \left(128 \cdot 128\right) \cdot 128\\
\mathbf{if}\;\left(\left(\frac{\frac{x1}{t\_0} \cdot y1 + \frac{x2}{t\_0} \cdot y2}{y1 + y2} \cdot 128\right) \cdot 128\right) \cdot 128 \leq 0:\\
\;\;\;\;\left(\left(\mathsf{fma}\left(1, 4.76837158203125 \cdot 10^{-7} \cdot x2, \left(4.76837158203125 \cdot 10^{-7} \cdot y1\right) \cdot \frac{x1}{y2 + y1}\right) \cdot 128\right) \cdot 128\right) \cdot 128\\
\mathbf{else}:\\
\;\;\;\;\frac{x1 \cdot y1}{y1 + y2} + \frac{x2 \cdot y2}{y1 + y2}\\
\end{array}
if (*.f64 (*.f64 (*.f64 (/.f64 (+.f64 (*.f64 (/.f64 x1 (*.f64 (*.f64 #s(literal 128 binary64) #s(literal 128 binary64)) #s(literal 128 binary64))) y1) (*.f64 (/.f64 x2 (*.f64 (*.f64 #s(literal 128 binary64) #s(literal 128 binary64)) #s(literal 128 binary64))) y2)) (+.f64 y1 y2)) #s(literal 128 binary64)) #s(literal 128 binary64)) #s(literal 128 binary64)) < 0.0Initial program 77.8%
lift-/.f64N/A
mult-flipN/A
*-commutativeN/A
lift-+.f64N/A
+-commutativeN/A
distribute-lft-inN/A
*-commutativeN/A
mult-flipN/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
*-commutativeN/A
mult-flipN/A
Applied rewrites99.6%
Taylor expanded in y1 around 0
Applied rewrites74.8%
if 0.0 < (*.f64 (*.f64 (*.f64 (/.f64 (+.f64 (*.f64 (/.f64 x1 (*.f64 (*.f64 #s(literal 128 binary64) #s(literal 128 binary64)) #s(literal 128 binary64))) y1) (*.f64 (/.f64 x2 (*.f64 (*.f64 #s(literal 128 binary64) #s(literal 128 binary64)) #s(literal 128 binary64))) y2)) (+.f64 y1 y2)) #s(literal 128 binary64)) #s(literal 128 binary64)) #s(literal 128 binary64)) Initial program 77.8%
Taylor expanded in x1 around 0
lower-+.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-+.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-+.f6479.5%
Applied rewrites79.5%
(FPCore (x1 y1 x2 y2)
:precision binary64
(let* ((t_0 (* (* 128.0 128.0) 128.0)))
(if (<=
(*
(*
(*
(/ (+ (* (/ x1 t_0) y1) (* (/ x2 t_0) y2)) (+ y1 y2))
128.0)
128.0)
128.0)
2e-265)
(* (/ y1 (+ y1 y2)) x1)
(+ (/ (* x1 y1) (+ y1 y2)) (/ (* x2 y2) (+ y1 y2))))))double code(double x1, double y1, double x2, double y2) {
double t_0 = (128.0 * 128.0) * 128.0;
double tmp;
if ((((((((x1 / t_0) * y1) + ((x2 / t_0) * y2)) / (y1 + y2)) * 128.0) * 128.0) * 128.0) <= 2e-265) {
tmp = (y1 / (y1 + y2)) * x1;
} else {
tmp = ((x1 * y1) / (y1 + y2)) + ((x2 * y2) / (y1 + y2));
}
return tmp;
}
real(8) function code(x1, y1, x2, y2)
real(8), intent (in) :: x1
real(8), intent (in) :: y1
real(8), intent (in) :: x2
real(8), intent (in) :: y2
real(8) :: t_0
real(8) :: tmp
t_0 = (128.0d0 * 128.0d0) * 128.0d0
if ((((((((x1 / t_0) * y1) + ((x2 / t_0) * y2)) / (y1 + y2)) * 128.0d0) * 128.0d0) * 128.0d0) <= 2d-265) then
tmp = (y1 / (y1 + y2)) * x1
else
tmp = ((x1 * y1) / (y1 + y2)) + ((x2 * y2) / (y1 + y2))
end if
code = tmp
end function
public static double code(double x1, double y1, double x2, double y2) {
double t_0 = (128.0 * 128.0) * 128.0;
double tmp;
if ((((((((x1 / t_0) * y1) + ((x2 / t_0) * y2)) / (y1 + y2)) * 128.0) * 128.0) * 128.0) <= 2e-265) {
tmp = (y1 / (y1 + y2)) * x1;
} else {
tmp = ((x1 * y1) / (y1 + y2)) + ((x2 * y2) / (y1 + y2));
}
return tmp;
}
def code(x1, y1, x2, y2): t_0 = (128.0 * 128.0) * 128.0 tmp = 0 if (((((((x1 / t_0) * y1) + ((x2 / t_0) * y2)) / (y1 + y2)) * 128.0) * 128.0) * 128.0) <= 2e-265: tmp = (y1 / (y1 + y2)) * x1 else: tmp = ((x1 * y1) / (y1 + y2)) + ((x2 * y2) / (y1 + y2)) return tmp
function code(x1, y1, x2, y2) t_0 = Float64(Float64(128.0 * 128.0) * 128.0) tmp = 0.0 if (Float64(Float64(Float64(Float64(Float64(Float64(Float64(x1 / t_0) * y1) + Float64(Float64(x2 / t_0) * y2)) / Float64(y1 + y2)) * 128.0) * 128.0) * 128.0) <= 2e-265) tmp = Float64(Float64(y1 / Float64(y1 + y2)) * x1); else tmp = Float64(Float64(Float64(x1 * y1) / Float64(y1 + y2)) + Float64(Float64(x2 * y2) / Float64(y1 + y2))); end return tmp end
function tmp_2 = code(x1, y1, x2, y2) t_0 = (128.0 * 128.0) * 128.0; tmp = 0.0; if ((((((((x1 / t_0) * y1) + ((x2 / t_0) * y2)) / (y1 + y2)) * 128.0) * 128.0) * 128.0) <= 2e-265) tmp = (y1 / (y1 + y2)) * x1; else tmp = ((x1 * y1) / (y1 + y2)) + ((x2 * y2) / (y1 + y2)); end tmp_2 = tmp; end
code[x1_, y1_, x2_, y2_] := Block[{t$95$0 = N[(N[(128.0 * 128.0), $MachinePrecision] * 128.0), $MachinePrecision]}, If[LessEqual[N[(N[(N[(N[(N[(N[(N[(x1 / t$95$0), $MachinePrecision] * y1), $MachinePrecision] + N[(N[(x2 / t$95$0), $MachinePrecision] * y2), $MachinePrecision]), $MachinePrecision] / N[(y1 + y2), $MachinePrecision]), $MachinePrecision] * 128.0), $MachinePrecision] * 128.0), $MachinePrecision] * 128.0), $MachinePrecision], 2e-265], N[(N[(y1 / N[(y1 + y2), $MachinePrecision]), $MachinePrecision] * x1), $MachinePrecision], N[(N[(N[(x1 * y1), $MachinePrecision] / N[(y1 + y2), $MachinePrecision]), $MachinePrecision] + N[(N[(x2 * y2), $MachinePrecision] / N[(y1 + y2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
t_0 := \left(128 \cdot 128\right) \cdot 128\\
\mathbf{if}\;\left(\left(\frac{\frac{x1}{t\_0} \cdot y1 + \frac{x2}{t\_0} \cdot y2}{y1 + y2} \cdot 128\right) \cdot 128\right) \cdot 128 \leq 2 \cdot 10^{-265}:\\
\;\;\;\;\frac{y1}{y1 + y2} \cdot x1\\
\mathbf{else}:\\
\;\;\;\;\frac{x1 \cdot y1}{y1 + y2} + \frac{x2 \cdot y2}{y1 + y2}\\
\end{array}
if (*.f64 (*.f64 (*.f64 (/.f64 (+.f64 (*.f64 (/.f64 x1 (*.f64 (*.f64 #s(literal 128 binary64) #s(literal 128 binary64)) #s(literal 128 binary64))) y1) (*.f64 (/.f64 x2 (*.f64 (*.f64 #s(literal 128 binary64) #s(literal 128 binary64)) #s(literal 128 binary64))) y2)) (+.f64 y1 y2)) #s(literal 128 binary64)) #s(literal 128 binary64)) #s(literal 128 binary64)) < 2e-265Initial program 77.8%
Taylor expanded in x1 around inf
lower-/.f64N/A
lower-*.f64N/A
lower-+.f6442.1%
Applied rewrites42.1%
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
lift-/.f64N/A
*-commutativeN/A
lower-*.f6451.6%
Applied rewrites51.6%
if 2e-265 < (*.f64 (*.f64 (*.f64 (/.f64 (+.f64 (*.f64 (/.f64 x1 (*.f64 (*.f64 #s(literal 128 binary64) #s(literal 128 binary64)) #s(literal 128 binary64))) y1) (*.f64 (/.f64 x2 (*.f64 (*.f64 #s(literal 128 binary64) #s(literal 128 binary64)) #s(literal 128 binary64))) y2)) (+.f64 y1 y2)) #s(literal 128 binary64)) #s(literal 128 binary64)) #s(literal 128 binary64)) Initial program 77.8%
Taylor expanded in x1 around 0
lower-+.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-+.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-+.f6479.5%
Applied rewrites79.5%
(FPCore (x1 y1 x2 y2)
:precision binary64
(let* ((t_0 (* (* 128.0 128.0) 128.0)))
(if (<=
(*
(*
(*
(/ (+ (* (/ x1 t_0) y1) (* (/ x2 t_0) y2)) (+ y1 y2))
128.0)
128.0)
128.0)
2e-265)
(* (/ y1 (+ y1 y2)) x1)
(/ (fma x1 y1 (* x2 y2)) (+ y1 y2)))))double code(double x1, double y1, double x2, double y2) {
double t_0 = (128.0 * 128.0) * 128.0;
double tmp;
if ((((((((x1 / t_0) * y1) + ((x2 / t_0) * y2)) / (y1 + y2)) * 128.0) * 128.0) * 128.0) <= 2e-265) {
tmp = (y1 / (y1 + y2)) * x1;
} else {
tmp = fma(x1, y1, (x2 * y2)) / (y1 + y2);
}
return tmp;
}
function code(x1, y1, x2, y2) t_0 = Float64(Float64(128.0 * 128.0) * 128.0) tmp = 0.0 if (Float64(Float64(Float64(Float64(Float64(Float64(Float64(x1 / t_0) * y1) + Float64(Float64(x2 / t_0) * y2)) / Float64(y1 + y2)) * 128.0) * 128.0) * 128.0) <= 2e-265) tmp = Float64(Float64(y1 / Float64(y1 + y2)) * x1); else tmp = Float64(fma(x1, y1, Float64(x2 * y2)) / Float64(y1 + y2)); end return tmp end
code[x1_, y1_, x2_, y2_] := Block[{t$95$0 = N[(N[(128.0 * 128.0), $MachinePrecision] * 128.0), $MachinePrecision]}, If[LessEqual[N[(N[(N[(N[(N[(N[(N[(x1 / t$95$0), $MachinePrecision] * y1), $MachinePrecision] + N[(N[(x2 / t$95$0), $MachinePrecision] * y2), $MachinePrecision]), $MachinePrecision] / N[(y1 + y2), $MachinePrecision]), $MachinePrecision] * 128.0), $MachinePrecision] * 128.0), $MachinePrecision] * 128.0), $MachinePrecision], 2e-265], N[(N[(y1 / N[(y1 + y2), $MachinePrecision]), $MachinePrecision] * x1), $MachinePrecision], N[(N[(x1 * y1 + N[(x2 * y2), $MachinePrecision]), $MachinePrecision] / N[(y1 + y2), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
t_0 := \left(128 \cdot 128\right) \cdot 128\\
\mathbf{if}\;\left(\left(\frac{\frac{x1}{t\_0} \cdot y1 + \frac{x2}{t\_0} \cdot y2}{y1 + y2} \cdot 128\right) \cdot 128\right) \cdot 128 \leq 2 \cdot 10^{-265}:\\
\;\;\;\;\frac{y1}{y1 + y2} \cdot x1\\
\mathbf{else}:\\
\;\;\;\;\frac{\mathsf{fma}\left(x1, y1, x2 \cdot y2\right)}{y1 + y2}\\
\end{array}
if (*.f64 (*.f64 (*.f64 (/.f64 (+.f64 (*.f64 (/.f64 x1 (*.f64 (*.f64 #s(literal 128 binary64) #s(literal 128 binary64)) #s(literal 128 binary64))) y1) (*.f64 (/.f64 x2 (*.f64 (*.f64 #s(literal 128 binary64) #s(literal 128 binary64)) #s(literal 128 binary64))) y2)) (+.f64 y1 y2)) #s(literal 128 binary64)) #s(literal 128 binary64)) #s(literal 128 binary64)) < 2e-265Initial program 77.8%
Taylor expanded in x1 around inf
lower-/.f64N/A
lower-*.f64N/A
lower-+.f6442.1%
Applied rewrites42.1%
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
lift-/.f64N/A
*-commutativeN/A
lower-*.f6451.6%
Applied rewrites51.6%
if 2e-265 < (*.f64 (*.f64 (*.f64 (/.f64 (+.f64 (*.f64 (/.f64 x1 (*.f64 (*.f64 #s(literal 128 binary64) #s(literal 128 binary64)) #s(literal 128 binary64))) y1) (*.f64 (/.f64 x2 (*.f64 (*.f64 #s(literal 128 binary64) #s(literal 128 binary64)) #s(literal 128 binary64))) y2)) (+.f64 y1 y2)) #s(literal 128 binary64)) #s(literal 128 binary64)) #s(literal 128 binary64)) Initial program 77.8%
Taylor expanded in x1 around 0
lower-+.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-+.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-+.f6479.5%
Applied rewrites79.5%
lift-+.f64N/A
lift-/.f64N/A
lift-/.f64N/A
div-add-revN/A
lower-/.f64N/A
lift-*.f64N/A
lower-fma.f6479.5%
Applied rewrites79.5%
(FPCore (x1 y1 x2 y2) :precision binary64 (if (<= y2 9.5e-140) (+ x1 (* y2 (/ x2 y1))) (* (/ y2 (+ y1 y2)) x2)))
double code(double x1, double y1, double x2, double y2) {
double tmp;
if (y2 <= 9.5e-140) {
tmp = x1 + (y2 * (x2 / y1));
} else {
tmp = (y2 / (y1 + y2)) * x2;
}
return tmp;
}
real(8) function code(x1, y1, x2, y2)
real(8), intent (in) :: x1
real(8), intent (in) :: y1
real(8), intent (in) :: x2
real(8), intent (in) :: y2
real(8) :: tmp
if (y2 <= 9.5d-140) then
tmp = x1 + (y2 * (x2 / y1))
else
tmp = (y2 / (y1 + y2)) * x2
end if
code = tmp
end function
public static double code(double x1, double y1, double x2, double y2) {
double tmp;
if (y2 <= 9.5e-140) {
tmp = x1 + (y2 * (x2 / y1));
} else {
tmp = (y2 / (y1 + y2)) * x2;
}
return tmp;
}
def code(x1, y1, x2, y2): tmp = 0 if y2 <= 9.5e-140: tmp = x1 + (y2 * (x2 / y1)) else: tmp = (y2 / (y1 + y2)) * x2 return tmp
function code(x1, y1, x2, y2) tmp = 0.0 if (y2 <= 9.5e-140) tmp = Float64(x1 + Float64(y2 * Float64(x2 / y1))); else tmp = Float64(Float64(y2 / Float64(y1 + y2)) * x2); end return tmp end
function tmp_2 = code(x1, y1, x2, y2) tmp = 0.0; if (y2 <= 9.5e-140) tmp = x1 + (y2 * (x2 / y1)); else tmp = (y2 / (y1 + y2)) * x2; end tmp_2 = tmp; end
code[x1_, y1_, x2_, y2_] := If[LessEqual[y2, 9.5e-140], N[(x1 + N[(y2 * N[(x2 / y1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(y2 / N[(y1 + y2), $MachinePrecision]), $MachinePrecision] * x2), $MachinePrecision]]
\begin{array}{l}
\mathbf{if}\;y2 \leq 9.5 \cdot 10^{-140}:\\
\;\;\;\;x1 + y2 \cdot \frac{x2}{y1}\\
\mathbf{else}:\\
\;\;\;\;\frac{y2}{y1 + y2} \cdot x2\\
\end{array}
if y2 < 9.5000000000000002e-140Initial program 77.8%
Taylor expanded in y1 around inf
metadata-evalN/A
metadata-evalN/A
lower-+.f64N/A
lower-*.f64N/A
metadata-evalN/A
metadata-evalN/A
lower-/.f64N/A
Applied rewrites47.0%
Taylor expanded in x1 around 0
lower-/.f64N/A
lower-*.f6447.8%
Applied rewrites47.8%
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/l*N/A
lift-/.f64N/A
lower-*.f6451.1%
Applied rewrites51.1%
if 9.5000000000000002e-140 < y2 Initial program 77.8%
Taylor expanded in x1 around 0
lower-/.f64N/A
lower-*.f64N/A
lower-+.f6441.4%
Applied rewrites41.4%
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
lift-+.f64N/A
+-commutativeN/A
lift-+.f64N/A
lift-/.f64N/A
*-commutativeN/A
lower-*.f6451.5%
lift-+.f64N/A
+-commutativeN/A
lift-+.f6451.5%
Applied rewrites51.5%
(FPCore (x1 y1 x2 y2) :precision binary64 (if (<= y2 9.5e-140) (* (/ y1 (+ y1 y2)) x1) (* (/ y2 (+ y1 y2)) x2)))
double code(double x1, double y1, double x2, double y2) {
double tmp;
if (y2 <= 9.5e-140) {
tmp = (y1 / (y1 + y2)) * x1;
} else {
tmp = (y2 / (y1 + y2)) * x2;
}
return tmp;
}
real(8) function code(x1, y1, x2, y2)
real(8), intent (in) :: x1
real(8), intent (in) :: y1
real(8), intent (in) :: x2
real(8), intent (in) :: y2
real(8) :: tmp
if (y2 <= 9.5d-140) then
tmp = (y1 / (y1 + y2)) * x1
else
tmp = (y2 / (y1 + y2)) * x2
end if
code = tmp
end function
public static double code(double x1, double y1, double x2, double y2) {
double tmp;
if (y2 <= 9.5e-140) {
tmp = (y1 / (y1 + y2)) * x1;
} else {
tmp = (y2 / (y1 + y2)) * x2;
}
return tmp;
}
def code(x1, y1, x2, y2): tmp = 0 if y2 <= 9.5e-140: tmp = (y1 / (y1 + y2)) * x1 else: tmp = (y2 / (y1 + y2)) * x2 return tmp
function code(x1, y1, x2, y2) tmp = 0.0 if (y2 <= 9.5e-140) tmp = Float64(Float64(y1 / Float64(y1 + y2)) * x1); else tmp = Float64(Float64(y2 / Float64(y1 + y2)) * x2); end return tmp end
function tmp_2 = code(x1, y1, x2, y2) tmp = 0.0; if (y2 <= 9.5e-140) tmp = (y1 / (y1 + y2)) * x1; else tmp = (y2 / (y1 + y2)) * x2; end tmp_2 = tmp; end
code[x1_, y1_, x2_, y2_] := If[LessEqual[y2, 9.5e-140], N[(N[(y1 / N[(y1 + y2), $MachinePrecision]), $MachinePrecision] * x1), $MachinePrecision], N[(N[(y2 / N[(y1 + y2), $MachinePrecision]), $MachinePrecision] * x2), $MachinePrecision]]
\begin{array}{l}
\mathbf{if}\;y2 \leq 9.5 \cdot 10^{-140}:\\
\;\;\;\;\frac{y1}{y1 + y2} \cdot x1\\
\mathbf{else}:\\
\;\;\;\;\frac{y2}{y1 + y2} \cdot x2\\
\end{array}
if y2 < 9.5000000000000002e-140Initial program 77.8%
Taylor expanded in x1 around inf
lower-/.f64N/A
lower-*.f64N/A
lower-+.f6442.1%
Applied rewrites42.1%
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
lift-/.f64N/A
*-commutativeN/A
lower-*.f6451.6%
Applied rewrites51.6%
if 9.5000000000000002e-140 < y2 Initial program 77.8%
Taylor expanded in x1 around 0
lower-/.f64N/A
lower-*.f64N/A
lower-+.f6441.4%
Applied rewrites41.4%
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
lift-+.f64N/A
+-commutativeN/A
lift-+.f64N/A
lift-/.f64N/A
*-commutativeN/A
lower-*.f6451.5%
lift-+.f64N/A
+-commutativeN/A
lift-+.f6451.5%
Applied rewrites51.5%
(FPCore (x1 y1 x2 y2) :precision binary64 (if (<= y2 9.5e-140) (* (/ y1 (+ y1 y2)) x1) (* y2 (/ x2 (+ y1 y2)))))
double code(double x1, double y1, double x2, double y2) {
double tmp;
if (y2 <= 9.5e-140) {
tmp = (y1 / (y1 + y2)) * x1;
} else {
tmp = y2 * (x2 / (y1 + y2));
}
return tmp;
}
real(8) function code(x1, y1, x2, y2)
real(8), intent (in) :: x1
real(8), intent (in) :: y1
real(8), intent (in) :: x2
real(8), intent (in) :: y2
real(8) :: tmp
if (y2 <= 9.5d-140) then
tmp = (y1 / (y1 + y2)) * x1
else
tmp = y2 * (x2 / (y1 + y2))
end if
code = tmp
end function
public static double code(double x1, double y1, double x2, double y2) {
double tmp;
if (y2 <= 9.5e-140) {
tmp = (y1 / (y1 + y2)) * x1;
} else {
tmp = y2 * (x2 / (y1 + y2));
}
return tmp;
}
def code(x1, y1, x2, y2): tmp = 0 if y2 <= 9.5e-140: tmp = (y1 / (y1 + y2)) * x1 else: tmp = y2 * (x2 / (y1 + y2)) return tmp
function code(x1, y1, x2, y2) tmp = 0.0 if (y2 <= 9.5e-140) tmp = Float64(Float64(y1 / Float64(y1 + y2)) * x1); else tmp = Float64(y2 * Float64(x2 / Float64(y1 + y2))); end return tmp end
function tmp_2 = code(x1, y1, x2, y2) tmp = 0.0; if (y2 <= 9.5e-140) tmp = (y1 / (y1 + y2)) * x1; else tmp = y2 * (x2 / (y1 + y2)); end tmp_2 = tmp; end
code[x1_, y1_, x2_, y2_] := If[LessEqual[y2, 9.5e-140], N[(N[(y1 / N[(y1 + y2), $MachinePrecision]), $MachinePrecision] * x1), $MachinePrecision], N[(y2 * N[(x2 / N[(y1 + y2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\mathbf{if}\;y2 \leq 9.5 \cdot 10^{-140}:\\
\;\;\;\;\frac{y1}{y1 + y2} \cdot x1\\
\mathbf{else}:\\
\;\;\;\;y2 \cdot \frac{x2}{y1 + y2}\\
\end{array}
if y2 < 9.5000000000000002e-140Initial program 77.8%
Taylor expanded in x1 around inf
lower-/.f64N/A
lower-*.f64N/A
lower-+.f6442.1%
Applied rewrites42.1%
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
lift-/.f64N/A
*-commutativeN/A
lower-*.f6451.6%
Applied rewrites51.6%
if 9.5000000000000002e-140 < y2 Initial program 77.8%
Taylor expanded in x1 around 0
lower-/.f64N/A
lower-*.f64N/A
lower-+.f6441.4%
Applied rewrites41.4%
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/l*N/A
lower-*.f64N/A
lower-/.f6451.4%
Applied rewrites51.4%
(FPCore (x1 y1 x2 y2) :precision binary64 (if (<= y2 9.5e-140) (* y1 (/ x1 (+ y1 y2))) (* y2 (/ x2 (+ y1 y2)))))
double code(double x1, double y1, double x2, double y2) {
double tmp;
if (y2 <= 9.5e-140) {
tmp = y1 * (x1 / (y1 + y2));
} else {
tmp = y2 * (x2 / (y1 + y2));
}
return tmp;
}
real(8) function code(x1, y1, x2, y2)
real(8), intent (in) :: x1
real(8), intent (in) :: y1
real(8), intent (in) :: x2
real(8), intent (in) :: y2
real(8) :: tmp
if (y2 <= 9.5d-140) then
tmp = y1 * (x1 / (y1 + y2))
else
tmp = y2 * (x2 / (y1 + y2))
end if
code = tmp
end function
public static double code(double x1, double y1, double x2, double y2) {
double tmp;
if (y2 <= 9.5e-140) {
tmp = y1 * (x1 / (y1 + y2));
} else {
tmp = y2 * (x2 / (y1 + y2));
}
return tmp;
}
def code(x1, y1, x2, y2): tmp = 0 if y2 <= 9.5e-140: tmp = y1 * (x1 / (y1 + y2)) else: tmp = y2 * (x2 / (y1 + y2)) return tmp
function code(x1, y1, x2, y2) tmp = 0.0 if (y2 <= 9.5e-140) tmp = Float64(y1 * Float64(x1 / Float64(y1 + y2))); else tmp = Float64(y2 * Float64(x2 / Float64(y1 + y2))); end return tmp end
function tmp_2 = code(x1, y1, x2, y2) tmp = 0.0; if (y2 <= 9.5e-140) tmp = y1 * (x1 / (y1 + y2)); else tmp = y2 * (x2 / (y1 + y2)); end tmp_2 = tmp; end
code[x1_, y1_, x2_, y2_] := If[LessEqual[y2, 9.5e-140], N[(y1 * N[(x1 / N[(y1 + y2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(y2 * N[(x2 / N[(y1 + y2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\mathbf{if}\;y2 \leq 9.5 \cdot 10^{-140}:\\
\;\;\;\;y1 \cdot \frac{x1}{y1 + y2}\\
\mathbf{else}:\\
\;\;\;\;y2 \cdot \frac{x2}{y1 + y2}\\
\end{array}
if y2 < 9.5000000000000002e-140Initial program 77.8%
Taylor expanded in x1 around inf
lower-/.f64N/A
lower-*.f64N/A
lower-+.f6442.1%
Applied rewrites42.1%
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/l*N/A
lower-*.f64N/A
lower-/.f6451.5%
Applied rewrites51.5%
if 9.5000000000000002e-140 < y2 Initial program 77.8%
Taylor expanded in x1 around 0
lower-/.f64N/A
lower-*.f64N/A
lower-+.f6441.4%
Applied rewrites41.4%
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/l*N/A
lower-*.f64N/A
lower-/.f6451.4%
Applied rewrites51.4%
(FPCore (x1 y1 x2 y2) :precision binary64 (if (<= y2 4e-140) (* y1 (/ x1 (+ y1 y2))) x2))
double code(double x1, double y1, double x2, double y2) {
double tmp;
if (y2 <= 4e-140) {
tmp = y1 * (x1 / (y1 + y2));
} else {
tmp = x2;
}
return tmp;
}
real(8) function code(x1, y1, x2, y2)
real(8), intent (in) :: x1
real(8), intent (in) :: y1
real(8), intent (in) :: x2
real(8), intent (in) :: y2
real(8) :: tmp
if (y2 <= 4d-140) then
tmp = y1 * (x1 / (y1 + y2))
else
tmp = x2
end if
code = tmp
end function
public static double code(double x1, double y1, double x2, double y2) {
double tmp;
if (y2 <= 4e-140) {
tmp = y1 * (x1 / (y1 + y2));
} else {
tmp = x2;
}
return tmp;
}
def code(x1, y1, x2, y2): tmp = 0 if y2 <= 4e-140: tmp = y1 * (x1 / (y1 + y2)) else: tmp = x2 return tmp
function code(x1, y1, x2, y2) tmp = 0.0 if (y2 <= 4e-140) tmp = Float64(y1 * Float64(x1 / Float64(y1 + y2))); else tmp = x2; end return tmp end
function tmp_2 = code(x1, y1, x2, y2) tmp = 0.0; if (y2 <= 4e-140) tmp = y1 * (x1 / (y1 + y2)); else tmp = x2; end tmp_2 = tmp; end
code[x1_, y1_, x2_, y2_] := If[LessEqual[y2, 4e-140], N[(y1 * N[(x1 / N[(y1 + y2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], x2]
\begin{array}{l}
\mathbf{if}\;y2 \leq 4 \cdot 10^{-140}:\\
\;\;\;\;y1 \cdot \frac{x1}{y1 + y2}\\
\mathbf{else}:\\
\;\;\;\;x2\\
\end{array}
if y2 < 3.9999999999999999e-140Initial program 77.8%
Taylor expanded in x1 around inf
lower-/.f64N/A
lower-*.f64N/A
lower-+.f6442.1%
Applied rewrites42.1%
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/l*N/A
lower-*.f64N/A
lower-/.f6451.5%
Applied rewrites51.5%
if 3.9999999999999999e-140 < y2 Initial program 77.8%
Taylor expanded in y1 around 0
Applied rewrites40.4%
(FPCore (x1 y1 x2 y2) :precision binary64 (if (<= y2 2.2e-161) (* (* 0.0078125 x1) 128.0) x2))
double code(double x1, double y1, double x2, double y2) {
double tmp;
if (y2 <= 2.2e-161) {
tmp = (0.0078125 * x1) * 128.0;
} else {
tmp = x2;
}
return tmp;
}
real(8) function code(x1, y1, x2, y2)
real(8), intent (in) :: x1
real(8), intent (in) :: y1
real(8), intent (in) :: x2
real(8), intent (in) :: y2
real(8) :: tmp
if (y2 <= 2.2d-161) then
tmp = (0.0078125d0 * x1) * 128.0d0
else
tmp = x2
end if
code = tmp
end function
public static double code(double x1, double y1, double x2, double y2) {
double tmp;
if (y2 <= 2.2e-161) {
tmp = (0.0078125 * x1) * 128.0;
} else {
tmp = x2;
}
return tmp;
}
def code(x1, y1, x2, y2): tmp = 0 if y2 <= 2.2e-161: tmp = (0.0078125 * x1) * 128.0 else: tmp = x2 return tmp
function code(x1, y1, x2, y2) tmp = 0.0 if (y2 <= 2.2e-161) tmp = Float64(Float64(0.0078125 * x1) * 128.0); else tmp = x2; end return tmp end
function tmp_2 = code(x1, y1, x2, y2) tmp = 0.0; if (y2 <= 2.2e-161) tmp = (0.0078125 * x1) * 128.0; else tmp = x2; end tmp_2 = tmp; end
code[x1_, y1_, x2_, y2_] := If[LessEqual[y2, 2.2e-161], N[(N[(0.0078125 * x1), $MachinePrecision] * 128.0), $MachinePrecision], x2]
\begin{array}{l}
\mathbf{if}\;y2 \leq 2.2 \cdot 10^{-161}:\\
\;\;\;\;\left(0.0078125 \cdot x1\right) \cdot 128\\
\mathbf{else}:\\
\;\;\;\;x2\\
\end{array}
if y2 < 2.2e-161Initial program 77.8%
Taylor expanded in y1 around inf
lower-*.f6440.4%
Applied rewrites40.4%
if 2.2e-161 < y2 Initial program 77.8%
Taylor expanded in y1 around 0
Applied rewrites40.4%
(FPCore (x1 y1 x2 y2) :precision binary64 x2)
double code(double x1, double y1, double x2, double y2) {
return x2;
}
real(8) function code(x1, y1, x2, y2)
real(8), intent (in) :: x1
real(8), intent (in) :: y1
real(8), intent (in) :: x2
real(8), intent (in) :: y2
code = x2
end function
public static double code(double x1, double y1, double x2, double y2) {
return x2;
}
def code(x1, y1, x2, y2): return x2
function code(x1, y1, x2, y2) return x2 end
function tmp = code(x1, y1, x2, y2) tmp = x2; end
code[x1_, y1_, x2_, y2_] := x2
x2
Initial program 77.8%
Taylor expanded in y1 around 0
Applied rewrites40.4%
herbie shell --seed 1
(FPCore (x1 y1 x2 y2)
:name "(x1 / (128*128*128) * y1 + x2 / (128*128*128) * y2) / (y1 + y2) * 128*128*128"
:precision binary64
:pre (and (and (and (and (<= 0.0 x1) (<= x1 1.0)) (and (<= 0.0 y1) (<= y1 10000.0))) (and (<= 0.0 x2) (<= x2 1.0))) (and (<= 0.0 y2) (<= y2 10000.0)))
(* (* (* (/ (+ (* (/ x1 (* (* 128.0 128.0) 128.0)) y1) (* (/ x2 (* (* 128.0 128.0) 128.0)) y2)) (+ y1 y2)) 128.0) 128.0) 128.0))