
(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 9 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 (+ (/ (- x z) (/ y 4.0)) 2.0))
double code(double x, double y, double z) {
return ((x - z) / (y / 4.0)) + 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 = ((x - z) / (y / 4.0d0)) + 2.0d0
end function
public static double code(double x, double y, double z) {
return ((x - z) / (y / 4.0)) + 2.0;
}
def code(x, y, z): return ((x - z) / (y / 4.0)) + 2.0
function code(x, y, z) return Float64(Float64(Float64(x - z) / Float64(y / 4.0)) + 2.0) end
function tmp = code(x, y, z) tmp = ((x - z) / (y / 4.0)) + 2.0; end
code[x_, y_, z_] := N[(N[(N[(x - z), $MachinePrecision] / N[(y / 4.0), $MachinePrecision]), $MachinePrecision] + 2.0), $MachinePrecision]
\begin{array}{l}
\\
\frac{x - z}{\frac{y}{4}} + 2
\end{array}
Initial program 100.0%
Simplified0
(FPCore (x y z)
:precision binary64
(let* ((t_0 (/ (* -4.0 z) y)) (t_1 (/ (* 4.0 x) y)))
(if (<= x -4.7e+97)
t_1
(if (<= x -2.6e-306)
2.0
(if (<= x 1.15e-252)
t_0
(if (<= x 9e-235)
2.0
(if (<= x 1.1e-203) t_0 (if (<= x 5.8e+50) 2.0 t_1))))))))
double code(double x, double y, double z) {
double t_0 = (-4.0 * z) / y;
double t_1 = (4.0 * x) / y;
double tmp;
if (x <= -4.7e+97) {
tmp = t_1;
} else if (x <= -2.6e-306) {
tmp = 2.0;
} else if (x <= 1.15e-252) {
tmp = t_0;
} else if (x <= 9e-235) {
tmp = 2.0;
} else if (x <= 1.1e-203) {
tmp = t_0;
} else if (x <= 5.8e+50) {
tmp = 2.0;
} else {
tmp = t_1;
}
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) * z) / y
t_1 = (4.0d0 * x) / y
if (x <= (-4.7d+97)) then
tmp = t_1
else if (x <= (-2.6d-306)) then
tmp = 2.0d0
else if (x <= 1.15d-252) then
tmp = t_0
else if (x <= 9d-235) then
tmp = 2.0d0
else if (x <= 1.1d-203) then
tmp = t_0
else if (x <= 5.8d+50) then
tmp = 2.0d0
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double t_0 = (-4.0 * z) / y;
double t_1 = (4.0 * x) / y;
double tmp;
if (x <= -4.7e+97) {
tmp = t_1;
} else if (x <= -2.6e-306) {
tmp = 2.0;
} else if (x <= 1.15e-252) {
tmp = t_0;
} else if (x <= 9e-235) {
tmp = 2.0;
} else if (x <= 1.1e-203) {
tmp = t_0;
} else if (x <= 5.8e+50) {
tmp = 2.0;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z): t_0 = (-4.0 * z) / y t_1 = (4.0 * x) / y tmp = 0 if x <= -4.7e+97: tmp = t_1 elif x <= -2.6e-306: tmp = 2.0 elif x <= 1.15e-252: tmp = t_0 elif x <= 9e-235: tmp = 2.0 elif x <= 1.1e-203: tmp = t_0 elif x <= 5.8e+50: tmp = 2.0 else: tmp = t_1 return tmp
function code(x, y, z) t_0 = Float64(Float64(-4.0 * z) / y) t_1 = Float64(Float64(4.0 * x) / y) tmp = 0.0 if (x <= -4.7e+97) tmp = t_1; elseif (x <= -2.6e-306) tmp = 2.0; elseif (x <= 1.15e-252) tmp = t_0; elseif (x <= 9e-235) tmp = 2.0; elseif (x <= 1.1e-203) tmp = t_0; elseif (x <= 5.8e+50) tmp = 2.0; else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z) t_0 = (-4.0 * z) / y; t_1 = (4.0 * x) / y; tmp = 0.0; if (x <= -4.7e+97) tmp = t_1; elseif (x <= -2.6e-306) tmp = 2.0; elseif (x <= 1.15e-252) tmp = t_0; elseif (x <= 9e-235) tmp = 2.0; elseif (x <= 1.1e-203) tmp = t_0; elseif (x <= 5.8e+50) tmp = 2.0; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(N[(-4.0 * z), $MachinePrecision] / y), $MachinePrecision]}, Block[{t$95$1 = N[(N[(4.0 * x), $MachinePrecision] / y), $MachinePrecision]}, If[LessEqual[x, -4.7e+97], t$95$1, If[LessEqual[x, -2.6e-306], 2.0, If[LessEqual[x, 1.15e-252], t$95$0, If[LessEqual[x, 9e-235], 2.0, If[LessEqual[x, 1.1e-203], t$95$0, If[LessEqual[x, 5.8e+50], 2.0, t$95$1]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{-4 \cdot z}{y}\\
t_1 := \frac{4 \cdot x}{y}\\
\mathbf{if}\;x \leq -4.7 \cdot 10^{+97}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \leq -2.6 \cdot 10^{-306}:\\
\;\;\;\;2\\
\mathbf{elif}\;x \leq 1.15 \cdot 10^{-252}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;x \leq 9 \cdot 10^{-235}:\\
\;\;\;\;2\\
\mathbf{elif}\;x \leq 1.1 \cdot 10^{-203}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;x \leq 5.8 \cdot 10^{+50}:\\
\;\;\;\;2\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if x < -4.6999999999999997e97 or 5.8e50 < x Initial program 100.0%
Simplified0
Taylor expanded in x around inf 0
Simplified0
if -4.6999999999999997e97 < x < -2.6e-306 or 1.1499999999999999e-252 < x < 8.9999999999999996e-235 or 1.1e-203 < x < 5.8e50Initial program 99.9%
Simplified0
Taylor expanded in y around inf 0
Simplified0
if -2.6e-306 < x < 1.1499999999999999e-252 or 8.9999999999999996e-235 < x < 1.1e-203Initial program 100.0%
Simplified0
Taylor expanded in z around inf 0
Simplified0
(FPCore (x y z)
:precision binary64
(let* ((t_0 (/ (* -4.0 z) y)) (t_1 (* (/ 4.0 y) x)))
(if (<= x -2.6e+96)
t_1
(if (<= x 3.5e-304)
2.0
(if (<= x 1.6e-252)
t_0
(if (<= x 2e-234)
2.0
(if (<= x 7e-203) t_0 (if (<= x 1.08e+51) 2.0 t_1))))))))
double code(double x, double y, double z) {
double t_0 = (-4.0 * z) / y;
double t_1 = (4.0 / y) * x;
double tmp;
if (x <= -2.6e+96) {
tmp = t_1;
} else if (x <= 3.5e-304) {
tmp = 2.0;
} else if (x <= 1.6e-252) {
tmp = t_0;
} else if (x <= 2e-234) {
tmp = 2.0;
} else if (x <= 7e-203) {
tmp = t_0;
} else if (x <= 1.08e+51) {
tmp = 2.0;
} else {
tmp = t_1;
}
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) * z) / y
t_1 = (4.0d0 / y) * x
if (x <= (-2.6d+96)) then
tmp = t_1
else if (x <= 3.5d-304) then
tmp = 2.0d0
else if (x <= 1.6d-252) then
tmp = t_0
else if (x <= 2d-234) then
tmp = 2.0d0
else if (x <= 7d-203) then
tmp = t_0
else if (x <= 1.08d+51) then
tmp = 2.0d0
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double t_0 = (-4.0 * z) / y;
double t_1 = (4.0 / y) * x;
double tmp;
if (x <= -2.6e+96) {
tmp = t_1;
} else if (x <= 3.5e-304) {
tmp = 2.0;
} else if (x <= 1.6e-252) {
tmp = t_0;
} else if (x <= 2e-234) {
tmp = 2.0;
} else if (x <= 7e-203) {
tmp = t_0;
} else if (x <= 1.08e+51) {
tmp = 2.0;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z): t_0 = (-4.0 * z) / y t_1 = (4.0 / y) * x tmp = 0 if x <= -2.6e+96: tmp = t_1 elif x <= 3.5e-304: tmp = 2.0 elif x <= 1.6e-252: tmp = t_0 elif x <= 2e-234: tmp = 2.0 elif x <= 7e-203: tmp = t_0 elif x <= 1.08e+51: tmp = 2.0 else: tmp = t_1 return tmp
function code(x, y, z) t_0 = Float64(Float64(-4.0 * z) / y) t_1 = Float64(Float64(4.0 / y) * x) tmp = 0.0 if (x <= -2.6e+96) tmp = t_1; elseif (x <= 3.5e-304) tmp = 2.0; elseif (x <= 1.6e-252) tmp = t_0; elseif (x <= 2e-234) tmp = 2.0; elseif (x <= 7e-203) tmp = t_0; elseif (x <= 1.08e+51) tmp = 2.0; else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z) t_0 = (-4.0 * z) / y; t_1 = (4.0 / y) * x; tmp = 0.0; if (x <= -2.6e+96) tmp = t_1; elseif (x <= 3.5e-304) tmp = 2.0; elseif (x <= 1.6e-252) tmp = t_0; elseif (x <= 2e-234) tmp = 2.0; elseif (x <= 7e-203) tmp = t_0; elseif (x <= 1.08e+51) tmp = 2.0; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(N[(-4.0 * z), $MachinePrecision] / y), $MachinePrecision]}, Block[{t$95$1 = N[(N[(4.0 / y), $MachinePrecision] * x), $MachinePrecision]}, If[LessEqual[x, -2.6e+96], t$95$1, If[LessEqual[x, 3.5e-304], 2.0, If[LessEqual[x, 1.6e-252], t$95$0, If[LessEqual[x, 2e-234], 2.0, If[LessEqual[x, 7e-203], t$95$0, If[LessEqual[x, 1.08e+51], 2.0, t$95$1]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{-4 \cdot z}{y}\\
t_1 := \frac{4}{y} \cdot x\\
\mathbf{if}\;x \leq -2.6 \cdot 10^{+96}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \leq 3.5 \cdot 10^{-304}:\\
\;\;\;\;2\\
\mathbf{elif}\;x \leq 1.6 \cdot 10^{-252}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;x \leq 2 \cdot 10^{-234}:\\
\;\;\;\;2\\
\mathbf{elif}\;x \leq 7 \cdot 10^{-203}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;x \leq 1.08 \cdot 10^{+51}:\\
\;\;\;\;2\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if x < -2.6e96 or 1.08e51 < x Initial program 100.0%
Simplified0
Taylor expanded in x around inf 0
Simplified0
Applied egg-rr0
if -2.6e96 < x < 3.5e-304 or 1.6000000000000001e-252 < x < 1.9999999999999999e-234 or 7.0000000000000003e-203 < x < 1.08e51Initial program 99.9%
Simplified0
Taylor expanded in y around inf 0
Simplified0
if 3.5e-304 < x < 1.6000000000000001e-252 or 1.9999999999999999e-234 < x < 7.0000000000000003e-203Initial program 100.0%
Simplified0
Taylor expanded in z around inf 0
Simplified0
(FPCore (x y z)
:precision binary64
(let* ((t_0 (* (/ -4.0 y) z)) (t_1 (* (/ 4.0 y) x)))
(if (<= x -9e+94)
t_1
(if (<= x -2.7e-304)
2.0
(if (<= x 2.2e-251)
t_0
(if (<= x 2.2e-234)
2.0
(if (<= x 3.7e-204) t_0 (if (<= x 5.4e+50) 2.0 t_1))))))))
double code(double x, double y, double z) {
double t_0 = (-4.0 / y) * z;
double t_1 = (4.0 / y) * x;
double tmp;
if (x <= -9e+94) {
tmp = t_1;
} else if (x <= -2.7e-304) {
tmp = 2.0;
} else if (x <= 2.2e-251) {
tmp = t_0;
} else if (x <= 2.2e-234) {
tmp = 2.0;
} else if (x <= 3.7e-204) {
tmp = t_0;
} else if (x <= 5.4e+50) {
tmp = 2.0;
} else {
tmp = t_1;
}
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) / y) * z
t_1 = (4.0d0 / y) * x
if (x <= (-9d+94)) then
tmp = t_1
else if (x <= (-2.7d-304)) then
tmp = 2.0d0
else if (x <= 2.2d-251) then
tmp = t_0
else if (x <= 2.2d-234) then
tmp = 2.0d0
else if (x <= 3.7d-204) then
tmp = t_0
else if (x <= 5.4d+50) then
tmp = 2.0d0
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double t_0 = (-4.0 / y) * z;
double t_1 = (4.0 / y) * x;
double tmp;
if (x <= -9e+94) {
tmp = t_1;
} else if (x <= -2.7e-304) {
tmp = 2.0;
} else if (x <= 2.2e-251) {
tmp = t_0;
} else if (x <= 2.2e-234) {
tmp = 2.0;
} else if (x <= 3.7e-204) {
tmp = t_0;
} else if (x <= 5.4e+50) {
tmp = 2.0;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z): t_0 = (-4.0 / y) * z t_1 = (4.0 / y) * x tmp = 0 if x <= -9e+94: tmp = t_1 elif x <= -2.7e-304: tmp = 2.0 elif x <= 2.2e-251: tmp = t_0 elif x <= 2.2e-234: tmp = 2.0 elif x <= 3.7e-204: tmp = t_0 elif x <= 5.4e+50: tmp = 2.0 else: tmp = t_1 return tmp
function code(x, y, z) t_0 = Float64(Float64(-4.0 / y) * z) t_1 = Float64(Float64(4.0 / y) * x) tmp = 0.0 if (x <= -9e+94) tmp = t_1; elseif (x <= -2.7e-304) tmp = 2.0; elseif (x <= 2.2e-251) tmp = t_0; elseif (x <= 2.2e-234) tmp = 2.0; elseif (x <= 3.7e-204) tmp = t_0; elseif (x <= 5.4e+50) tmp = 2.0; else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z) t_0 = (-4.0 / y) * z; t_1 = (4.0 / y) * x; tmp = 0.0; if (x <= -9e+94) tmp = t_1; elseif (x <= -2.7e-304) tmp = 2.0; elseif (x <= 2.2e-251) tmp = t_0; elseif (x <= 2.2e-234) tmp = 2.0; elseif (x <= 3.7e-204) tmp = t_0; elseif (x <= 5.4e+50) tmp = 2.0; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(N[(-4.0 / y), $MachinePrecision] * z), $MachinePrecision]}, Block[{t$95$1 = N[(N[(4.0 / y), $MachinePrecision] * x), $MachinePrecision]}, If[LessEqual[x, -9e+94], t$95$1, If[LessEqual[x, -2.7e-304], 2.0, If[LessEqual[x, 2.2e-251], t$95$0, If[LessEqual[x, 2.2e-234], 2.0, If[LessEqual[x, 3.7e-204], t$95$0, If[LessEqual[x, 5.4e+50], 2.0, t$95$1]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{-4}{y} \cdot z\\
t_1 := \frac{4}{y} \cdot x\\
\mathbf{if}\;x \leq -9 \cdot 10^{+94}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \leq -2.7 \cdot 10^{-304}:\\
\;\;\;\;2\\
\mathbf{elif}\;x \leq 2.2 \cdot 10^{-251}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;x \leq 2.2 \cdot 10^{-234}:\\
\;\;\;\;2\\
\mathbf{elif}\;x \leq 3.7 \cdot 10^{-204}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;x \leq 5.4 \cdot 10^{+50}:\\
\;\;\;\;2\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if x < -8.99999999999999944e94 or 5.4e50 < x Initial program 100.0%
Simplified0
Taylor expanded in x around inf 0
Simplified0
Applied egg-rr0
if -8.99999999999999944e94 < x < -2.7000000000000001e-304 or 2.2e-251 < x < 2.1999999999999999e-234 or 3.6999999999999997e-204 < x < 5.4e50Initial program 99.9%
Simplified0
Taylor expanded in y around inf 0
Simplified0
if -2.7000000000000001e-304 < x < 2.2e-251 or 2.1999999999999999e-234 < x < 3.6999999999999997e-204Initial program 100.0%
Simplified0
Taylor expanded in z around inf 0
Simplified0
Applied egg-rr0
(FPCore (x y z) :precision binary64 (let* ((t_0 (/ (/ (- x z) y) 0.25))) (if (<= x -4.6e+94) t_0 (if (<= x 6.5e+50) (+ (/ (* -4.0 z) y) 2.0) t_0))))
double code(double x, double y, double z) {
double t_0 = ((x - z) / y) / 0.25;
double tmp;
if (x <= -4.6e+94) {
tmp = t_0;
} else if (x <= 6.5e+50) {
tmp = ((-4.0 * z) / y) + 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 = ((x - z) / y) / 0.25d0
if (x <= (-4.6d+94)) then
tmp = t_0
else if (x <= 6.5d+50) then
tmp = (((-4.0d0) * z) / y) + 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 = ((x - z) / y) / 0.25;
double tmp;
if (x <= -4.6e+94) {
tmp = t_0;
} else if (x <= 6.5e+50) {
tmp = ((-4.0 * z) / y) + 2.0;
} else {
tmp = t_0;
}
return tmp;
}
def code(x, y, z): t_0 = ((x - z) / y) / 0.25 tmp = 0 if x <= -4.6e+94: tmp = t_0 elif x <= 6.5e+50: tmp = ((-4.0 * z) / y) + 2.0 else: tmp = t_0 return tmp
function code(x, y, z) t_0 = Float64(Float64(Float64(x - z) / y) / 0.25) tmp = 0.0 if (x <= -4.6e+94) tmp = t_0; elseif (x <= 6.5e+50) tmp = Float64(Float64(Float64(-4.0 * z) / y) + 2.0); else tmp = t_0; end return tmp end
function tmp_2 = code(x, y, z) t_0 = ((x - z) / y) / 0.25; tmp = 0.0; if (x <= -4.6e+94) tmp = t_0; elseif (x <= 6.5e+50) tmp = ((-4.0 * z) / y) + 2.0; else tmp = t_0; end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(N[(N[(x - z), $MachinePrecision] / y), $MachinePrecision] / 0.25), $MachinePrecision]}, If[LessEqual[x, -4.6e+94], t$95$0, If[LessEqual[x, 6.5e+50], N[(N[(N[(-4.0 * z), $MachinePrecision] / y), $MachinePrecision] + 2.0), $MachinePrecision], t$95$0]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{\frac{x - z}{y}}{0.25}\\
\mathbf{if}\;x \leq -4.6 \cdot 10^{+94}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;x \leq 6.5 \cdot 10^{+50}:\\
\;\;\;\;\frac{-4 \cdot z}{y} + 2\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if x < -4.5999999999999999e94 or 6.5000000000000003e50 < x Initial program 100.0%
Simplified0
Taylor expanded in y around 0 0
Simplified0
Applied egg-rr0
if -4.5999999999999999e94 < x < 6.5000000000000003e50Initial program 100.0%
Simplified0
Taylor expanded in x around 0 0
Simplified0
(FPCore (x y z) :precision binary64 (let* ((t_0 (* (/ 4.0 y) (- x z)))) (if (<= x -2.7e+95) t_0 (if (<= x 8.6e+50) (+ (/ (* -4.0 z) y) 2.0) t_0))))
double code(double x, double y, double z) {
double t_0 = (4.0 / y) * (x - z);
double tmp;
if (x <= -2.7e+95) {
tmp = t_0;
} else if (x <= 8.6e+50) {
tmp = ((-4.0 * z) / y) + 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 = (4.0d0 / y) * (x - z)
if (x <= (-2.7d+95)) then
tmp = t_0
else if (x <= 8.6d+50) then
tmp = (((-4.0d0) * z) / y) + 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 = (4.0 / y) * (x - z);
double tmp;
if (x <= -2.7e+95) {
tmp = t_0;
} else if (x <= 8.6e+50) {
tmp = ((-4.0 * z) / y) + 2.0;
} else {
tmp = t_0;
}
return tmp;
}
def code(x, y, z): t_0 = (4.0 / y) * (x - z) tmp = 0 if x <= -2.7e+95: tmp = t_0 elif x <= 8.6e+50: tmp = ((-4.0 * z) / y) + 2.0 else: tmp = t_0 return tmp
function code(x, y, z) t_0 = Float64(Float64(4.0 / y) * Float64(x - z)) tmp = 0.0 if (x <= -2.7e+95) tmp = t_0; elseif (x <= 8.6e+50) tmp = Float64(Float64(Float64(-4.0 * z) / y) + 2.0); else tmp = t_0; end return tmp end
function tmp_2 = code(x, y, z) t_0 = (4.0 / y) * (x - z); tmp = 0.0; if (x <= -2.7e+95) tmp = t_0; elseif (x <= 8.6e+50) tmp = ((-4.0 * z) / y) + 2.0; else tmp = t_0; end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(N[(4.0 / y), $MachinePrecision] * N[(x - z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -2.7e+95], t$95$0, If[LessEqual[x, 8.6e+50], N[(N[(N[(-4.0 * z), $MachinePrecision] / y), $MachinePrecision] + 2.0), $MachinePrecision], t$95$0]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{4}{y} \cdot \left(x - z\right)\\
\mathbf{if}\;x \leq -2.7 \cdot 10^{+95}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;x \leq 8.6 \cdot 10^{+50}:\\
\;\;\;\;\frac{-4 \cdot z}{y} + 2\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if x < -2.7e95 or 8.5999999999999994e50 < x Initial program 100.0%
Simplified0
Taylor expanded in y around 0 0
Simplified0
if -2.7e95 < x < 8.5999999999999994e50Initial program 100.0%
Simplified0
Taylor expanded in x around 0 0
Simplified0
(FPCore (x y z) :precision binary64 (if (<= y -9.5e+106) 2.0 (if (<= y 1.45e+124) (* (/ 4.0 y) (- x z)) 2.0)))
double code(double x, double y, double z) {
double tmp;
if (y <= -9.5e+106) {
tmp = 2.0;
} else if (y <= 1.45e+124) {
tmp = (4.0 / y) * (x - z);
} 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 <= (-9.5d+106)) then
tmp = 2.0d0
else if (y <= 1.45d+124) then
tmp = (4.0d0 / y) * (x - z)
else
tmp = 2.0d0
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (y <= -9.5e+106) {
tmp = 2.0;
} else if (y <= 1.45e+124) {
tmp = (4.0 / y) * (x - z);
} else {
tmp = 2.0;
}
return tmp;
}
def code(x, y, z): tmp = 0 if y <= -9.5e+106: tmp = 2.0 elif y <= 1.45e+124: tmp = (4.0 / y) * (x - z) else: tmp = 2.0 return tmp
function code(x, y, z) tmp = 0.0 if (y <= -9.5e+106) tmp = 2.0; elseif (y <= 1.45e+124) tmp = Float64(Float64(4.0 / y) * Float64(x - z)); else tmp = 2.0; end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (y <= -9.5e+106) tmp = 2.0; elseif (y <= 1.45e+124) tmp = (4.0 / y) * (x - z); else tmp = 2.0; end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[y, -9.5e+106], 2.0, If[LessEqual[y, 1.45e+124], N[(N[(4.0 / y), $MachinePrecision] * N[(x - z), $MachinePrecision]), $MachinePrecision], 2.0]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -9.5 \cdot 10^{+106}:\\
\;\;\;\;2\\
\mathbf{elif}\;y \leq 1.45 \cdot 10^{+124}:\\
\;\;\;\;\frac{4}{y} \cdot \left(x - z\right)\\
\mathbf{else}:\\
\;\;\;\;2\\
\end{array}
\end{array}
if y < -9.4999999999999995e106 or 1.45000000000000011e124 < y Initial program 99.9%
Simplified0
Taylor expanded in y around inf 0
Simplified0
if -9.4999999999999995e106 < y < 1.45000000000000011e124Initial program 100.0%
Simplified0
Taylor expanded in y around 0 0
Simplified0
(FPCore (x y z) :precision binary64 (let* ((t_0 (* (/ -4.0 y) z))) (if (<= z -1.35e+70) t_0 (if (<= z 6.6e+74) 2.0 t_0))))
double code(double x, double y, double z) {
double t_0 = (-4.0 / y) * z;
double tmp;
if (z <= -1.35e+70) {
tmp = t_0;
} else if (z <= 6.6e+74) {
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 = ((-4.0d0) / y) * z
if (z <= (-1.35d+70)) then
tmp = t_0
else if (z <= 6.6d+74) 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 = (-4.0 / y) * z;
double tmp;
if (z <= -1.35e+70) {
tmp = t_0;
} else if (z <= 6.6e+74) {
tmp = 2.0;
} else {
tmp = t_0;
}
return tmp;
}
def code(x, y, z): t_0 = (-4.0 / y) * z tmp = 0 if z <= -1.35e+70: tmp = t_0 elif z <= 6.6e+74: tmp = 2.0 else: tmp = t_0 return tmp
function code(x, y, z) t_0 = Float64(Float64(-4.0 / y) * z) tmp = 0.0 if (z <= -1.35e+70) tmp = t_0; elseif (z <= 6.6e+74) tmp = 2.0; else tmp = t_0; end return tmp end
function tmp_2 = code(x, y, z) t_0 = (-4.0 / y) * z; tmp = 0.0; if (z <= -1.35e+70) tmp = t_0; elseif (z <= 6.6e+74) tmp = 2.0; else tmp = t_0; end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(N[(-4.0 / y), $MachinePrecision] * z), $MachinePrecision]}, If[LessEqual[z, -1.35e+70], t$95$0, If[LessEqual[z, 6.6e+74], 2.0, t$95$0]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{-4}{y} \cdot z\\
\mathbf{if}\;z \leq -1.35 \cdot 10^{+70}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;z \leq 6.6 \cdot 10^{+74}:\\
\;\;\;\;2\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if z < -1.35e70 or 6.6000000000000004e74 < z Initial program 100.0%
Simplified0
Taylor expanded in z around inf 0
Simplified0
Applied egg-rr0
if -1.35e70 < z < 6.6000000000000004e74Initial program 100.0%
Simplified0
Taylor expanded in y around inf 0
Simplified0
(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%
Simplified0
Taylor expanded in y around inf 0
Simplified0
herbie shell --seed 2024110
(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)))