
(FPCore (x y z) :precision binary64 (+ 1.0 (/ (* 4.0 (- (+ x (* y 0.75)) z)) y)))
double code(double x, double y, double z) {
return 1.0 + ((4.0 * ((x + (y * 0.75)) - 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.75d0)) - z)) / y)
end function
public static double code(double x, double y, double z) {
return 1.0 + ((4.0 * ((x + (y * 0.75)) - z)) / y);
}
def code(x, y, z): return 1.0 + ((4.0 * ((x + (y * 0.75)) - z)) / y)
function code(x, y, z) return Float64(1.0 + Float64(Float64(4.0 * Float64(Float64(x + Float64(y * 0.75)) - z)) / y)) end
function tmp = code(x, y, z) tmp = 1.0 + ((4.0 * ((x + (y * 0.75)) - z)) / y); end
code[x_, y_, z_] := N[(1.0 + N[(N[(4.0 * N[(N[(x + N[(y * 0.75), $MachinePrecision]), $MachinePrecision] - z), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
1 + \frac{4 \cdot \left(\left(x + y \cdot 0.75\right) - z\right)}{y}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 8 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z) :precision binary64 (+ 1.0 (/ (* 4.0 (- (+ x (* y 0.75)) z)) y)))
double code(double x, double y, double z) {
return 1.0 + ((4.0 * ((x + (y * 0.75)) - 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.75d0)) - z)) / y)
end function
public static double code(double x, double y, double z) {
return 1.0 + ((4.0 * ((x + (y * 0.75)) - z)) / y);
}
def code(x, y, z): return 1.0 + ((4.0 * ((x + (y * 0.75)) - z)) / y)
function code(x, y, z) return Float64(1.0 + Float64(Float64(4.0 * Float64(Float64(x + Float64(y * 0.75)) - z)) / y)) end
function tmp = code(x, y, z) tmp = 1.0 + ((4.0 * ((x + (y * 0.75)) - z)) / y); end
code[x_, y_, z_] := N[(1.0 + N[(N[(4.0 * N[(N[(x + N[(y * 0.75), $MachinePrecision]), $MachinePrecision] - z), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
1 + \frac{4 \cdot \left(\left(x + y \cdot 0.75\right) - z\right)}{y}
\end{array}
(FPCore (x y z) :precision binary64 (+ 1.0 (* 4.0 (+ 0.75 (/ (- x z) y)))))
double code(double x, double y, double z) {
return 1.0 + (4.0 * (0.75 + ((x - 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 * (0.75d0 + ((x - z) / y)))
end function
public static double code(double x, double y, double z) {
return 1.0 + (4.0 * (0.75 + ((x - z) / y)));
}
def code(x, y, z): return 1.0 + (4.0 * (0.75 + ((x - z) / y)))
function code(x, y, z) return Float64(1.0 + Float64(4.0 * Float64(0.75 + Float64(Float64(x - z) / y)))) end
function tmp = code(x, y, z) tmp = 1.0 + (4.0 * (0.75 + ((x - z) / y))); end
code[x_, y_, z_] := N[(1.0 + N[(4.0 * N[(0.75 + N[(N[(x - z), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
1 + 4 \cdot \left(0.75 + \frac{x - z}{y}\right)
\end{array}
Initial program 99.6%
associate-/l*99.9%
associate--l+99.9%
Simplified99.9%
Taylor expanded in x around 0 96.9%
associate--l+96.9%
div-sub100.0%
Simplified100.0%
(FPCore (x y z)
:precision binary64
(if (or (<= z -7e+141)
(not (or (<= z 9.6e-32) (and (not (<= z 3.9e+18)) (<= z 3.05e+116)))))
(+ 1.0 (/ (* z -4.0) y))
(+ 1.0 (* 4.0 (+ 0.75 (/ x y))))))
double code(double x, double y, double z) {
double tmp;
if ((z <= -7e+141) || !((z <= 9.6e-32) || (!(z <= 3.9e+18) && (z <= 3.05e+116)))) {
tmp = 1.0 + ((z * -4.0) / y);
} else {
tmp = 1.0 + (4.0 * (0.75 + (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 <= (-7d+141)) .or. (.not. (z <= 9.6d-32) .or. (.not. (z <= 3.9d+18)) .and. (z <= 3.05d+116))) then
tmp = 1.0d0 + ((z * (-4.0d0)) / y)
else
tmp = 1.0d0 + (4.0d0 * (0.75d0 + (x / y)))
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if ((z <= -7e+141) || !((z <= 9.6e-32) || (!(z <= 3.9e+18) && (z <= 3.05e+116)))) {
tmp = 1.0 + ((z * -4.0) / y);
} else {
tmp = 1.0 + (4.0 * (0.75 + (x / y)));
}
return tmp;
}
def code(x, y, z): tmp = 0 if (z <= -7e+141) or not ((z <= 9.6e-32) or (not (z <= 3.9e+18) and (z <= 3.05e+116))): tmp = 1.0 + ((z * -4.0) / y) else: tmp = 1.0 + (4.0 * (0.75 + (x / y))) return tmp
function code(x, y, z) tmp = 0.0 if ((z <= -7e+141) || !((z <= 9.6e-32) || (!(z <= 3.9e+18) && (z <= 3.05e+116)))) tmp = Float64(1.0 + Float64(Float64(z * -4.0) / y)); else tmp = Float64(1.0 + Float64(4.0 * Float64(0.75 + Float64(x / y)))); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if ((z <= -7e+141) || ~(((z <= 9.6e-32) || (~((z <= 3.9e+18)) && (z <= 3.05e+116))))) tmp = 1.0 + ((z * -4.0) / y); else tmp = 1.0 + (4.0 * (0.75 + (x / y))); end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[z, -7e+141], N[Not[Or[LessEqual[z, 9.6e-32], And[N[Not[LessEqual[z, 3.9e+18]], $MachinePrecision], LessEqual[z, 3.05e+116]]]], $MachinePrecision]], N[(1.0 + N[(N[(z * -4.0), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision], N[(1.0 + N[(4.0 * N[(0.75 + N[(x / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -7 \cdot 10^{+141} \lor \neg \left(z \leq 9.6 \cdot 10^{-32} \lor \neg \left(z \leq 3.9 \cdot 10^{+18}\right) \land z \leq 3.05 \cdot 10^{+116}\right):\\
\;\;\;\;1 + \frac{z \cdot -4}{y}\\
\mathbf{else}:\\
\;\;\;\;1 + 4 \cdot \left(0.75 + \frac{x}{y}\right)\\
\end{array}
\end{array}
if z < -6.9999999999999999e141 or 9.6000000000000005e-32 < z < 3.9e18 or 3.05000000000000009e116 < z Initial program 100.0%
associate-/l*100.0%
associate--l+100.0%
Simplified100.0%
Taylor expanded in z around inf 79.2%
neg-mul-179.2%
distribute-neg-frac279.2%
Simplified79.2%
Taylor expanded in z around 0 79.2%
associate-*r/79.2%
Simplified79.2%
if -6.9999999999999999e141 < z < 9.6000000000000005e-32 or 3.9e18 < z < 3.05000000000000009e116Initial program 99.3%
associate-/l*99.9%
associate--l+99.9%
Simplified99.9%
Taylor expanded in x around 0 100.0%
Taylor expanded in z around 0 87.2%
Final simplification84.3%
(FPCore (x y z) :precision binary64 (if (or (<= y -2.9e+50) (not (<= y 1.25e+87))) (+ 1.0 (* 4.0 (+ 0.75 (/ x y)))) (+ 1.0 (* 4.0 (/ (- x z) y)))))
double code(double x, double y, double z) {
double tmp;
if ((y <= -2.9e+50) || !(y <= 1.25e+87)) {
tmp = 1.0 + (4.0 * (0.75 + (x / y)));
} else {
tmp = 1.0 + (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 <= (-2.9d+50)) .or. (.not. (y <= 1.25d+87))) then
tmp = 1.0d0 + (4.0d0 * (0.75d0 + (x / y)))
else
tmp = 1.0d0 + (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 <= -2.9e+50) || !(y <= 1.25e+87)) {
tmp = 1.0 + (4.0 * (0.75 + (x / y)));
} else {
tmp = 1.0 + (4.0 * ((x - z) / y));
}
return tmp;
}
def code(x, y, z): tmp = 0 if (y <= -2.9e+50) or not (y <= 1.25e+87): tmp = 1.0 + (4.0 * (0.75 + (x / y))) else: tmp = 1.0 + (4.0 * ((x - z) / y)) return tmp
function code(x, y, z) tmp = 0.0 if ((y <= -2.9e+50) || !(y <= 1.25e+87)) tmp = Float64(1.0 + Float64(4.0 * Float64(0.75 + Float64(x / y)))); else tmp = Float64(1.0 + Float64(4.0 * Float64(Float64(x - z) / y))); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if ((y <= -2.9e+50) || ~((y <= 1.25e+87))) tmp = 1.0 + (4.0 * (0.75 + (x / y))); else tmp = 1.0 + (4.0 * ((x - z) / y)); end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[y, -2.9e+50], N[Not[LessEqual[y, 1.25e+87]], $MachinePrecision]], N[(1.0 + N[(4.0 * N[(0.75 + N[(x / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 + N[(4.0 * N[(N[(x - z), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -2.9 \cdot 10^{+50} \lor \neg \left(y \leq 1.25 \cdot 10^{+87}\right):\\
\;\;\;\;1 + 4 \cdot \left(0.75 + \frac{x}{y}\right)\\
\mathbf{else}:\\
\;\;\;\;1 + 4 \cdot \frac{x - z}{y}\\
\end{array}
\end{array}
if y < -2.9e50 or 1.24999999999999995e87 < y Initial program 98.9%
associate-/l*99.9%
associate--l+99.9%
Simplified99.9%
Taylor expanded in x around 0 100.0%
Taylor expanded in z around 0 87.3%
if -2.9e50 < y < 1.24999999999999995e87Initial program 100.0%
associate-/l*100.0%
associate--l+100.0%
Simplified100.0%
Taylor expanded in y around 0 94.0%
Final simplification91.4%
(FPCore (x y z) :precision binary64 (if (or (<= z -4400000000.0) (not (<= z 1e-79))) (+ 1.0 (* 4.0 (- 0.75 (/ z y)))) (+ 1.0 (* 4.0 (+ 0.75 (/ x y))))))
double code(double x, double y, double z) {
double tmp;
if ((z <= -4400000000.0) || !(z <= 1e-79)) {
tmp = 1.0 + (4.0 * (0.75 - (z / y)));
} else {
tmp = 1.0 + (4.0 * (0.75 + (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 <= (-4400000000.0d0)) .or. (.not. (z <= 1d-79))) then
tmp = 1.0d0 + (4.0d0 * (0.75d0 - (z / y)))
else
tmp = 1.0d0 + (4.0d0 * (0.75d0 + (x / y)))
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if ((z <= -4400000000.0) || !(z <= 1e-79)) {
tmp = 1.0 + (4.0 * (0.75 - (z / y)));
} else {
tmp = 1.0 + (4.0 * (0.75 + (x / y)));
}
return tmp;
}
def code(x, y, z): tmp = 0 if (z <= -4400000000.0) or not (z <= 1e-79): tmp = 1.0 + (4.0 * (0.75 - (z / y))) else: tmp = 1.0 + (4.0 * (0.75 + (x / y))) return tmp
function code(x, y, z) tmp = 0.0 if ((z <= -4400000000.0) || !(z <= 1e-79)) tmp = Float64(1.0 + Float64(4.0 * Float64(0.75 - Float64(z / y)))); else tmp = Float64(1.0 + Float64(4.0 * Float64(0.75 + Float64(x / y)))); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if ((z <= -4400000000.0) || ~((z <= 1e-79))) tmp = 1.0 + (4.0 * (0.75 - (z / y))); else tmp = 1.0 + (4.0 * (0.75 + (x / y))); end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[z, -4400000000.0], N[Not[LessEqual[z, 1e-79]], $MachinePrecision]], N[(1.0 + N[(4.0 * N[(0.75 - N[(z / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 + N[(4.0 * N[(0.75 + N[(x / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -4400000000 \lor \neg \left(z \leq 10^{-79}\right):\\
\;\;\;\;1 + 4 \cdot \left(0.75 - \frac{z}{y}\right)\\
\mathbf{else}:\\
\;\;\;\;1 + 4 \cdot \left(0.75 + \frac{x}{y}\right)\\
\end{array}
\end{array}
if z < -4.4e9 or 1e-79 < z Initial program 100.0%
associate-/l*100.0%
associate--l+100.0%
Simplified100.0%
Taylor expanded in x around 0 82.7%
div-sub82.7%
associate-/l*82.7%
*-inverses82.7%
metadata-eval82.7%
Simplified82.7%
if -4.4e9 < z < 1e-79Initial program 99.0%
associate-/l*99.9%
associate--l+99.9%
Simplified99.9%
Taylor expanded in x around 0 100.0%
Taylor expanded in z around 0 98.1%
Final simplification89.1%
(FPCore (x y z) :precision binary64 (if (or (<= z -120000000000.0) (not (<= z 4e-80))) (+ 1.0 (/ (* z -4.0) y)) (+ 1.0 (* 4.0 (/ x y)))))
double code(double x, double y, double z) {
double tmp;
if ((z <= -120000000000.0) || !(z <= 4e-80)) {
tmp = 1.0 + ((z * -4.0) / y);
} else {
tmp = 1.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 <= (-120000000000.0d0)) .or. (.not. (z <= 4d-80))) then
tmp = 1.0d0 + ((z * (-4.0d0)) / y)
else
tmp = 1.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 <= -120000000000.0) || !(z <= 4e-80)) {
tmp = 1.0 + ((z * -4.0) / y);
} else {
tmp = 1.0 + (4.0 * (x / y));
}
return tmp;
}
def code(x, y, z): tmp = 0 if (z <= -120000000000.0) or not (z <= 4e-80): tmp = 1.0 + ((z * -4.0) / y) else: tmp = 1.0 + (4.0 * (x / y)) return tmp
function code(x, y, z) tmp = 0.0 if ((z <= -120000000000.0) || !(z <= 4e-80)) tmp = Float64(1.0 + Float64(Float64(z * -4.0) / y)); else tmp = Float64(1.0 + Float64(4.0 * Float64(x / y))); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if ((z <= -120000000000.0) || ~((z <= 4e-80))) tmp = 1.0 + ((z * -4.0) / y); else tmp = 1.0 + (4.0 * (x / y)); end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[z, -120000000000.0], N[Not[LessEqual[z, 4e-80]], $MachinePrecision]], N[(1.0 + N[(N[(z * -4.0), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision], N[(1.0 + N[(4.0 * N[(x / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -120000000000 \lor \neg \left(z \leq 4 \cdot 10^{-80}\right):\\
\;\;\;\;1 + \frac{z \cdot -4}{y}\\
\mathbf{else}:\\
\;\;\;\;1 + 4 \cdot \frac{x}{y}\\
\end{array}
\end{array}
if z < -1.2e11 or 3.99999999999999985e-80 < z Initial program 100.0%
associate-/l*100.0%
associate--l+100.0%
Simplified100.0%
Taylor expanded in z around inf 64.4%
neg-mul-164.4%
distribute-neg-frac264.4%
Simplified64.4%
Taylor expanded in z around 0 64.4%
associate-*r/64.4%
Simplified64.4%
if -1.2e11 < z < 3.99999999999999985e-80Initial program 99.0%
associate-/l*99.9%
associate--l+99.9%
Simplified99.9%
Taylor expanded in x around inf 61.5%
Final simplification63.2%
(FPCore (x y z) :precision binary64 (if (or (<= z -13500000000000.0) (not (<= z 1e-79))) (+ 1.0 (* z (/ -4.0 y))) (+ 1.0 (* 4.0 (/ x y)))))
double code(double x, double y, double z) {
double tmp;
if ((z <= -13500000000000.0) || !(z <= 1e-79)) {
tmp = 1.0 + (z * (-4.0 / y));
} else {
tmp = 1.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 <= (-13500000000000.0d0)) .or. (.not. (z <= 1d-79))) then
tmp = 1.0d0 + (z * ((-4.0d0) / y))
else
tmp = 1.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 <= -13500000000000.0) || !(z <= 1e-79)) {
tmp = 1.0 + (z * (-4.0 / y));
} else {
tmp = 1.0 + (4.0 * (x / y));
}
return tmp;
}
def code(x, y, z): tmp = 0 if (z <= -13500000000000.0) or not (z <= 1e-79): tmp = 1.0 + (z * (-4.0 / y)) else: tmp = 1.0 + (4.0 * (x / y)) return tmp
function code(x, y, z) tmp = 0.0 if ((z <= -13500000000000.0) || !(z <= 1e-79)) tmp = Float64(1.0 + Float64(z * Float64(-4.0 / y))); else tmp = Float64(1.0 + Float64(4.0 * Float64(x / y))); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if ((z <= -13500000000000.0) || ~((z <= 1e-79))) tmp = 1.0 + (z * (-4.0 / y)); else tmp = 1.0 + (4.0 * (x / y)); end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[z, -13500000000000.0], N[Not[LessEqual[z, 1e-79]], $MachinePrecision]], N[(1.0 + N[(z * N[(-4.0 / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 + N[(4.0 * N[(x / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -13500000000000 \lor \neg \left(z \leq 10^{-79}\right):\\
\;\;\;\;1 + z \cdot \frac{-4}{y}\\
\mathbf{else}:\\
\;\;\;\;1 + 4 \cdot \frac{x}{y}\\
\end{array}
\end{array}
if z < -1.35e13 or 1e-79 < z Initial program 100.0%
associate-/l*100.0%
associate--l+100.0%
Simplified100.0%
Taylor expanded in z around inf 64.4%
neg-mul-164.4%
distribute-neg-frac264.4%
Simplified64.4%
Taylor expanded in z around 0 64.4%
*-commutative64.4%
associate-*l/64.4%
associate-/l*64.2%
Simplified64.2%
if -1.35e13 < z < 1e-79Initial program 99.0%
associate-/l*99.9%
associate--l+99.9%
Simplified99.9%
Taylor expanded in x around inf 61.5%
Final simplification63.1%
(FPCore (x y z) :precision binary64 (if (<= y -3.2e+66) 4.0 (if (<= y 3.3e+122) (+ 1.0 (* 4.0 (/ x y))) 4.0)))
double code(double x, double y, double z) {
double tmp;
if (y <= -3.2e+66) {
tmp = 4.0;
} else if (y <= 3.3e+122) {
tmp = 1.0 + (4.0 * (x / y));
} else {
tmp = 4.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 <= (-3.2d+66)) then
tmp = 4.0d0
else if (y <= 3.3d+122) then
tmp = 1.0d0 + (4.0d0 * (x / y))
else
tmp = 4.0d0
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (y <= -3.2e+66) {
tmp = 4.0;
} else if (y <= 3.3e+122) {
tmp = 1.0 + (4.0 * (x / y));
} else {
tmp = 4.0;
}
return tmp;
}
def code(x, y, z): tmp = 0 if y <= -3.2e+66: tmp = 4.0 elif y <= 3.3e+122: tmp = 1.0 + (4.0 * (x / y)) else: tmp = 4.0 return tmp
function code(x, y, z) tmp = 0.0 if (y <= -3.2e+66) tmp = 4.0; elseif (y <= 3.3e+122) tmp = Float64(1.0 + Float64(4.0 * Float64(x / y))); else tmp = 4.0; end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (y <= -3.2e+66) tmp = 4.0; elseif (y <= 3.3e+122) tmp = 1.0 + (4.0 * (x / y)); else tmp = 4.0; end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[y, -3.2e+66], 4.0, If[LessEqual[y, 3.3e+122], N[(1.0 + N[(4.0 * N[(x / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 4.0]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -3.2 \cdot 10^{+66}:\\
\;\;\;\;4\\
\mathbf{elif}\;y \leq 3.3 \cdot 10^{+122}:\\
\;\;\;\;1 + 4 \cdot \frac{x}{y}\\
\mathbf{else}:\\
\;\;\;\;4\\
\end{array}
\end{array}
if y < -3.2e66 or 3.2999999999999999e122 < y Initial program 98.8%
associate-/l*99.9%
associate--l+99.9%
Simplified99.9%
Taylor expanded in y around inf 72.9%
if -3.2e66 < y < 3.2999999999999999e122Initial program 100.0%
associate-/l*100.0%
associate--l+100.0%
Simplified100.0%
Taylor expanded in x around inf 48.3%
Final simplification56.5%
(FPCore (x y z) :precision binary64 4.0)
double code(double x, double y, double z) {
return 4.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
end function
public static double code(double x, double y, double z) {
return 4.0;
}
def code(x, y, z): return 4.0
function code(x, y, z) return 4.0 end
function tmp = code(x, y, z) tmp = 4.0; end
code[x_, y_, z_] := 4.0
\begin{array}{l}
\\
4
\end{array}
Initial program 99.6%
associate-/l*99.9%
associate--l+99.9%
Simplified99.9%
Taylor expanded in y around inf 30.9%
Final simplification30.9%
herbie shell --seed 2024091
(FPCore (x y z)
:name "Data.Array.Repa.Algorithms.ColorRamp:rampColorHotToCold from repa-algorithms-3.4.0.1, A"
:precision binary64
(+ 1.0 (/ (* 4.0 (- (+ x (* y 0.75)) z)) y)))