
(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(Float64(4.0 * 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[(N[(4.0 * N[(x - z), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision] + 2.0), $MachinePrecision]
\begin{array}{l}
\\
\frac{4 \cdot \left(x - z\right)}{y} + 2
\end{array}
Initial program 99.9%
+-commutative99.9%
associate-*l/99.7%
+-commutative99.7%
associate--l+99.7%
+-commutative99.7%
distribute-lft-in99.7%
associate-+l+99.7%
associate-*l/100.0%
associate-*l/100.0%
*-commutative100.0%
associate-*l*100.0%
metadata-eval100.0%
*-rgt-identity100.0%
*-inverses100.0%
metadata-eval100.0%
Simplified100.0%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (* 4.0 (/ x y))) (t_1 (* -4.0 (/ z y))))
(if (<= x -5e-8)
t_0
(if (<= x -5.7e-160)
t_1
(if (<= x -4.5e-200)
2.0
(if (<= x 2.7e-244)
t_1
(if (<= x 1.4e-170) 2.0 (if (<= x 5.6e-17) t_1 t_0))))))))
double code(double x, double y, double z) {
double t_0 = 4.0 * (x / y);
double t_1 = -4.0 * (z / y);
double tmp;
if (x <= -5e-8) {
tmp = t_0;
} else if (x <= -5.7e-160) {
tmp = t_1;
} else if (x <= -4.5e-200) {
tmp = 2.0;
} else if (x <= 2.7e-244) {
tmp = t_1;
} else if (x <= 1.4e-170) {
tmp = 2.0;
} else if (x <= 5.6e-17) {
tmp = t_1;
} 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) :: t_1
real(8) :: tmp
t_0 = 4.0d0 * (x / y)
t_1 = (-4.0d0) * (z / y)
if (x <= (-5d-8)) then
tmp = t_0
else if (x <= (-5.7d-160)) then
tmp = t_1
else if (x <= (-4.5d-200)) then
tmp = 2.0d0
else if (x <= 2.7d-244) then
tmp = t_1
else if (x <= 1.4d-170) then
tmp = 2.0d0
else if (x <= 5.6d-17) then
tmp = t_1
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 t_1 = -4.0 * (z / y);
double tmp;
if (x <= -5e-8) {
tmp = t_0;
} else if (x <= -5.7e-160) {
tmp = t_1;
} else if (x <= -4.5e-200) {
tmp = 2.0;
} else if (x <= 2.7e-244) {
tmp = t_1;
} else if (x <= 1.4e-170) {
tmp = 2.0;
} else if (x <= 5.6e-17) {
tmp = t_1;
} else {
tmp = t_0;
}
return tmp;
}
def code(x, y, z): t_0 = 4.0 * (x / y) t_1 = -4.0 * (z / y) tmp = 0 if x <= -5e-8: tmp = t_0 elif x <= -5.7e-160: tmp = t_1 elif x <= -4.5e-200: tmp = 2.0 elif x <= 2.7e-244: tmp = t_1 elif x <= 1.4e-170: tmp = 2.0 elif x <= 5.6e-17: tmp = t_1 else: tmp = t_0 return tmp
function code(x, y, z) t_0 = Float64(4.0 * Float64(x / y)) t_1 = Float64(-4.0 * Float64(z / y)) tmp = 0.0 if (x <= -5e-8) tmp = t_0; elseif (x <= -5.7e-160) tmp = t_1; elseif (x <= -4.5e-200) tmp = 2.0; elseif (x <= 2.7e-244) tmp = t_1; elseif (x <= 1.4e-170) tmp = 2.0; elseif (x <= 5.6e-17) tmp = t_1; else tmp = t_0; end return tmp end
function tmp_2 = code(x, y, z) t_0 = 4.0 * (x / y); t_1 = -4.0 * (z / y); tmp = 0.0; if (x <= -5e-8) tmp = t_0; elseif (x <= -5.7e-160) tmp = t_1; elseif (x <= -4.5e-200) tmp = 2.0; elseif (x <= 2.7e-244) tmp = t_1; elseif (x <= 1.4e-170) tmp = 2.0; elseif (x <= 5.6e-17) tmp = t_1; 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]}, Block[{t$95$1 = N[(-4.0 * N[(z / y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -5e-8], t$95$0, If[LessEqual[x, -5.7e-160], t$95$1, If[LessEqual[x, -4.5e-200], 2.0, If[LessEqual[x, 2.7e-244], t$95$1, If[LessEqual[x, 1.4e-170], 2.0, If[LessEqual[x, 5.6e-17], t$95$1, t$95$0]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 4 \cdot \frac{x}{y}\\
t_1 := -4 \cdot \frac{z}{y}\\
\mathbf{if}\;x \leq -5 \cdot 10^{-8}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;x \leq -5.7 \cdot 10^{-160}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \leq -4.5 \cdot 10^{-200}:\\
\;\;\;\;2\\
\mathbf{elif}\;x \leq 2.7 \cdot 10^{-244}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \leq 1.4 \cdot 10^{-170}:\\
\;\;\;\;2\\
\mathbf{elif}\;x \leq 5.6 \cdot 10^{-17}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if x < -4.9999999999999998e-8 or 5.5999999999999998e-17 < x Initial program 99.9%
+-commutative99.9%
associate-*l/99.7%
+-commutative99.7%
associate--l+99.7%
+-commutative99.7%
distribute-lft-in99.7%
associate-+l+99.7%
associate-*l/100.0%
associate-*l/100.0%
*-commutative100.0%
associate-*l*100.0%
metadata-eval100.0%
*-rgt-identity100.0%
*-inverses100.0%
metadata-eval100.0%
Simplified100.0%
Taylor expanded in y around 0 99.9%
Taylor expanded in x around inf 57.5%
if -4.9999999999999998e-8 < x < -5.70000000000000038e-160 or -4.5000000000000002e-200 < x < 2.7e-244 or 1.39999999999999998e-170 < x < 5.5999999999999998e-17Initial 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/100.0%
associate-*l/100.0%
*-commutative100.0%
associate-*l*100.0%
metadata-eval100.0%
*-rgt-identity100.0%
*-inverses100.0%
metadata-eval100.0%
Simplified100.0%
Taylor expanded in y around 0 100.0%
Taylor expanded in z around inf 62.7%
if -5.70000000000000038e-160 < x < -4.5000000000000002e-200 or 2.7e-244 < x < 1.39999999999999998e-170Initial program 100.0%
+-commutative100.0%
associate-*l/99.9%
+-commutative99.9%
associate--l+99.9%
+-commutative99.9%
distribute-lft-in99.9%
associate-+l+99.9%
associate-*l/100.0%
associate-*l/100.0%
*-commutative100.0%
associate-*l*100.0%
metadata-eval100.0%
*-rgt-identity100.0%
*-inverses100.0%
metadata-eval100.0%
Simplified100.0%
Taylor expanded in y around inf 82.2%
(FPCore (x y z) :precision binary64 (if (or (<= y -3.1e-32) (not (<= y 30500.0))) (+ 2.0 (* -4.0 (/ z y))) (* (- x z) (/ 4.0 y))))
double code(double x, double y, double z) {
double tmp;
if ((y <= -3.1e-32) || !(y <= 30500.0)) {
tmp = 2.0 + (-4.0 * (z / y));
} else {
tmp = (x - z) * (4.0 / 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 <= (-3.1d-32)) .or. (.not. (y <= 30500.0d0))) then
tmp = 2.0d0 + ((-4.0d0) * (z / y))
else
tmp = (x - z) * (4.0d0 / y)
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if ((y <= -3.1e-32) || !(y <= 30500.0)) {
tmp = 2.0 + (-4.0 * (z / y));
} else {
tmp = (x - z) * (4.0 / y);
}
return tmp;
}
def code(x, y, z): tmp = 0 if (y <= -3.1e-32) or not (y <= 30500.0): tmp = 2.0 + (-4.0 * (z / y)) else: tmp = (x - z) * (4.0 / y) return tmp
function code(x, y, z) tmp = 0.0 if ((y <= -3.1e-32) || !(y <= 30500.0)) tmp = Float64(2.0 + Float64(-4.0 * Float64(z / y))); else tmp = Float64(Float64(x - z) * Float64(4.0 / y)); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if ((y <= -3.1e-32) || ~((y <= 30500.0))) tmp = 2.0 + (-4.0 * (z / y)); else tmp = (x - z) * (4.0 / y); end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[y, -3.1e-32], N[Not[LessEqual[y, 30500.0]], $MachinePrecision]], N[(2.0 + N[(-4.0 * N[(z / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x - z), $MachinePrecision] * N[(4.0 / y), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -3.1 \cdot 10^{-32} \lor \neg \left(y \leq 30500\right):\\
\;\;\;\;2 + -4 \cdot \frac{z}{y}\\
\mathbf{else}:\\
\;\;\;\;\left(x - z\right) \cdot \frac{4}{y}\\
\end{array}
\end{array}
if y < -3.10000000000000011e-32 or 30500 < y Initial program 99.9%
+-commutative99.9%
associate-*l/99.8%
+-commutative99.8%
associate--l+99.8%
+-commutative99.8%
distribute-lft-in99.8%
associate-+l+99.8%
associate-*l/100.0%
associate-*l/100.0%
*-commutative100.0%
associate-*l*100.0%
metadata-eval100.0%
*-rgt-identity100.0%
*-inverses100.0%
metadata-eval100.0%
Simplified100.0%
Taylor expanded in x around 0 83.5%
if -3.10000000000000011e-32 < y < 30500Initial 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/100.0%
associate-*l/100.0%
*-commutative100.0%
associate-*l*100.0%
metadata-eval100.0%
*-rgt-identity100.0%
*-inverses100.0%
metadata-eval100.0%
Simplified100.0%
Taylor expanded in y around 0 100.0%
Taylor expanded in y around 0 94.4%
associate-*r/94.4%
associate-*l/94.2%
*-commutative94.2%
Simplified94.2%
Final simplification89.2%
(FPCore (x y z) :precision binary64 (if (or (<= y -1.1e+93) (not (<= y 1.8e+180))) 2.0 (* (- x z) (/ 4.0 y))))
double code(double x, double y, double z) {
double tmp;
if ((y <= -1.1e+93) || !(y <= 1.8e+180)) {
tmp = 2.0;
} else {
tmp = (x - z) * (4.0 / 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.1d+93)) .or. (.not. (y <= 1.8d+180))) then
tmp = 2.0d0
else
tmp = (x - z) * (4.0d0 / y)
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if ((y <= -1.1e+93) || !(y <= 1.8e+180)) {
tmp = 2.0;
} else {
tmp = (x - z) * (4.0 / y);
}
return tmp;
}
def code(x, y, z): tmp = 0 if (y <= -1.1e+93) or not (y <= 1.8e+180): tmp = 2.0 else: tmp = (x - z) * (4.0 / y) return tmp
function code(x, y, z) tmp = 0.0 if ((y <= -1.1e+93) || !(y <= 1.8e+180)) tmp = 2.0; else tmp = Float64(Float64(x - z) * Float64(4.0 / y)); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if ((y <= -1.1e+93) || ~((y <= 1.8e+180))) tmp = 2.0; else tmp = (x - z) * (4.0 / y); end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[y, -1.1e+93], N[Not[LessEqual[y, 1.8e+180]], $MachinePrecision]], 2.0, N[(N[(x - z), $MachinePrecision] * N[(4.0 / y), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.1 \cdot 10^{+93} \lor \neg \left(y \leq 1.8 \cdot 10^{+180}\right):\\
\;\;\;\;2\\
\mathbf{else}:\\
\;\;\;\;\left(x - z\right) \cdot \frac{4}{y}\\
\end{array}
\end{array}
if y < -1.10000000000000011e93 or 1.8000000000000001e180 < y Initial program 99.9%
+-commutative99.9%
associate-*l/99.8%
+-commutative99.8%
associate--l+99.8%
+-commutative99.8%
distribute-lft-in99.8%
associate-+l+99.9%
associate-*l/100.0%
associate-*l/100.0%
*-commutative100.0%
associate-*l*100.0%
metadata-eval100.0%
*-rgt-identity100.0%
*-inverses100.0%
metadata-eval100.0%
Simplified100.0%
Taylor expanded in y around inf 73.3%
if -1.10000000000000011e93 < y < 1.8000000000000001e180Initial 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/100.0%
associate-*l/100.0%
*-commutative100.0%
associate-*l*100.0%
metadata-eval100.0%
*-rgt-identity100.0%
*-inverses100.0%
metadata-eval100.0%
Simplified100.0%
Taylor expanded in y around 0 100.0%
Taylor expanded in y around 0 83.9%
associate-*r/83.9%
associate-*l/83.7%
*-commutative83.7%
Simplified83.7%
Final simplification81.1%
(FPCore (x y z) :precision binary64 (if (or (<= z -1.2e+54) (not (<= z 5.5e+47))) (* -4.0 (/ z y)) 2.0))
double code(double x, double y, double z) {
double tmp;
if ((z <= -1.2e+54) || !(z <= 5.5e+47)) {
tmp = -4.0 * (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 ((z <= (-1.2d+54)) .or. (.not. (z <= 5.5d+47))) then
tmp = (-4.0d0) * (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 ((z <= -1.2e+54) || !(z <= 5.5e+47)) {
tmp = -4.0 * (z / y);
} else {
tmp = 2.0;
}
return tmp;
}
def code(x, y, z): tmp = 0 if (z <= -1.2e+54) or not (z <= 5.5e+47): tmp = -4.0 * (z / y) else: tmp = 2.0 return tmp
function code(x, y, z) tmp = 0.0 if ((z <= -1.2e+54) || !(z <= 5.5e+47)) tmp = Float64(-4.0 * Float64(z / y)); else tmp = 2.0; end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if ((z <= -1.2e+54) || ~((z <= 5.5e+47))) tmp = -4.0 * (z / y); else tmp = 2.0; end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[z, -1.2e+54], N[Not[LessEqual[z, 5.5e+47]], $MachinePrecision]], N[(-4.0 * N[(z / y), $MachinePrecision]), $MachinePrecision], 2.0]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.2 \cdot 10^{+54} \lor \neg \left(z \leq 5.5 \cdot 10^{+47}\right):\\
\;\;\;\;-4 \cdot \frac{z}{y}\\
\mathbf{else}:\\
\;\;\;\;2\\
\end{array}
\end{array}
if z < -1.19999999999999999e54 or 5.4999999999999998e47 < z Initial program 99.9%
+-commutative99.9%
associate-*l/99.7%
+-commutative99.7%
associate--l+99.7%
+-commutative99.7%
distribute-lft-in99.7%
associate-+l+99.7%
associate-*l/100.0%
associate-*l/100.0%
*-commutative100.0%
associate-*l*100.0%
metadata-eval100.0%
*-rgt-identity100.0%
*-inverses100.0%
metadata-eval100.0%
Simplified100.0%
Taylor expanded in y around 0 99.9%
Taylor expanded in z around inf 71.2%
if -1.19999999999999999e54 < z < 5.4999999999999998e47Initial program 100.0%
+-commutative100.0%
associate-*l/99.7%
+-commutative99.7%
associate--l+99.7%
+-commutative99.7%
distribute-lft-in99.8%
associate-+l+99.8%
associate-*l/100.0%
associate-*l/100.0%
*-commutative100.0%
associate-*l*100.0%
metadata-eval100.0%
*-rgt-identity100.0%
*-inverses100.0%
metadata-eval100.0%
Simplified100.0%
Taylor expanded in y around inf 43.6%
Final simplification55.3%
(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 99.9%
+-commutative99.9%
associate-*l/99.7%
+-commutative99.7%
associate--l+99.7%
+-commutative99.7%
distribute-lft-in99.7%
associate-+l+99.7%
associate-*l/100.0%
associate-*l/100.0%
*-commutative100.0%
associate-*l*100.0%
metadata-eval100.0%
*-rgt-identity100.0%
*-inverses100.0%
metadata-eval100.0%
Simplified100.0%
Taylor expanded in x around 0 98.8%
+-commutative98.8%
associate-*r/98.8%
remove-double-neg98.8%
neg-mul-198.8%
times-frac98.8%
metadata-eval98.8%
distribute-lft-out98.8%
metadata-eval98.8%
remove-double-neg98.8%
distribute-frac-neg298.8%
sub-neg98.8%
div-sub100.0%
times-frac100.0%
neg-mul-1100.0%
remove-double-neg100.0%
associate-*l/99.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 99.9%
+-commutative99.9%
associate-*l/99.7%
+-commutative99.7%
associate--l+99.7%
+-commutative99.7%
distribute-lft-in99.7%
associate-+l+99.7%
associate-*l/100.0%
associate-*l/100.0%
*-commutative100.0%
associate-*l*100.0%
metadata-eval100.0%
*-rgt-identity100.0%
*-inverses100.0%
metadata-eval100.0%
Simplified100.0%
Taylor expanded in y around inf 31.4%
herbie shell --seed 2024096
(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)))