
(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 7 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 (+ (* 4.0 (/ (- x z) y)) 2.0))
double code(double x, double y, double z) {
return (4.0 * ((x - z) / y)) + 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 = (4.0d0 * ((x - z) / y)) + 2.0d0
end function
public static double code(double x, double y, double z) {
return (4.0 * ((x - z) / y)) + 2.0;
}
def code(x, y, z): return (4.0 * ((x - z) / y)) + 2.0
function code(x, y, z) return Float64(Float64(4.0 * Float64(Float64(x - z) / y)) + 2.0) end
function tmp = code(x, y, z) tmp = (4.0 * ((x - z) / y)) + 2.0; end
code[x_, y_, z_] := N[(N[(4.0 * N[(N[(x - z), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision] + 2.0), $MachinePrecision]
\begin{array}{l}
\\
4 \cdot \frac{x - z}{y} + 2
\end{array}
Initial program 100.0%
associate-/l*99.8%
associate--l+99.8%
Simplified99.8%
Taylor expanded in y around 0 100.0%
+-commutative100.0%
Simplified100.0%
Final simplification100.0%
(FPCore (x y z)
:precision binary64
(if (<= y -1.16e+179)
2.0
(if (or (<= y 9.2e+59) (and (not (<= y 1.56e+94)) (<= y 4.8e+140)))
(* 4.0 (/ (- x z) y))
2.0)))
double code(double x, double y, double z) {
double tmp;
if (y <= -1.16e+179) {
tmp = 2.0;
} else if ((y <= 9.2e+59) || (!(y <= 1.56e+94) && (y <= 4.8e+140))) {
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.16d+179)) then
tmp = 2.0d0
else if ((y <= 9.2d+59) .or. (.not. (y <= 1.56d+94)) .and. (y <= 4.8d+140)) 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.16e+179) {
tmp = 2.0;
} else if ((y <= 9.2e+59) || (!(y <= 1.56e+94) && (y <= 4.8e+140))) {
tmp = 4.0 * ((x - z) / y);
} else {
tmp = 2.0;
}
return tmp;
}
def code(x, y, z): tmp = 0 if y <= -1.16e+179: tmp = 2.0 elif (y <= 9.2e+59) or (not (y <= 1.56e+94) and (y <= 4.8e+140)): tmp = 4.0 * ((x - z) / y) else: tmp = 2.0 return tmp
function code(x, y, z) tmp = 0.0 if (y <= -1.16e+179) tmp = 2.0; elseif ((y <= 9.2e+59) || (!(y <= 1.56e+94) && (y <= 4.8e+140))) 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.16e+179) tmp = 2.0; elseif ((y <= 9.2e+59) || (~((y <= 1.56e+94)) && (y <= 4.8e+140))) tmp = 4.0 * ((x - z) / y); else tmp = 2.0; end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[y, -1.16e+179], 2.0, If[Or[LessEqual[y, 9.2e+59], And[N[Not[LessEqual[y, 1.56e+94]], $MachinePrecision], LessEqual[y, 4.8e+140]]], N[(4.0 * N[(N[(x - z), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision], 2.0]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.16 \cdot 10^{+179}:\\
\;\;\;\;2\\
\mathbf{elif}\;y \leq 9.2 \cdot 10^{+59} \lor \neg \left(y \leq 1.56 \cdot 10^{+94}\right) \land y \leq 4.8 \cdot 10^{+140}:\\
\;\;\;\;4 \cdot \frac{x - z}{y}\\
\mathbf{else}:\\
\;\;\;\;2\\
\end{array}
\end{array}
if y < -1.16e179 or 9.20000000000000032e59 < y < 1.5600000000000001e94 or 4.7999999999999999e140 < y Initial program 100.0%
associate-/l*100.0%
associate--l+100.0%
Simplified100.0%
Taylor expanded in y around inf 84.8%
if -1.16e179 < y < 9.20000000000000032e59 or 1.5600000000000001e94 < y < 4.7999999999999999e140Initial program 99.9%
associate-/l*99.7%
associate--l+99.7%
Simplified99.7%
Taylor expanded in y around 0 100.0%
+-commutative100.0%
Simplified100.0%
Taylor expanded in y around 0 80.7%
Final simplification81.7%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (* 4.0 (/ x y))))
(if (<= x -9.5e-29)
t_0
(if (<= x 650.0) 2.0 (if (<= x 3.8e+66) (* (/ z y) -4.0) t_0)))))
double code(double x, double y, double z) {
double t_0 = 4.0 * (x / y);
double tmp;
if (x <= -9.5e-29) {
tmp = t_0;
} else if (x <= 650.0) {
tmp = 2.0;
} else if (x <= 3.8e+66) {
tmp = (z / y) * -4.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 = 4.0d0 * (x / y)
if (x <= (-9.5d-29)) then
tmp = t_0
else if (x <= 650.0d0) then
tmp = 2.0d0
else if (x <= 3.8d+66) then
tmp = (z / y) * (-4.0d0)
else
tmp = t_0
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double t_0 = 4.0 * (x / y);
double tmp;
if (x <= -9.5e-29) {
tmp = t_0;
} else if (x <= 650.0) {
tmp = 2.0;
} else if (x <= 3.8e+66) {
tmp = (z / y) * -4.0;
} else {
tmp = t_0;
}
return tmp;
}
def code(x, y, z): t_0 = 4.0 * (x / y) tmp = 0 if x <= -9.5e-29: tmp = t_0 elif x <= 650.0: tmp = 2.0 elif x <= 3.8e+66: tmp = (z / y) * -4.0 else: tmp = t_0 return tmp
function code(x, y, z) t_0 = Float64(4.0 * Float64(x / y)) tmp = 0.0 if (x <= -9.5e-29) tmp = t_0; elseif (x <= 650.0) tmp = 2.0; elseif (x <= 3.8e+66) tmp = Float64(Float64(z / y) * -4.0); else tmp = t_0; end return tmp end
function tmp_2 = code(x, y, z) t_0 = 4.0 * (x / y); tmp = 0.0; if (x <= -9.5e-29) tmp = t_0; elseif (x <= 650.0) tmp = 2.0; elseif (x <= 3.8e+66) tmp = (z / y) * -4.0; else tmp = t_0; end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(4.0 * N[(x / y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -9.5e-29], t$95$0, If[LessEqual[x, 650.0], 2.0, If[LessEqual[x, 3.8e+66], N[(N[(z / y), $MachinePrecision] * -4.0), $MachinePrecision], t$95$0]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 4 \cdot \frac{x}{y}\\
\mathbf{if}\;x \leq -9.5 \cdot 10^{-29}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;x \leq 650:\\
\;\;\;\;2\\
\mathbf{elif}\;x \leq 3.8 \cdot 10^{+66}:\\
\;\;\;\;\frac{z}{y} \cdot -4\\
\mathbf{else}:\\
\;\;\;\;t_0\\
\end{array}
\end{array}
if x < -9.50000000000000023e-29 or 3.8000000000000002e66 < x Initial program 100.0%
associate-*l/99.7%
+-commutative99.7%
associate--l+99.7%
distribute-lft-in99.7%
associate-+r+99.7%
*-commutative99.7%
+-commutative99.7%
fma-def99.7%
*-commutative99.7%
associate-*l*99.7%
associate-*r/99.7%
metadata-eval99.7%
rgt-mult-inverse99.7%
metadata-eval99.7%
Simplified99.7%
fma-udef99.7%
flip-+47.4%
metadata-eval47.4%
Applied egg-rr47.4%
associate-*r*37.0%
*-commutative37.0%
fma-neg37.0%
*-commutative37.0%
associate-*l*23.9%
unpow223.9%
metadata-eval23.9%
*-commutative23.9%
associate-*l/23.9%
associate-*r/23.9%
fma-neg23.9%
metadata-eval23.9%
Simplified23.9%
Taylor expanded in z around inf 75.8%
Taylor expanded in x around inf 66.6%
if -9.50000000000000023e-29 < x < 650Initial program 99.9%
associate-/l*99.8%
associate--l+99.8%
Simplified99.8%
Taylor expanded in y around inf 56.1%
if 650 < x < 3.8000000000000002e66Initial program 99.9%
associate-*l/99.6%
+-commutative99.6%
associate--l+99.8%
distribute-lft-in99.8%
associate-+r+99.8%
*-commutative99.8%
+-commutative99.8%
fma-def99.8%
*-commutative99.8%
associate-*l*99.8%
associate-*r/99.8%
metadata-eval99.8%
rgt-mult-inverse99.8%
metadata-eval99.8%
Simplified99.8%
fma-udef99.8%
flip-+46.3%
metadata-eval46.3%
Applied egg-rr46.3%
associate-*r*46.3%
*-commutative46.3%
fma-neg46.3%
*-commutative46.3%
associate-*l*38.7%
unpow238.7%
metadata-eval38.7%
*-commutative38.7%
associate-*l/38.5%
associate-*r/38.5%
fma-neg38.5%
metadata-eval38.5%
Simplified38.5%
Taylor expanded in z around inf 99.8%
Taylor expanded in z around inf 69.0%
Final simplification62.0%
(FPCore (x y z) :precision binary64 (if (or (<= z -1.85e+115) (not (<= z 1.7e+80))) (* 4.0 (/ (- x z) y)) (+ 2.0 (* 4.0 (/ x y)))))
double code(double x, double y, double z) {
double tmp;
if ((z <= -1.85e+115) || !(z <= 1.7e+80)) {
tmp = 4.0 * ((x - z) / y);
} else {
tmp = 2.0 + (4.0 * (x / 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 ((z <= (-1.85d+115)) .or. (.not. (z <= 1.7d+80))) then
tmp = 4.0d0 * ((x - z) / y)
else
tmp = 2.0d0 + (4.0d0 * (x / y))
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if ((z <= -1.85e+115) || !(z <= 1.7e+80)) {
tmp = 4.0 * ((x - z) / y);
} else {
tmp = 2.0 + (4.0 * (x / y));
}
return tmp;
}
def code(x, y, z): tmp = 0 if (z <= -1.85e+115) or not (z <= 1.7e+80): tmp = 4.0 * ((x - z) / y) else: tmp = 2.0 + (4.0 * (x / y)) return tmp
function code(x, y, z) tmp = 0.0 if ((z <= -1.85e+115) || !(z <= 1.7e+80)) tmp = Float64(4.0 * Float64(Float64(x - z) / y)); else tmp = Float64(2.0 + Float64(4.0 * Float64(x / y))); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if ((z <= -1.85e+115) || ~((z <= 1.7e+80))) tmp = 4.0 * ((x - z) / y); else tmp = 2.0 + (4.0 * (x / y)); end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[z, -1.85e+115], N[Not[LessEqual[z, 1.7e+80]], $MachinePrecision]], N[(4.0 * N[(N[(x - z), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision], N[(2.0 + N[(4.0 * N[(x / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.85 \cdot 10^{+115} \lor \neg \left(z \leq 1.7 \cdot 10^{+80}\right):\\
\;\;\;\;4 \cdot \frac{x - z}{y}\\
\mathbf{else}:\\
\;\;\;\;2 + 4 \cdot \frac{x}{y}\\
\end{array}
\end{array}
if z < -1.85000000000000003e115 or 1.69999999999999996e80 < z Initial program 100.0%
associate-/l*99.8%
associate--l+99.8%
Simplified99.8%
Taylor expanded in y around 0 100.0%
+-commutative100.0%
Simplified100.0%
Taylor expanded in y around 0 89.7%
if -1.85000000000000003e115 < z < 1.69999999999999996e80Initial program 99.9%
associate-*l/99.7%
+-commutative99.7%
associate--l+99.7%
distribute-lft-in99.8%
associate-+r+99.8%
*-commutative99.8%
+-commutative99.8%
fma-def99.8%
*-commutative99.8%
associate-*l*99.8%
associate-*r/99.8%
metadata-eval99.8%
rgt-mult-inverse99.8%
metadata-eval99.8%
Simplified99.8%
Taylor expanded in z around 0 90.6%
Final simplification90.3%
(FPCore (x y z) :precision binary64 (if (<= z -2.6e+44) (+ 2.0 (* (/ z y) -4.0)) (if (<= z 1.9e+78) (+ 2.0 (* 4.0 (/ x y))) (* 4.0 (/ (- x z) y)))))
double code(double x, double y, double z) {
double tmp;
if (z <= -2.6e+44) {
tmp = 2.0 + ((z / y) * -4.0);
} else if (z <= 1.9e+78) {
tmp = 2.0 + (4.0 * (x / y));
} 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 (z <= (-2.6d+44)) then
tmp = 2.0d0 + ((z / y) * (-4.0d0))
else if (z <= 1.9d+78) then
tmp = 2.0d0 + (4.0d0 * (x / y))
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 (z <= -2.6e+44) {
tmp = 2.0 + ((z / y) * -4.0);
} else if (z <= 1.9e+78) {
tmp = 2.0 + (4.0 * (x / y));
} else {
tmp = 4.0 * ((x - z) / y);
}
return tmp;
}
def code(x, y, z): tmp = 0 if z <= -2.6e+44: tmp = 2.0 + ((z / y) * -4.0) elif z <= 1.9e+78: tmp = 2.0 + (4.0 * (x / y)) else: tmp = 4.0 * ((x - z) / y) return tmp
function code(x, y, z) tmp = 0.0 if (z <= -2.6e+44) tmp = Float64(2.0 + Float64(Float64(z / y) * -4.0)); elseif (z <= 1.9e+78) tmp = Float64(2.0 + Float64(4.0 * Float64(x / y))); 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 (z <= -2.6e+44) tmp = 2.0 + ((z / y) * -4.0); elseif (z <= 1.9e+78) tmp = 2.0 + (4.0 * (x / y)); else tmp = 4.0 * ((x - z) / y); end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[z, -2.6e+44], N[(2.0 + N[(N[(z / y), $MachinePrecision] * -4.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.9e+78], N[(2.0 + N[(4.0 * N[(x / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(4.0 * N[(N[(x - z), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.6 \cdot 10^{+44}:\\
\;\;\;\;2 + \frac{z}{y} \cdot -4\\
\mathbf{elif}\;z \leq 1.9 \cdot 10^{+78}:\\
\;\;\;\;2 + 4 \cdot \frac{x}{y}\\
\mathbf{else}:\\
\;\;\;\;4 \cdot \frac{x - z}{y}\\
\end{array}
\end{array}
if z < -2.5999999999999999e44Initial program 100.0%
associate-*l/99.8%
+-commutative99.8%
associate--l+99.8%
distribute-lft-in99.8%
associate-+r+99.8%
*-commutative99.8%
+-commutative99.8%
fma-def99.8%
*-commutative99.8%
associate-*l*99.8%
associate-*r/99.8%
metadata-eval99.8%
rgt-mult-inverse99.8%
metadata-eval99.8%
Simplified99.8%
Taylor expanded in x around 0 88.0%
+-commutative88.0%
*-commutative88.0%
Simplified88.0%
if -2.5999999999999999e44 < z < 1.9e78Initial program 99.9%
associate-*l/99.7%
+-commutative99.7%
associate--l+99.7%
distribute-lft-in99.7%
associate-+r+99.8%
*-commutative99.8%
+-commutative99.8%
fma-def99.8%
*-commutative99.8%
associate-*l*99.8%
associate-*r/99.8%
metadata-eval99.8%
rgt-mult-inverse99.8%
metadata-eval99.8%
Simplified99.8%
Taylor expanded in z around 0 92.3%
if 1.9e78 < z Initial program 100.0%
associate-/l*99.7%
associate--l+99.7%
Simplified99.7%
Taylor expanded in y around 0 100.0%
+-commutative100.0%
Simplified100.0%
Taylor expanded in y around 0 90.6%
Final simplification91.2%
(FPCore (x y z) :precision binary64 (if (or (<= z -1.82e+115) (not (<= z 1.55e+100))) (* (/ z y) -4.0) 2.0))
double code(double x, double y, double z) {
double tmp;
if ((z <= -1.82e+115) || !(z <= 1.55e+100)) {
tmp = (z / y) * -4.0;
} 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 ((z <= (-1.82d+115)) .or. (.not. (z <= 1.55d+100))) then
tmp = (z / y) * (-4.0d0)
else
tmp = 2.0d0
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if ((z <= -1.82e+115) || !(z <= 1.55e+100)) {
tmp = (z / y) * -4.0;
} else {
tmp = 2.0;
}
return tmp;
}
def code(x, y, z): tmp = 0 if (z <= -1.82e+115) or not (z <= 1.55e+100): tmp = (z / y) * -4.0 else: tmp = 2.0 return tmp
function code(x, y, z) tmp = 0.0 if ((z <= -1.82e+115) || !(z <= 1.55e+100)) tmp = Float64(Float64(z / y) * -4.0); else tmp = 2.0; end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if ((z <= -1.82e+115) || ~((z <= 1.55e+100))) tmp = (z / y) * -4.0; else tmp = 2.0; end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[z, -1.82e+115], N[Not[LessEqual[z, 1.55e+100]], $MachinePrecision]], N[(N[(z / y), $MachinePrecision] * -4.0), $MachinePrecision], 2.0]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.82 \cdot 10^{+115} \lor \neg \left(z \leq 1.55 \cdot 10^{+100}\right):\\
\;\;\;\;\frac{z}{y} \cdot -4\\
\mathbf{else}:\\
\;\;\;\;2\\
\end{array}
\end{array}
if z < -1.82e115 or 1.55000000000000003e100 < z Initial program 100.0%
associate-*l/99.8%
+-commutative99.8%
associate--l+99.8%
distribute-lft-in99.8%
associate-+r+99.8%
*-commutative99.8%
+-commutative99.8%
fma-def99.8%
*-commutative99.8%
associate-*l*99.8%
associate-*r/99.8%
metadata-eval99.8%
rgt-mult-inverse99.8%
metadata-eval99.8%
Simplified99.8%
fma-udef99.8%
flip-+30.5%
metadata-eval30.5%
Applied egg-rr30.5%
associate-*r*23.1%
*-commutative23.1%
fma-neg23.1%
*-commutative23.1%
associate-*l*9.2%
unpow29.2%
metadata-eval9.2%
*-commutative9.2%
associate-*l/9.2%
associate-*r/9.2%
fma-neg9.2%
metadata-eval9.2%
Simplified9.2%
Taylor expanded in z around inf 84.4%
Taylor expanded in z around inf 79.3%
if -1.82e115 < z < 1.55000000000000003e100Initial program 99.9%
associate-/l*99.7%
associate--l+99.7%
Simplified99.7%
Taylor expanded in y around inf 46.4%
Final simplification56.3%
(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%
associate-/l*99.8%
associate--l+99.8%
Simplified99.8%
Taylor expanded in y around inf 35.7%
Final simplification35.7%
herbie shell --seed 2023185
(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)))