
(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 11 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 (fma 4.0 (+ 0.75 (/ (- x z) y)) 1.0))
double code(double x, double y, double z) {
return fma(4.0, (0.75 + ((x - z) / y)), 1.0);
}
function code(x, y, z) return fma(4.0, Float64(0.75 + Float64(Float64(x - z) / y)), 1.0) end
code[x_, y_, z_] := N[(4.0 * N[(0.75 + N[(N[(x - z), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision]
\begin{array}{l}
\\
\mathsf{fma}\left(4, 0.75 + \frac{x - z}{y}, 1\right)
\end{array}
Initial program 99.5%
+-commutative99.5%
associate-/l*99.9%
fma-define99.9%
associate--l+99.9%
+-commutative99.9%
remove-double-neg99.9%
sub-neg99.9%
associate--r+99.9%
div-sub99.9%
sub-neg99.9%
associate-*l/100.0%
*-inverses100.0%
metadata-eval100.0%
distribute-frac-neg2100.0%
remove-double-neg100.0%
distribute-neg-out100.0%
+-commutative100.0%
sub-neg100.0%
distribute-frac-neg100.0%
distribute-frac-neg2100.0%
remove-double-neg100.0%
Simplified100.0%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (/ (* z -4.0) y)) (t_1 (/ (* 4.0 x) y)))
(if (<= x -2e+142)
t_1
(if (<= x -5.5e+134)
4.0
(if (<= x -8e+78)
(* x (/ 4.0 y))
(if (<= x -1.3e-120)
t_0
(if (<= x -1.7e-192)
4.0
(if (<= x -1.45e-273)
t_0
(if (<= x 1.1e-183)
4.0
(if (<= x 1.55e-138)
t_0
(if (<= x 3.8e-80)
4.0
(if (<= x 1650000000.0) t_0 t_1))))))))))))
double code(double x, double y, double z) {
double t_0 = (z * -4.0) / y;
double t_1 = (4.0 * x) / y;
double tmp;
if (x <= -2e+142) {
tmp = t_1;
} else if (x <= -5.5e+134) {
tmp = 4.0;
} else if (x <= -8e+78) {
tmp = x * (4.0 / y);
} else if (x <= -1.3e-120) {
tmp = t_0;
} else if (x <= -1.7e-192) {
tmp = 4.0;
} else if (x <= -1.45e-273) {
tmp = t_0;
} else if (x <= 1.1e-183) {
tmp = 4.0;
} else if (x <= 1.55e-138) {
tmp = t_0;
} else if (x <= 3.8e-80) {
tmp = 4.0;
} else if (x <= 1650000000.0) {
tmp = t_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 = (z * (-4.0d0)) / y
t_1 = (4.0d0 * x) / y
if (x <= (-2d+142)) then
tmp = t_1
else if (x <= (-5.5d+134)) then
tmp = 4.0d0
else if (x <= (-8d+78)) then
tmp = x * (4.0d0 / y)
else if (x <= (-1.3d-120)) then
tmp = t_0
else if (x <= (-1.7d-192)) then
tmp = 4.0d0
else if (x <= (-1.45d-273)) then
tmp = t_0
else if (x <= 1.1d-183) then
tmp = 4.0d0
else if (x <= 1.55d-138) then
tmp = t_0
else if (x <= 3.8d-80) then
tmp = 4.0d0
else if (x <= 1650000000.0d0) then
tmp = t_0
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double t_0 = (z * -4.0) / y;
double t_1 = (4.0 * x) / y;
double tmp;
if (x <= -2e+142) {
tmp = t_1;
} else if (x <= -5.5e+134) {
tmp = 4.0;
} else if (x <= -8e+78) {
tmp = x * (4.0 / y);
} else if (x <= -1.3e-120) {
tmp = t_0;
} else if (x <= -1.7e-192) {
tmp = 4.0;
} else if (x <= -1.45e-273) {
tmp = t_0;
} else if (x <= 1.1e-183) {
tmp = 4.0;
} else if (x <= 1.55e-138) {
tmp = t_0;
} else if (x <= 3.8e-80) {
tmp = 4.0;
} else if (x <= 1650000000.0) {
tmp = t_0;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z): t_0 = (z * -4.0) / y t_1 = (4.0 * x) / y tmp = 0 if x <= -2e+142: tmp = t_1 elif x <= -5.5e+134: tmp = 4.0 elif x <= -8e+78: tmp = x * (4.0 / y) elif x <= -1.3e-120: tmp = t_0 elif x <= -1.7e-192: tmp = 4.0 elif x <= -1.45e-273: tmp = t_0 elif x <= 1.1e-183: tmp = 4.0 elif x <= 1.55e-138: tmp = t_0 elif x <= 3.8e-80: tmp = 4.0 elif x <= 1650000000.0: tmp = t_0 else: tmp = t_1 return tmp
function code(x, y, z) t_0 = Float64(Float64(z * -4.0) / y) t_1 = Float64(Float64(4.0 * x) / y) tmp = 0.0 if (x <= -2e+142) tmp = t_1; elseif (x <= -5.5e+134) tmp = 4.0; elseif (x <= -8e+78) tmp = Float64(x * Float64(4.0 / y)); elseif (x <= -1.3e-120) tmp = t_0; elseif (x <= -1.7e-192) tmp = 4.0; elseif (x <= -1.45e-273) tmp = t_0; elseif (x <= 1.1e-183) tmp = 4.0; elseif (x <= 1.55e-138) tmp = t_0; elseif (x <= 3.8e-80) tmp = 4.0; elseif (x <= 1650000000.0) tmp = t_0; else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z) t_0 = (z * -4.0) / y; t_1 = (4.0 * x) / y; tmp = 0.0; if (x <= -2e+142) tmp = t_1; elseif (x <= -5.5e+134) tmp = 4.0; elseif (x <= -8e+78) tmp = x * (4.0 / y); elseif (x <= -1.3e-120) tmp = t_0; elseif (x <= -1.7e-192) tmp = 4.0; elseif (x <= -1.45e-273) tmp = t_0; elseif (x <= 1.1e-183) tmp = 4.0; elseif (x <= 1.55e-138) tmp = t_0; elseif (x <= 3.8e-80) tmp = 4.0; elseif (x <= 1650000000.0) tmp = t_0; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(N[(z * -4.0), $MachinePrecision] / y), $MachinePrecision]}, Block[{t$95$1 = N[(N[(4.0 * x), $MachinePrecision] / y), $MachinePrecision]}, If[LessEqual[x, -2e+142], t$95$1, If[LessEqual[x, -5.5e+134], 4.0, If[LessEqual[x, -8e+78], N[(x * N[(4.0 / y), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, -1.3e-120], t$95$0, If[LessEqual[x, -1.7e-192], 4.0, If[LessEqual[x, -1.45e-273], t$95$0, If[LessEqual[x, 1.1e-183], 4.0, If[LessEqual[x, 1.55e-138], t$95$0, If[LessEqual[x, 3.8e-80], 4.0, If[LessEqual[x, 1650000000.0], t$95$0, t$95$1]]]]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{z \cdot -4}{y}\\
t_1 := \frac{4 \cdot x}{y}\\
\mathbf{if}\;x \leq -2 \cdot 10^{+142}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \leq -5.5 \cdot 10^{+134}:\\
\;\;\;\;4\\
\mathbf{elif}\;x \leq -8 \cdot 10^{+78}:\\
\;\;\;\;x \cdot \frac{4}{y}\\
\mathbf{elif}\;x \leq -1.3 \cdot 10^{-120}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;x \leq -1.7 \cdot 10^{-192}:\\
\;\;\;\;4\\
\mathbf{elif}\;x \leq -1.45 \cdot 10^{-273}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;x \leq 1.1 \cdot 10^{-183}:\\
\;\;\;\;4\\
\mathbf{elif}\;x \leq 1.55 \cdot 10^{-138}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;x \leq 3.8 \cdot 10^{-80}:\\
\;\;\;\;4\\
\mathbf{elif}\;x \leq 1650000000:\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if x < -2.0000000000000001e142 or 1.65e9 < x Initial program 99.9%
associate-/l*99.9%
associate--l+99.9%
Simplified99.9%
Taylor expanded in x around inf 72.9%
*-commutative72.9%
associate-*l/72.9%
Simplified72.9%
if -2.0000000000000001e142 < x < -5.4999999999999999e134 or -1.3000000000000001e-120 < x < -1.70000000000000001e-192 or -1.44999999999999993e-273 < x < 1.1e-183 or 1.5499999999999999e-138 < x < 3.79999999999999967e-80Initial program 98.6%
associate-/l*99.9%
associate--l+99.9%
Simplified99.9%
Taylor expanded in y around inf 67.3%
if -5.4999999999999999e134 < x < -8.00000000000000007e78Initial program 100.0%
associate-/l*100.0%
associate--l+100.0%
Simplified100.0%
Taylor expanded in x around 0 100.0%
Taylor expanded in x around inf 88.2%
*-commutative88.2%
associate-*l/88.2%
associate-*r/88.2%
Simplified88.2%
if -8.00000000000000007e78 < x < -1.3000000000000001e-120 or -1.70000000000000001e-192 < x < -1.44999999999999993e-273 or 1.1e-183 < x < 1.5499999999999999e-138 or 3.79999999999999967e-80 < x < 1.65e9Initial program 99.9%
associate-/l*99.9%
associate--l+99.9%
Simplified99.9%
Taylor expanded in z around inf 66.0%
*-commutative66.0%
associate-*l/66.0%
Simplified66.0%
Final simplification69.5%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (* z (/ -4.0 y))) (t_1 (/ (* 4.0 x) y)))
(if (<= x -8.2e+141)
t_1
(if (<= x -4e+134)
4.0
(if (<= x -1.3e+79)
(* x (/ 4.0 y))
(if (<= x -6.2e-119)
t_0
(if (<= x -1.6e-192)
4.0
(if (<= x -1.9e-269)
t_0
(if (<= x 6e-185)
4.0
(if (<= x 1.3e-139)
t_0
(if (<= x 8.5e-81)
4.0
(if (<= x 980000.0) t_0 t_1))))))))))))
double code(double x, double y, double z) {
double t_0 = z * (-4.0 / y);
double t_1 = (4.0 * x) / y;
double tmp;
if (x <= -8.2e+141) {
tmp = t_1;
} else if (x <= -4e+134) {
tmp = 4.0;
} else if (x <= -1.3e+79) {
tmp = x * (4.0 / y);
} else if (x <= -6.2e-119) {
tmp = t_0;
} else if (x <= -1.6e-192) {
tmp = 4.0;
} else if (x <= -1.9e-269) {
tmp = t_0;
} else if (x <= 6e-185) {
tmp = 4.0;
} else if (x <= 1.3e-139) {
tmp = t_0;
} else if (x <= 8.5e-81) {
tmp = 4.0;
} else if (x <= 980000.0) {
tmp = t_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 = z * ((-4.0d0) / y)
t_1 = (4.0d0 * x) / y
if (x <= (-8.2d+141)) then
tmp = t_1
else if (x <= (-4d+134)) then
tmp = 4.0d0
else if (x <= (-1.3d+79)) then
tmp = x * (4.0d0 / y)
else if (x <= (-6.2d-119)) then
tmp = t_0
else if (x <= (-1.6d-192)) then
tmp = 4.0d0
else if (x <= (-1.9d-269)) then
tmp = t_0
else if (x <= 6d-185) then
tmp = 4.0d0
else if (x <= 1.3d-139) then
tmp = t_0
else if (x <= 8.5d-81) then
tmp = 4.0d0
else if (x <= 980000.0d0) then
tmp = t_0
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double t_0 = z * (-4.0 / y);
double t_1 = (4.0 * x) / y;
double tmp;
if (x <= -8.2e+141) {
tmp = t_1;
} else if (x <= -4e+134) {
tmp = 4.0;
} else if (x <= -1.3e+79) {
tmp = x * (4.0 / y);
} else if (x <= -6.2e-119) {
tmp = t_0;
} else if (x <= -1.6e-192) {
tmp = 4.0;
} else if (x <= -1.9e-269) {
tmp = t_0;
} else if (x <= 6e-185) {
tmp = 4.0;
} else if (x <= 1.3e-139) {
tmp = t_0;
} else if (x <= 8.5e-81) {
tmp = 4.0;
} else if (x <= 980000.0) {
tmp = t_0;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z): t_0 = z * (-4.0 / y) t_1 = (4.0 * x) / y tmp = 0 if x <= -8.2e+141: tmp = t_1 elif x <= -4e+134: tmp = 4.0 elif x <= -1.3e+79: tmp = x * (4.0 / y) elif x <= -6.2e-119: tmp = t_0 elif x <= -1.6e-192: tmp = 4.0 elif x <= -1.9e-269: tmp = t_0 elif x <= 6e-185: tmp = 4.0 elif x <= 1.3e-139: tmp = t_0 elif x <= 8.5e-81: tmp = 4.0 elif x <= 980000.0: tmp = t_0 else: tmp = t_1 return tmp
function code(x, y, z) t_0 = Float64(z * Float64(-4.0 / y)) t_1 = Float64(Float64(4.0 * x) / y) tmp = 0.0 if (x <= -8.2e+141) tmp = t_1; elseif (x <= -4e+134) tmp = 4.0; elseif (x <= -1.3e+79) tmp = Float64(x * Float64(4.0 / y)); elseif (x <= -6.2e-119) tmp = t_0; elseif (x <= -1.6e-192) tmp = 4.0; elseif (x <= -1.9e-269) tmp = t_0; elseif (x <= 6e-185) tmp = 4.0; elseif (x <= 1.3e-139) tmp = t_0; elseif (x <= 8.5e-81) tmp = 4.0; elseif (x <= 980000.0) tmp = t_0; else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z) t_0 = z * (-4.0 / y); t_1 = (4.0 * x) / y; tmp = 0.0; if (x <= -8.2e+141) tmp = t_1; elseif (x <= -4e+134) tmp = 4.0; elseif (x <= -1.3e+79) tmp = x * (4.0 / y); elseif (x <= -6.2e-119) tmp = t_0; elseif (x <= -1.6e-192) tmp = 4.0; elseif (x <= -1.9e-269) tmp = t_0; elseif (x <= 6e-185) tmp = 4.0; elseif (x <= 1.3e-139) tmp = t_0; elseif (x <= 8.5e-81) tmp = 4.0; elseif (x <= 980000.0) tmp = t_0; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(z * N[(-4.0 / y), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(4.0 * x), $MachinePrecision] / y), $MachinePrecision]}, If[LessEqual[x, -8.2e+141], t$95$1, If[LessEqual[x, -4e+134], 4.0, If[LessEqual[x, -1.3e+79], N[(x * N[(4.0 / y), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, -6.2e-119], t$95$0, If[LessEqual[x, -1.6e-192], 4.0, If[LessEqual[x, -1.9e-269], t$95$0, If[LessEqual[x, 6e-185], 4.0, If[LessEqual[x, 1.3e-139], t$95$0, If[LessEqual[x, 8.5e-81], 4.0, If[LessEqual[x, 980000.0], t$95$0, t$95$1]]]]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := z \cdot \frac{-4}{y}\\
t_1 := \frac{4 \cdot x}{y}\\
\mathbf{if}\;x \leq -8.2 \cdot 10^{+141}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \leq -4 \cdot 10^{+134}:\\
\;\;\;\;4\\
\mathbf{elif}\;x \leq -1.3 \cdot 10^{+79}:\\
\;\;\;\;x \cdot \frac{4}{y}\\
\mathbf{elif}\;x \leq -6.2 \cdot 10^{-119}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;x \leq -1.6 \cdot 10^{-192}:\\
\;\;\;\;4\\
\mathbf{elif}\;x \leq -1.9 \cdot 10^{-269}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;x \leq 6 \cdot 10^{-185}:\\
\;\;\;\;4\\
\mathbf{elif}\;x \leq 1.3 \cdot 10^{-139}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;x \leq 8.5 \cdot 10^{-81}:\\
\;\;\;\;4\\
\mathbf{elif}\;x \leq 980000:\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if x < -8.20000000000000044e141 or 9.8e5 < x Initial program 99.9%
associate-/l*99.9%
associate--l+99.9%
Simplified99.9%
Taylor expanded in x around inf 72.9%
*-commutative72.9%
associate-*l/72.9%
Simplified72.9%
if -8.20000000000000044e141 < x < -3.99999999999999969e134 or -6.19999999999999956e-119 < x < -1.6000000000000001e-192 or -1.9000000000000001e-269 < x < 6.00000000000000061e-185 or 1.2999999999999999e-139 < x < 8.5000000000000001e-81Initial program 98.6%
associate-/l*99.9%
associate--l+99.9%
Simplified99.9%
Taylor expanded in y around inf 67.3%
if -3.99999999999999969e134 < x < -1.30000000000000007e79Initial program 100.0%
associate-/l*100.0%
associate--l+100.0%
Simplified100.0%
Taylor expanded in x around 0 100.0%
Taylor expanded in x around inf 88.2%
*-commutative88.2%
associate-*l/88.2%
associate-*r/88.2%
Simplified88.2%
if -1.30000000000000007e79 < x < -6.19999999999999956e-119 or -1.6000000000000001e-192 < x < -1.9000000000000001e-269 or 6.00000000000000061e-185 < x < 1.2999999999999999e-139 or 8.5000000000000001e-81 < x < 9.8e5Initial program 99.9%
associate-/l*99.9%
associate--l+99.9%
Simplified99.9%
Taylor expanded in x around 0 100.0%
Taylor expanded in z around inf 66.0%
metadata-eval66.0%
distribute-lft-neg-in66.0%
*-lft-identity66.0%
associate-*l/65.7%
associate-*l*65.7%
*-commutative65.7%
distribute-rgt-neg-in65.7%
associate-*r/65.7%
metadata-eval65.7%
distribute-neg-frac65.7%
metadata-eval65.7%
Simplified65.7%
Final simplification69.4%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (* z (/ -4.0 y))) (t_1 (* x (/ 4.0 y))))
(if (<= x -7.6e+141)
t_1
(if (<= x -5.5e+134)
4.0
(if (<= x -1.7e+79)
t_1
(if (<= x -1.95e-119)
t_0
(if (<= x -1.75e-192)
4.0
(if (<= x -8e-274)
t_0
(if (<= x 1.3e-183)
4.0
(if (<= x 1.35e-139)
t_0
(if (<= x 1.36e-80)
4.0
(if (<= x 65000000.0) t_0 t_1))))))))))))
double code(double x, double y, double z) {
double t_0 = z * (-4.0 / y);
double t_1 = x * (4.0 / y);
double tmp;
if (x <= -7.6e+141) {
tmp = t_1;
} else if (x <= -5.5e+134) {
tmp = 4.0;
} else if (x <= -1.7e+79) {
tmp = t_1;
} else if (x <= -1.95e-119) {
tmp = t_0;
} else if (x <= -1.75e-192) {
tmp = 4.0;
} else if (x <= -8e-274) {
tmp = t_0;
} else if (x <= 1.3e-183) {
tmp = 4.0;
} else if (x <= 1.35e-139) {
tmp = t_0;
} else if (x <= 1.36e-80) {
tmp = 4.0;
} else if (x <= 65000000.0) {
tmp = t_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 = z * ((-4.0d0) / y)
t_1 = x * (4.0d0 / y)
if (x <= (-7.6d+141)) then
tmp = t_1
else if (x <= (-5.5d+134)) then
tmp = 4.0d0
else if (x <= (-1.7d+79)) then
tmp = t_1
else if (x <= (-1.95d-119)) then
tmp = t_0
else if (x <= (-1.75d-192)) then
tmp = 4.0d0
else if (x <= (-8d-274)) then
tmp = t_0
else if (x <= 1.3d-183) then
tmp = 4.0d0
else if (x <= 1.35d-139) then
tmp = t_0
else if (x <= 1.36d-80) then
tmp = 4.0d0
else if (x <= 65000000.0d0) then
tmp = t_0
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double t_0 = z * (-4.0 / y);
double t_1 = x * (4.0 / y);
double tmp;
if (x <= -7.6e+141) {
tmp = t_1;
} else if (x <= -5.5e+134) {
tmp = 4.0;
} else if (x <= -1.7e+79) {
tmp = t_1;
} else if (x <= -1.95e-119) {
tmp = t_0;
} else if (x <= -1.75e-192) {
tmp = 4.0;
} else if (x <= -8e-274) {
tmp = t_0;
} else if (x <= 1.3e-183) {
tmp = 4.0;
} else if (x <= 1.35e-139) {
tmp = t_0;
} else if (x <= 1.36e-80) {
tmp = 4.0;
} else if (x <= 65000000.0) {
tmp = t_0;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z): t_0 = z * (-4.0 / y) t_1 = x * (4.0 / y) tmp = 0 if x <= -7.6e+141: tmp = t_1 elif x <= -5.5e+134: tmp = 4.0 elif x <= -1.7e+79: tmp = t_1 elif x <= -1.95e-119: tmp = t_0 elif x <= -1.75e-192: tmp = 4.0 elif x <= -8e-274: tmp = t_0 elif x <= 1.3e-183: tmp = 4.0 elif x <= 1.35e-139: tmp = t_0 elif x <= 1.36e-80: tmp = 4.0 elif x <= 65000000.0: tmp = t_0 else: tmp = t_1 return tmp
function code(x, y, z) t_0 = Float64(z * Float64(-4.0 / y)) t_1 = Float64(x * Float64(4.0 / y)) tmp = 0.0 if (x <= -7.6e+141) tmp = t_1; elseif (x <= -5.5e+134) tmp = 4.0; elseif (x <= -1.7e+79) tmp = t_1; elseif (x <= -1.95e-119) tmp = t_0; elseif (x <= -1.75e-192) tmp = 4.0; elseif (x <= -8e-274) tmp = t_0; elseif (x <= 1.3e-183) tmp = 4.0; elseif (x <= 1.35e-139) tmp = t_0; elseif (x <= 1.36e-80) tmp = 4.0; elseif (x <= 65000000.0) tmp = t_0; else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z) t_0 = z * (-4.0 / y); t_1 = x * (4.0 / y); tmp = 0.0; if (x <= -7.6e+141) tmp = t_1; elseif (x <= -5.5e+134) tmp = 4.0; elseif (x <= -1.7e+79) tmp = t_1; elseif (x <= -1.95e-119) tmp = t_0; elseif (x <= -1.75e-192) tmp = 4.0; elseif (x <= -8e-274) tmp = t_0; elseif (x <= 1.3e-183) tmp = 4.0; elseif (x <= 1.35e-139) tmp = t_0; elseif (x <= 1.36e-80) tmp = 4.0; elseif (x <= 65000000.0) tmp = t_0; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(z * N[(-4.0 / y), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(x * N[(4.0 / y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -7.6e+141], t$95$1, If[LessEqual[x, -5.5e+134], 4.0, If[LessEqual[x, -1.7e+79], t$95$1, If[LessEqual[x, -1.95e-119], t$95$0, If[LessEqual[x, -1.75e-192], 4.0, If[LessEqual[x, -8e-274], t$95$0, If[LessEqual[x, 1.3e-183], 4.0, If[LessEqual[x, 1.35e-139], t$95$0, If[LessEqual[x, 1.36e-80], 4.0, If[LessEqual[x, 65000000.0], t$95$0, t$95$1]]]]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := z \cdot \frac{-4}{y}\\
t_1 := x \cdot \frac{4}{y}\\
\mathbf{if}\;x \leq -7.6 \cdot 10^{+141}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \leq -5.5 \cdot 10^{+134}:\\
\;\;\;\;4\\
\mathbf{elif}\;x \leq -1.7 \cdot 10^{+79}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \leq -1.95 \cdot 10^{-119}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;x \leq -1.75 \cdot 10^{-192}:\\
\;\;\;\;4\\
\mathbf{elif}\;x \leq -8 \cdot 10^{-274}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;x \leq 1.3 \cdot 10^{-183}:\\
\;\;\;\;4\\
\mathbf{elif}\;x \leq 1.35 \cdot 10^{-139}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;x \leq 1.36 \cdot 10^{-80}:\\
\;\;\;\;4\\
\mathbf{elif}\;x \leq 65000000:\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if x < -7.59999999999999952e141 or -5.4999999999999999e134 < x < -1.70000000000000016e79 or 6.5e7 < x Initial program 99.9%
associate-/l*99.9%
associate--l+99.9%
Simplified99.9%
Taylor expanded in x around 0 95.9%
Taylor expanded in x around inf 74.1%
*-commutative74.1%
associate-*l/74.1%
associate-*r/74.0%
Simplified74.0%
if -7.59999999999999952e141 < x < -5.4999999999999999e134 or -1.94999999999999995e-119 < x < -1.75000000000000007e-192 or -7.99999999999999973e-274 < x < 1.2999999999999999e-183 or 1.3499999999999999e-139 < x < 1.3599999999999999e-80Initial program 98.6%
associate-/l*99.9%
associate--l+99.9%
Simplified99.9%
Taylor expanded in y around inf 67.3%
if -1.70000000000000016e79 < x < -1.94999999999999995e-119 or -1.75000000000000007e-192 < x < -7.99999999999999973e-274 or 1.2999999999999999e-183 < x < 1.3499999999999999e-139 or 1.3599999999999999e-80 < x < 6.5e7Initial program 99.9%
associate-/l*99.9%
associate--l+99.9%
Simplified99.9%
Taylor expanded in x around 0 100.0%
Taylor expanded in z around inf 66.0%
metadata-eval66.0%
distribute-lft-neg-in66.0%
*-lft-identity66.0%
associate-*l/65.7%
associate-*l*65.7%
*-commutative65.7%
distribute-rgt-neg-in65.7%
associate-*r/65.7%
metadata-eval65.7%
distribute-neg-frac65.7%
metadata-eval65.7%
Simplified65.7%
(FPCore (x y z)
:precision binary64
(if (or (<= x -7.5e+141)
(not (or (<= x -6e+133) (and (not (<= x -8e+71)) (<= x 6.5e-45)))))
(* x (/ 4.0 y))
4.0))
double code(double x, double y, double z) {
double tmp;
if ((x <= -7.5e+141) || !((x <= -6e+133) || (!(x <= -8e+71) && (x <= 6.5e-45)))) {
tmp = x * (4.0 / 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 ((x <= (-7.5d+141)) .or. (.not. (x <= (-6d+133)) .or. (.not. (x <= (-8d+71))) .and. (x <= 6.5d-45))) then
tmp = x * (4.0d0 / y)
else
tmp = 4.0d0
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if ((x <= -7.5e+141) || !((x <= -6e+133) || (!(x <= -8e+71) && (x <= 6.5e-45)))) {
tmp = x * (4.0 / y);
} else {
tmp = 4.0;
}
return tmp;
}
def code(x, y, z): tmp = 0 if (x <= -7.5e+141) or not ((x <= -6e+133) or (not (x <= -8e+71) and (x <= 6.5e-45))): tmp = x * (4.0 / y) else: tmp = 4.0 return tmp
function code(x, y, z) tmp = 0.0 if ((x <= -7.5e+141) || !((x <= -6e+133) || (!(x <= -8e+71) && (x <= 6.5e-45)))) tmp = Float64(x * Float64(4.0 / y)); else tmp = 4.0; end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if ((x <= -7.5e+141) || ~(((x <= -6e+133) || (~((x <= -8e+71)) && (x <= 6.5e-45))))) tmp = x * (4.0 / y); else tmp = 4.0; end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[x, -7.5e+141], N[Not[Or[LessEqual[x, -6e+133], And[N[Not[LessEqual[x, -8e+71]], $MachinePrecision], LessEqual[x, 6.5e-45]]]], $MachinePrecision]], N[(x * N[(4.0 / y), $MachinePrecision]), $MachinePrecision], 4.0]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -7.5 \cdot 10^{+141} \lor \neg \left(x \leq -6 \cdot 10^{+133} \lor \neg \left(x \leq -8 \cdot 10^{+71}\right) \land x \leq 6.5 \cdot 10^{-45}\right):\\
\;\;\;\;x \cdot \frac{4}{y}\\
\mathbf{else}:\\
\;\;\;\;4\\
\end{array}
\end{array}
if x < -7.49999999999999937e141 or -6.00000000000000013e133 < x < -8.0000000000000003e71 or 6.4999999999999995e-45 < x Initial program 99.9%
associate-/l*99.9%
associate--l+99.9%
Simplified99.9%
Taylor expanded in x around 0 96.4%
Taylor expanded in x around inf 69.8%
*-commutative69.8%
associate-*l/69.8%
associate-*r/69.6%
Simplified69.6%
if -7.49999999999999937e141 < x < -6.00000000000000013e133 or -8.0000000000000003e71 < x < 6.4999999999999995e-45Initial program 99.2%
associate-/l*99.9%
associate--l+99.9%
Simplified99.9%
Taylor expanded in y around inf 49.1%
Final simplification58.0%
(FPCore (x y z) :precision binary64 (if (or (<= x -8.5e+40) (not (<= x 320000000.0))) (+ 4.0 (/ (* 4.0 x) y)) (+ 4.0 (/ (* z -4.0) y))))
double code(double x, double y, double z) {
double tmp;
if ((x <= -8.5e+40) || !(x <= 320000000.0)) {
tmp = 4.0 + ((4.0 * x) / y);
} else {
tmp = 4.0 + ((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 ((x <= (-8.5d+40)) .or. (.not. (x <= 320000000.0d0))) then
tmp = 4.0d0 + ((4.0d0 * x) / y)
else
tmp = 4.0d0 + ((z * (-4.0d0)) / y)
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if ((x <= -8.5e+40) || !(x <= 320000000.0)) {
tmp = 4.0 + ((4.0 * x) / y);
} else {
tmp = 4.0 + ((z * -4.0) / y);
}
return tmp;
}
def code(x, y, z): tmp = 0 if (x <= -8.5e+40) or not (x <= 320000000.0): tmp = 4.0 + ((4.0 * x) / y) else: tmp = 4.0 + ((z * -4.0) / y) return tmp
function code(x, y, z) tmp = 0.0 if ((x <= -8.5e+40) || !(x <= 320000000.0)) tmp = Float64(4.0 + Float64(Float64(4.0 * x) / y)); else tmp = Float64(4.0 + Float64(Float64(z * -4.0) / y)); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if ((x <= -8.5e+40) || ~((x <= 320000000.0))) tmp = 4.0 + ((4.0 * x) / y); else tmp = 4.0 + ((z * -4.0) / y); end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[x, -8.5e+40], N[Not[LessEqual[x, 320000000.0]], $MachinePrecision]], N[(4.0 + N[(N[(4.0 * x), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision], N[(4.0 + N[(N[(z * -4.0), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -8.5 \cdot 10^{+40} \lor \neg \left(x \leq 320000000\right):\\
\;\;\;\;4 + \frac{4 \cdot x}{y}\\
\mathbf{else}:\\
\;\;\;\;4 + \frac{z \cdot -4}{y}\\
\end{array}
\end{array}
if x < -8.49999999999999996e40 or 3.2e8 < x Initial program 99.1%
+-commutative99.1%
associate-/l*99.9%
fma-define99.9%
associate--l+99.9%
+-commutative99.9%
remove-double-neg99.9%
sub-neg99.9%
associate--r+99.9%
div-sub100.0%
sub-neg100.0%
associate-*l/100.0%
*-inverses100.0%
metadata-eval100.0%
distribute-frac-neg2100.0%
remove-double-neg100.0%
distribute-neg-out100.0%
+-commutative100.0%
sub-neg100.0%
distribute-frac-neg100.0%
distribute-frac-neg2100.0%
remove-double-neg100.0%
Simplified100.0%
Taylor expanded in z around 0 88.5%
distribute-lft-in88.5%
metadata-eval88.5%
associate-+r+88.5%
metadata-eval88.5%
*-commutative88.5%
associate-*l/88.5%
Simplified88.5%
if -8.49999999999999996e40 < x < 3.2e8Initial program 99.9%
associate-/l*99.9%
associate--l+99.9%
Simplified99.9%
Taylor expanded in x around 0 95.1%
div-sub95.1%
associate-/l*95.2%
*-inverses95.2%
metadata-eval95.2%
sub-neg95.2%
distribute-rgt-in95.2%
metadata-eval95.2%
associate-+r+95.2%
metadata-eval95.2%
neg-mul-195.2%
*-commutative95.2%
associate-*l*95.2%
metadata-eval95.2%
associate-*l/95.2%
Simplified95.2%
Final simplification92.2%
(FPCore (x y z) :precision binary64 (if (or (<= y -5400000.0) (not (<= y 9000000000.0))) (+ 4.0 (/ (* 4.0 x) y)) (* 4.0 (/ (- x z) y))))
double code(double x, double y, double z) {
double tmp;
if ((y <= -5400000.0) || !(y <= 9000000000.0)) {
tmp = 4.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 ((y <= (-5400000.0d0)) .or. (.not. (y <= 9000000000.0d0))) then
tmp = 4.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 ((y <= -5400000.0) || !(y <= 9000000000.0)) {
tmp = 4.0 + ((4.0 * x) / y);
} else {
tmp = 4.0 * ((x - z) / y);
}
return tmp;
}
def code(x, y, z): tmp = 0 if (y <= -5400000.0) or not (y <= 9000000000.0): tmp = 4.0 + ((4.0 * x) / y) else: tmp = 4.0 * ((x - z) / y) return tmp
function code(x, y, z) tmp = 0.0 if ((y <= -5400000.0) || !(y <= 9000000000.0)) tmp = Float64(4.0 + Float64(Float64(4.0 * 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 ((y <= -5400000.0) || ~((y <= 9000000000.0))) tmp = 4.0 + ((4.0 * x) / y); else tmp = 4.0 * ((x - z) / y); end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[y, -5400000.0], N[Not[LessEqual[y, 9000000000.0]], $MachinePrecision]], N[(4.0 + N[(N[(4.0 * x), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision], N[(4.0 * N[(N[(x - z), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -5400000 \lor \neg \left(y \leq 9000000000\right):\\
\;\;\;\;4 + \frac{4 \cdot x}{y}\\
\mathbf{else}:\\
\;\;\;\;4 \cdot \frac{x - z}{y}\\
\end{array}
\end{array}
if y < -5.4e6 or 9e9 < y Initial program 99.1%
+-commutative99.1%
associate-/l*99.9%
fma-define99.9%
associate--l+99.9%
+-commutative99.9%
remove-double-neg99.9%
sub-neg99.9%
associate--r+99.9%
div-sub99.9%
sub-neg99.9%
associate-*l/100.0%
*-inverses100.0%
metadata-eval100.0%
distribute-frac-neg2100.0%
remove-double-neg100.0%
distribute-neg-out100.0%
+-commutative100.0%
sub-neg100.0%
distribute-frac-neg100.0%
distribute-frac-neg2100.0%
remove-double-neg100.0%
Simplified100.0%
Taylor expanded in z around 0 83.6%
distribute-lft-in83.6%
metadata-eval83.6%
associate-+r+83.6%
metadata-eval83.6%
*-commutative83.6%
associate-*l/83.6%
Simplified83.6%
if -5.4e6 < y < 9e9Initial program 99.9%
associate-/l*99.9%
associate--l+99.9%
Simplified99.9%
Taylor expanded in y around 0 93.5%
*-commutative93.5%
Simplified93.5%
Final simplification88.5%
(FPCore (x y z) :precision binary64 (if (<= y -3e+95) 4.0 (if (<= y 1.65e+76) (* 4.0 (/ (- x z) y)) 4.0)))
double code(double x, double y, double z) {
double tmp;
if (y <= -3e+95) {
tmp = 4.0;
} else if (y <= 1.65e+76) {
tmp = 4.0 * ((x - z) / 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 <= (-3d+95)) then
tmp = 4.0d0
else if (y <= 1.65d+76) then
tmp = 4.0d0 * ((x - z) / 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 <= -3e+95) {
tmp = 4.0;
} else if (y <= 1.65e+76) {
tmp = 4.0 * ((x - z) / y);
} else {
tmp = 4.0;
}
return tmp;
}
def code(x, y, z): tmp = 0 if y <= -3e+95: tmp = 4.0 elif y <= 1.65e+76: tmp = 4.0 * ((x - z) / y) else: tmp = 4.0 return tmp
function code(x, y, z) tmp = 0.0 if (y <= -3e+95) tmp = 4.0; elseif (y <= 1.65e+76) tmp = Float64(4.0 * Float64(Float64(x - z) / y)); else tmp = 4.0; end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (y <= -3e+95) tmp = 4.0; elseif (y <= 1.65e+76) tmp = 4.0 * ((x - z) / y); else tmp = 4.0; end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[y, -3e+95], 4.0, If[LessEqual[y, 1.65e+76], N[(4.0 * N[(N[(x - z), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision], 4.0]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -3 \cdot 10^{+95}:\\
\;\;\;\;4\\
\mathbf{elif}\;y \leq 1.65 \cdot 10^{+76}:\\
\;\;\;\;4 \cdot \frac{x - z}{y}\\
\mathbf{else}:\\
\;\;\;\;4\\
\end{array}
\end{array}
if y < -2.99999999999999991e95 or 1.65e76 < y Initial program 98.9%
associate-/l*99.9%
associate--l+99.9%
Simplified99.9%
Taylor expanded in y around inf 69.8%
if -2.99999999999999991e95 < y < 1.65e76Initial program 99.9%
associate-/l*99.9%
associate--l+99.9%
Simplified99.9%
Taylor expanded in y around 0 87.6%
*-commutative87.6%
Simplified87.6%
Final simplification80.9%
(FPCore (x y z) :precision binary64 (+ 1.0 (* 4.0 (/ (+ x (- (* 0.75 y) z)) y))))
double code(double x, double y, double z) {
return 1.0 + (4.0 * ((x + ((0.75 * y) - 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 + ((0.75d0 * y) - z)) / y))
end function
public static double code(double x, double y, double z) {
return 1.0 + (4.0 * ((x + ((0.75 * y) - z)) / y));
}
def code(x, y, z): return 1.0 + (4.0 * ((x + ((0.75 * y) - z)) / y))
function code(x, y, z) return Float64(1.0 + Float64(4.0 * Float64(Float64(x + Float64(Float64(0.75 * y) - z)) / y))) end
function tmp = code(x, y, z) tmp = 1.0 + (4.0 * ((x + ((0.75 * y) - z)) / y)); end
code[x_, y_, z_] := N[(1.0 + N[(4.0 * N[(N[(x + N[(N[(0.75 * y), $MachinePrecision] - z), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
1 + 4 \cdot \frac{x + \left(0.75 \cdot y - z\right)}{y}
\end{array}
Initial program 99.5%
associate-/l*99.9%
associate--l+99.9%
Simplified99.9%
Final simplification99.9%
(FPCore (x y z) :precision binary64 (+ 1.0 (* 4.0 (- (+ 0.75 (/ x y)) (/ z y)))))
double code(double x, double y, double z) {
return 1.0 + (4.0 * ((0.75 + (x / y)) - (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 / y)) - (z / y)))
end function
public static double code(double x, double y, double z) {
return 1.0 + (4.0 * ((0.75 + (x / y)) - (z / y)));
}
def code(x, y, z): return 1.0 + (4.0 * ((0.75 + (x / y)) - (z / y)))
function code(x, y, z) return Float64(1.0 + Float64(4.0 * Float64(Float64(0.75 + Float64(x / y)) - Float64(z / y)))) end
function tmp = code(x, y, z) tmp = 1.0 + (4.0 * ((0.75 + (x / y)) - (z / y))); end
code[x_, y_, z_] := N[(1.0 + N[(4.0 * N[(N[(0.75 + N[(x / y), $MachinePrecision]), $MachinePrecision] - N[(z / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
1 + 4 \cdot \left(\left(0.75 + \frac{x}{y}\right) - \frac{z}{y}\right)
\end{array}
Initial program 99.5%
associate-/l*99.9%
associate--l+99.9%
Simplified99.9%
Taylor expanded in x around 0 98.4%
(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.5%
associate-/l*99.9%
associate--l+99.9%
Simplified99.9%
Taylor expanded in y around inf 34.6%
herbie shell --seed 2024101
(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)))