
(FPCore (x y z) :precision binary64 (+ 1.0 (/ (* 4.0 (- (+ x (* y 0.25)) z)) y)))
double code(double x, double y, double z) {
return 1.0 + ((4.0 * ((x + (y * 0.25)) - z)) / y);
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
code = 1.0d0 + ((4.0d0 * ((x + (y * 0.25d0)) - z)) / y)
end function
public static double code(double x, double y, double z) {
return 1.0 + ((4.0 * ((x + (y * 0.25)) - z)) / y);
}
def code(x, y, z): return 1.0 + ((4.0 * ((x + (y * 0.25)) - z)) / y)
function code(x, y, z) return Float64(1.0 + Float64(Float64(4.0 * Float64(Float64(x + Float64(y * 0.25)) - z)) / y)) end
function tmp = code(x, y, z) tmp = 1.0 + ((4.0 * ((x + (y * 0.25)) - z)) / y); end
code[x_, y_, z_] := N[(1.0 + N[(N[(4.0 * N[(N[(x + N[(y * 0.25), $MachinePrecision]), $MachinePrecision] - z), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
1 + \frac{4 \cdot \left(\left(x + y \cdot 0.25\right) - z\right)}{y}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 11 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z) :precision binary64 (+ 1.0 (/ (* 4.0 (- (+ x (* y 0.25)) z)) y)))
double code(double x, double y, double z) {
return 1.0 + ((4.0 * ((x + (y * 0.25)) - z)) / y);
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
code = 1.0d0 + ((4.0d0 * ((x + (y * 0.25d0)) - z)) / y)
end function
public static double code(double x, double y, double z) {
return 1.0 + ((4.0 * ((x + (y * 0.25)) - z)) / y);
}
def code(x, y, z): return 1.0 + ((4.0 * ((x + (y * 0.25)) - z)) / y)
function code(x, y, z) return Float64(1.0 + Float64(Float64(4.0 * Float64(Float64(x + Float64(y * 0.25)) - z)) / y)) end
function tmp = code(x, y, z) tmp = 1.0 + ((4.0 * ((x + (y * 0.25)) - z)) / y); end
code[x_, y_, z_] := N[(1.0 + N[(N[(4.0 * N[(N[(x + N[(y * 0.25), $MachinePrecision]), $MachinePrecision] - z), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
1 + \frac{4 \cdot \left(\left(x + y \cdot 0.25\right) - z\right)}{y}
\end{array}
(FPCore (x y z) :precision binary64 (+ 1.0 (/ (* 4.0 (- (+ x (* y 0.25)) z)) y)))
double code(double x, double y, double z) {
return 1.0 + ((4.0 * ((x + (y * 0.25)) - z)) / y);
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
code = 1.0d0 + ((4.0d0 * ((x + (y * 0.25d0)) - z)) / y)
end function
public static double code(double x, double y, double z) {
return 1.0 + ((4.0 * ((x + (y * 0.25)) - z)) / y);
}
def code(x, y, z): return 1.0 + ((4.0 * ((x + (y * 0.25)) - z)) / y)
function code(x, y, z) return Float64(1.0 + Float64(Float64(4.0 * Float64(Float64(x + Float64(y * 0.25)) - z)) / y)) end
function tmp = code(x, y, z) tmp = 1.0 + ((4.0 * ((x + (y * 0.25)) - z)) / y); end
code[x_, y_, z_] := N[(1.0 + N[(N[(4.0 * N[(N[(x + N[(y * 0.25), $MachinePrecision]), $MachinePrecision] - z), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
1 + \frac{4 \cdot \left(\left(x + y \cdot 0.25\right) - z\right)}{y}
\end{array}
Initial program 100.0%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (* (/ z y) -4.0)))
(if (<= z -3e+40)
t_0
(if (<= z -1.26e-242) (/ (* 4.0 x) y) (if (<= z 8.2e+91) 2.0 t_0)))))
double code(double x, double y, double z) {
double t_0 = (z / y) * -4.0;
double tmp;
if (z <= -3e+40) {
tmp = t_0;
} else if (z <= -1.26e-242) {
tmp = (4.0 * x) / y;
} else if (z <= 8.2e+91) {
tmp = 2.0;
} else {
tmp = t_0;
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: t_0
real(8) :: tmp
t_0 = (z / y) * (-4.0d0)
if (z <= (-3d+40)) then
tmp = t_0
else if (z <= (-1.26d-242)) then
tmp = (4.0d0 * x) / y
else if (z <= 8.2d+91) then
tmp = 2.0d0
else
tmp = t_0
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double t_0 = (z / y) * -4.0;
double tmp;
if (z <= -3e+40) {
tmp = t_0;
} else if (z <= -1.26e-242) {
tmp = (4.0 * x) / y;
} else if (z <= 8.2e+91) {
tmp = 2.0;
} else {
tmp = t_0;
}
return tmp;
}
def code(x, y, z): t_0 = (z / y) * -4.0 tmp = 0 if z <= -3e+40: tmp = t_0 elif z <= -1.26e-242: tmp = (4.0 * x) / y elif z <= 8.2e+91: tmp = 2.0 else: tmp = t_0 return tmp
function code(x, y, z) t_0 = Float64(Float64(z / y) * -4.0) tmp = 0.0 if (z <= -3e+40) tmp = t_0; elseif (z <= -1.26e-242) tmp = Float64(Float64(4.0 * x) / y); elseif (z <= 8.2e+91) tmp = 2.0; else tmp = t_0; end return tmp end
function tmp_2 = code(x, y, z) t_0 = (z / y) * -4.0; tmp = 0.0; if (z <= -3e+40) tmp = t_0; elseif (z <= -1.26e-242) tmp = (4.0 * x) / y; elseif (z <= 8.2e+91) tmp = 2.0; else tmp = t_0; end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(N[(z / y), $MachinePrecision] * -4.0), $MachinePrecision]}, If[LessEqual[z, -3e+40], t$95$0, If[LessEqual[z, -1.26e-242], N[(N[(4.0 * x), $MachinePrecision] / y), $MachinePrecision], If[LessEqual[z, 8.2e+91], 2.0, t$95$0]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{z}{y} \cdot -4\\
\mathbf{if}\;z \leq -3 \cdot 10^{+40}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;z \leq -1.26 \cdot 10^{-242}:\\
\;\;\;\;\frac{4 \cdot x}{y}\\
\mathbf{elif}\;z \leq 8.2 \cdot 10^{+91}:\\
\;\;\;\;2\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if z < -3.0000000000000002e40 or 8.2000000000000005e91 < z Initial program 100.0%
Taylor expanded in z around inf 75.2%
*-commutative75.2%
Simplified75.2%
if -3.0000000000000002e40 < z < -1.2599999999999999e-242Initial program 100.0%
Taylor expanded in x around inf 66.1%
associate-*r/66.1%
Simplified66.1%
if -1.2599999999999999e-242 < z < 8.2000000000000005e91Initial program 100.0%
Taylor expanded in y around inf 52.3%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (* (/ z y) -4.0)))
(if (<= z -5.8e+42)
t_0
(if (<= z -1.15e-240) (* x (/ 4.0 y)) (if (<= z 6.8e+91) 2.0 t_0)))))
double code(double x, double y, double z) {
double t_0 = (z / y) * -4.0;
double tmp;
if (z <= -5.8e+42) {
tmp = t_0;
} else if (z <= -1.15e-240) {
tmp = x * (4.0 / y);
} else if (z <= 6.8e+91) {
tmp = 2.0;
} else {
tmp = t_0;
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: t_0
real(8) :: tmp
t_0 = (z / y) * (-4.0d0)
if (z <= (-5.8d+42)) then
tmp = t_0
else if (z <= (-1.15d-240)) then
tmp = x * (4.0d0 / y)
else if (z <= 6.8d+91) then
tmp = 2.0d0
else
tmp = t_0
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double t_0 = (z / y) * -4.0;
double tmp;
if (z <= -5.8e+42) {
tmp = t_0;
} else if (z <= -1.15e-240) {
tmp = x * (4.0 / y);
} else if (z <= 6.8e+91) {
tmp = 2.0;
} else {
tmp = t_0;
}
return tmp;
}
def code(x, y, z): t_0 = (z / y) * -4.0 tmp = 0 if z <= -5.8e+42: tmp = t_0 elif z <= -1.15e-240: tmp = x * (4.0 / y) elif z <= 6.8e+91: tmp = 2.0 else: tmp = t_0 return tmp
function code(x, y, z) t_0 = Float64(Float64(z / y) * -4.0) tmp = 0.0 if (z <= -5.8e+42) tmp = t_0; elseif (z <= -1.15e-240) tmp = Float64(x * Float64(4.0 / y)); elseif (z <= 6.8e+91) tmp = 2.0; else tmp = t_0; end return tmp end
function tmp_2 = code(x, y, z) t_0 = (z / y) * -4.0; tmp = 0.0; if (z <= -5.8e+42) tmp = t_0; elseif (z <= -1.15e-240) tmp = x * (4.0 / y); elseif (z <= 6.8e+91) tmp = 2.0; else tmp = t_0; end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(N[(z / y), $MachinePrecision] * -4.0), $MachinePrecision]}, If[LessEqual[z, -5.8e+42], t$95$0, If[LessEqual[z, -1.15e-240], N[(x * N[(4.0 / y), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 6.8e+91], 2.0, t$95$0]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{z}{y} \cdot -4\\
\mathbf{if}\;z \leq -5.8 \cdot 10^{+42}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;z \leq -1.15 \cdot 10^{-240}:\\
\;\;\;\;x \cdot \frac{4}{y}\\
\mathbf{elif}\;z \leq 6.8 \cdot 10^{+91}:\\
\;\;\;\;2\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if z < -5.79999999999999961e42 or 6.8000000000000002e91 < z Initial program 100.0%
Taylor expanded in z around inf 75.2%
*-commutative75.2%
Simplified75.2%
if -5.79999999999999961e42 < z < -1.14999999999999996e-240Initial program 100.0%
Taylor expanded in x around inf 66.1%
associate-*r/66.1%
associate-*l/66.0%
*-commutative66.0%
Simplified66.0%
if -1.14999999999999996e-240 < z < 6.8000000000000002e91Initial program 100.0%
Taylor expanded in y around inf 52.3%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (* z (/ -4.0 y))))
(if (<= z -6.8e+42)
t_0
(if (<= z -3.05e-248) (* x (/ 4.0 y)) (if (<= z 6.5e+91) 2.0 t_0)))))
double code(double x, double y, double z) {
double t_0 = z * (-4.0 / y);
double tmp;
if (z <= -6.8e+42) {
tmp = t_0;
} else if (z <= -3.05e-248) {
tmp = x * (4.0 / y);
} else if (z <= 6.5e+91) {
tmp = 2.0;
} else {
tmp = t_0;
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: t_0
real(8) :: tmp
t_0 = z * ((-4.0d0) / y)
if (z <= (-6.8d+42)) then
tmp = t_0
else if (z <= (-3.05d-248)) then
tmp = x * (4.0d0 / y)
else if (z <= 6.5d+91) then
tmp = 2.0d0
else
tmp = t_0
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double t_0 = z * (-4.0 / y);
double tmp;
if (z <= -6.8e+42) {
tmp = t_0;
} else if (z <= -3.05e-248) {
tmp = x * (4.0 / y);
} else if (z <= 6.5e+91) {
tmp = 2.0;
} else {
tmp = t_0;
}
return tmp;
}
def code(x, y, z): t_0 = z * (-4.0 / y) tmp = 0 if z <= -6.8e+42: tmp = t_0 elif z <= -3.05e-248: tmp = x * (4.0 / y) elif z <= 6.5e+91: tmp = 2.0 else: tmp = t_0 return tmp
function code(x, y, z) t_0 = Float64(z * Float64(-4.0 / y)) tmp = 0.0 if (z <= -6.8e+42) tmp = t_0; elseif (z <= -3.05e-248) tmp = Float64(x * Float64(4.0 / y)); elseif (z <= 6.5e+91) tmp = 2.0; else tmp = t_0; end return tmp end
function tmp_2 = code(x, y, z) t_0 = z * (-4.0 / y); tmp = 0.0; if (z <= -6.8e+42) tmp = t_0; elseif (z <= -3.05e-248) tmp = x * (4.0 / y); elseif (z <= 6.5e+91) tmp = 2.0; else tmp = t_0; end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(z * N[(-4.0 / y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -6.8e+42], t$95$0, If[LessEqual[z, -3.05e-248], N[(x * N[(4.0 / y), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 6.5e+91], 2.0, t$95$0]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := z \cdot \frac{-4}{y}\\
\mathbf{if}\;z \leq -6.8 \cdot 10^{+42}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;z \leq -3.05 \cdot 10^{-248}:\\
\;\;\;\;x \cdot \frac{4}{y}\\
\mathbf{elif}\;z \leq 6.5 \cdot 10^{+91}:\\
\;\;\;\;2\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if z < -6.7999999999999995e42 or 6.4999999999999997e91 < z Initial program 100.0%
Taylor expanded in z around inf 75.2%
associate-*r/75.2%
*-commutative75.2%
associate-/l*74.9%
Simplified74.9%
if -6.7999999999999995e42 < z < -3.0499999999999999e-248Initial program 100.0%
Taylor expanded in x around inf 66.1%
associate-*r/66.1%
associate-*l/66.0%
*-commutative66.0%
Simplified66.0%
if -3.0499999999999999e-248 < z < 6.4999999999999997e91Initial program 100.0%
Taylor expanded in y around inf 52.3%
(FPCore (x y z) :precision binary64 (if (or (<= y -1.7e+118) (not (<= y 1.3e+69))) (+ 2.0 (* (/ z y) -4.0)) (* 4.0 (/ (- x z) y))))
double code(double x, double y, double z) {
double tmp;
if ((y <= -1.7e+118) || !(y <= 1.3e+69)) {
tmp = 2.0 + ((z / y) * -4.0);
} else {
tmp = 4.0 * ((x - z) / y);
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: tmp
if ((y <= (-1.7d+118)) .or. (.not. (y <= 1.3d+69))) then
tmp = 2.0d0 + ((z / y) * (-4.0d0))
else
tmp = 4.0d0 * ((x - z) / y)
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if ((y <= -1.7e+118) || !(y <= 1.3e+69)) {
tmp = 2.0 + ((z / y) * -4.0);
} else {
tmp = 4.0 * ((x - z) / y);
}
return tmp;
}
def code(x, y, z): tmp = 0 if (y <= -1.7e+118) or not (y <= 1.3e+69): tmp = 2.0 + ((z / y) * -4.0) else: tmp = 4.0 * ((x - z) / y) return tmp
function code(x, y, z) tmp = 0.0 if ((y <= -1.7e+118) || !(y <= 1.3e+69)) tmp = Float64(2.0 + Float64(Float64(z / y) * -4.0)); else tmp = Float64(4.0 * Float64(Float64(x - z) / y)); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if ((y <= -1.7e+118) || ~((y <= 1.3e+69))) tmp = 2.0 + ((z / y) * -4.0); else tmp = 4.0 * ((x - z) / y); end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[y, -1.7e+118], N[Not[LessEqual[y, 1.3e+69]], $MachinePrecision]], N[(2.0 + N[(N[(z / y), $MachinePrecision] * -4.0), $MachinePrecision]), $MachinePrecision], N[(4.0 * N[(N[(x - z), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.7 \cdot 10^{+118} \lor \neg \left(y \leq 1.3 \cdot 10^{+69}\right):\\
\;\;\;\;2 + \frac{z}{y} \cdot -4\\
\mathbf{else}:\\
\;\;\;\;4 \cdot \frac{x - z}{y}\\
\end{array}
\end{array}
if y < -1.69999999999999993e118 or 1.3000000000000001e69 < y Initial program 99.9%
+-commutative99.9%
associate-*l/99.8%
+-commutative99.8%
associate--l+99.8%
+-commutative99.8%
distribute-lft-in99.9%
associate-+l+99.9%
associate-*l/99.9%
*-commutative99.9%
associate-*l*99.9%
metadata-eval99.9%
*-rgt-identity99.9%
*-inverses99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in x around 0 93.7%
*-commutative93.7%
Simplified93.7%
if -1.69999999999999993e118 < y < 1.3000000000000001e69Initial program 100.0%
Taylor expanded in y around 0 89.5%
Final simplification90.8%
(FPCore (x y z) :precision binary64 (if (<= y -1.4e+130) 2.0 (if (<= y 4.1e+126) (* 4.0 (/ (- x z) y)) 2.0)))
double code(double x, double y, double z) {
double tmp;
if (y <= -1.4e+130) {
tmp = 2.0;
} else if (y <= 4.1e+126) {
tmp = 4.0 * ((x - z) / y);
} else {
tmp = 2.0;
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: tmp
if (y <= (-1.4d+130)) then
tmp = 2.0d0
else if (y <= 4.1d+126) then
tmp = 4.0d0 * ((x - z) / y)
else
tmp = 2.0d0
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (y <= -1.4e+130) {
tmp = 2.0;
} else if (y <= 4.1e+126) {
tmp = 4.0 * ((x - z) / y);
} else {
tmp = 2.0;
}
return tmp;
}
def code(x, y, z): tmp = 0 if y <= -1.4e+130: tmp = 2.0 elif y <= 4.1e+126: tmp = 4.0 * ((x - z) / y) else: tmp = 2.0 return tmp
function code(x, y, z) tmp = 0.0 if (y <= -1.4e+130) tmp = 2.0; elseif (y <= 4.1e+126) tmp = Float64(4.0 * Float64(Float64(x - z) / y)); else tmp = 2.0; end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (y <= -1.4e+130) tmp = 2.0; elseif (y <= 4.1e+126) tmp = 4.0 * ((x - z) / y); else tmp = 2.0; end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[y, -1.4e+130], 2.0, If[LessEqual[y, 4.1e+126], N[(4.0 * N[(N[(x - z), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision], 2.0]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.4 \cdot 10^{+130}:\\
\;\;\;\;2\\
\mathbf{elif}\;y \leq 4.1 \cdot 10^{+126}:\\
\;\;\;\;4 \cdot \frac{x - z}{y}\\
\mathbf{else}:\\
\;\;\;\;2\\
\end{array}
\end{array}
if y < -1.3999999999999999e130 or 4.1000000000000001e126 < y Initial program 99.9%
Taylor expanded in y around inf 79.4%
if -1.3999999999999999e130 < y < 4.1000000000000001e126Initial program 100.0%
Taylor expanded in y around 0 87.4%
(FPCore (x y z) :precision binary64 (if (<= y -1.42e+112) 2.0 (if (<= y 2.1e+82) (* x (/ 4.0 y)) 2.0)))
double code(double x, double y, double z) {
double tmp;
if (y <= -1.42e+112) {
tmp = 2.0;
} else if (y <= 2.1e+82) {
tmp = x * (4.0 / y);
} else {
tmp = 2.0;
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: tmp
if (y <= (-1.42d+112)) then
tmp = 2.0d0
else if (y <= 2.1d+82) then
tmp = x * (4.0d0 / y)
else
tmp = 2.0d0
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (y <= -1.42e+112) {
tmp = 2.0;
} else if (y <= 2.1e+82) {
tmp = x * (4.0 / y);
} else {
tmp = 2.0;
}
return tmp;
}
def code(x, y, z): tmp = 0 if y <= -1.42e+112: tmp = 2.0 elif y <= 2.1e+82: tmp = x * (4.0 / y) else: tmp = 2.0 return tmp
function code(x, y, z) tmp = 0.0 if (y <= -1.42e+112) tmp = 2.0; elseif (y <= 2.1e+82) tmp = Float64(x * Float64(4.0 / y)); else tmp = 2.0; end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (y <= -1.42e+112) tmp = 2.0; elseif (y <= 2.1e+82) tmp = x * (4.0 / y); else tmp = 2.0; end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[y, -1.42e+112], 2.0, If[LessEqual[y, 2.1e+82], N[(x * N[(4.0 / y), $MachinePrecision]), $MachinePrecision], 2.0]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.42 \cdot 10^{+112}:\\
\;\;\;\;2\\
\mathbf{elif}\;y \leq 2.1 \cdot 10^{+82}:\\
\;\;\;\;x \cdot \frac{4}{y}\\
\mathbf{else}:\\
\;\;\;\;2\\
\end{array}
\end{array}
if y < -1.4200000000000001e112 or 2.1e82 < y Initial program 99.9%
Taylor expanded in y around inf 72.5%
if -1.4200000000000001e112 < y < 2.1e82Initial program 100.0%
Taylor expanded in x around inf 49.2%
associate-*r/49.2%
associate-*l/49.0%
*-commutative49.0%
Simplified49.0%
(FPCore (x y z) :precision binary64 (+ (/ 1.0 (/ y (* 4.0 (- x z)))) 2.0))
double code(double x, double y, double z) {
return (1.0 / (y / (4.0 * (x - z)))) + 2.0;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
code = (1.0d0 / (y / (4.0d0 * (x - z)))) + 2.0d0
end function
public static double code(double x, double y, double z) {
return (1.0 / (y / (4.0 * (x - z)))) + 2.0;
}
def code(x, y, z): return (1.0 / (y / (4.0 * (x - z)))) + 2.0
function code(x, y, z) return Float64(Float64(1.0 / Float64(y / Float64(4.0 * Float64(x - z)))) + 2.0) end
function tmp = code(x, y, z) tmp = (1.0 / (y / (4.0 * (x - z)))) + 2.0; end
code[x_, y_, z_] := N[(N[(1.0 / N[(y / N[(4.0 * N[(x - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + 2.0), $MachinePrecision]
\begin{array}{l}
\\
\frac{1}{\frac{y}{4 \cdot \left(x - z\right)}} + 2
\end{array}
Initial program 100.0%
+-commutative100.0%
associate-*l/99.7%
+-commutative99.7%
associate--l+99.7%
+-commutative99.7%
distribute-lft-in99.7%
associate-+l+99.7%
associate-*l/99.7%
*-commutative99.7%
associate-*l*99.7%
metadata-eval99.7%
*-rgt-identity99.7%
*-inverses99.7%
metadata-eval99.7%
Simplified99.7%
associate-*l/100.0%
clear-num99.8%
Applied egg-rr99.8%
(FPCore (x y z) :precision binary64 (+ 2.0 (/ 1.0 (* y (/ 0.25 (- x z))))))
double code(double x, double y, double z) {
return 2.0 + (1.0 / (y * (0.25 / (x - z))));
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
code = 2.0d0 + (1.0d0 / (y * (0.25d0 / (x - z))))
end function
public static double code(double x, double y, double z) {
return 2.0 + (1.0 / (y * (0.25 / (x - z))));
}
def code(x, y, z): return 2.0 + (1.0 / (y * (0.25 / (x - z))))
function code(x, y, z) return Float64(2.0 + Float64(1.0 / Float64(y * Float64(0.25 / Float64(x - z))))) end
function tmp = code(x, y, z) tmp = 2.0 + (1.0 / (y * (0.25 / (x - z)))); end
code[x_, y_, z_] := N[(2.0 + N[(1.0 / N[(y * N[(0.25 / N[(x - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
2 + \frac{1}{y \cdot \frac{0.25}{x - z}}
\end{array}
Initial program 100.0%
+-commutative100.0%
associate-*l/99.7%
+-commutative99.7%
associate--l+99.7%
+-commutative99.7%
distribute-lft-in99.7%
associate-+l+99.7%
associate-*l/99.7%
*-commutative99.7%
associate-*l*99.7%
metadata-eval99.7%
*-rgt-identity99.7%
*-inverses99.7%
metadata-eval99.7%
Simplified99.7%
associate-*l/100.0%
clear-num99.8%
Applied egg-rr99.8%
clear-num99.9%
associate-/r/99.7%
associate-/r*99.7%
metadata-eval99.7%
Applied egg-rr99.7%
Final simplification99.7%
(FPCore (x y z) :precision binary64 (+ 2.0 (* (- x z) (/ 4.0 y))))
double code(double x, double y, double z) {
return 2.0 + ((x - z) * (4.0 / y));
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
code = 2.0d0 + ((x - z) * (4.0d0 / y))
end function
public static double code(double x, double y, double z) {
return 2.0 + ((x - z) * (4.0 / y));
}
def code(x, y, z): return 2.0 + ((x - z) * (4.0 / y))
function code(x, y, z) return Float64(2.0 + Float64(Float64(x - z) * Float64(4.0 / y))) end
function tmp = code(x, y, z) tmp = 2.0 + ((x - z) * (4.0 / y)); end
code[x_, y_, z_] := N[(2.0 + N[(N[(x - z), $MachinePrecision] * N[(4.0 / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
2 + \left(x - z\right) \cdot \frac{4}{y}
\end{array}
Initial program 100.0%
+-commutative100.0%
associate-*l/99.7%
+-commutative99.7%
associate--l+99.7%
+-commutative99.7%
distribute-lft-in99.7%
associate-+l+99.7%
associate-*l/99.7%
*-commutative99.7%
associate-*l*99.7%
metadata-eval99.7%
*-rgt-identity99.7%
*-inverses99.7%
metadata-eval99.7%
Simplified99.7%
Final simplification99.7%
(FPCore (x y z) :precision binary64 2.0)
double code(double x, double y, double z) {
return 2.0;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
code = 2.0d0
end function
public static double code(double x, double y, double z) {
return 2.0;
}
def code(x, y, z): return 2.0
function code(x, y, z) return 2.0 end
function tmp = code(x, y, z) tmp = 2.0; end
code[x_, y_, z_] := 2.0
\begin{array}{l}
\\
2
\end{array}
Initial program 100.0%
Taylor expanded in y around inf 29.9%
herbie shell --seed 2024145
(FPCore (x y z)
:name "Data.Array.Repa.Algorithms.ColorRamp:rampColorHotToCold from repa-algorithms-3.4.0.1, C"
:precision binary64
(+ 1.0 (/ (* 4.0 (- (+ x (* y 0.25)) z)) y)))