
(FPCore (x y z) :precision binary64 (+ x (* (* (- y x) 6.0) (- (/ 2.0 3.0) z))))
double code(double x, double y, double z) {
return x + (((y - x) * 6.0) * ((2.0 / 3.0) - z));
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
code = x + (((y - x) * 6.0d0) * ((2.0d0 / 3.0d0) - z))
end function
public static double code(double x, double y, double z) {
return x + (((y - x) * 6.0) * ((2.0 / 3.0) - z));
}
def code(x, y, z): return x + (((y - x) * 6.0) * ((2.0 / 3.0) - z))
function code(x, y, z) return Float64(x + Float64(Float64(Float64(y - x) * 6.0) * Float64(Float64(2.0 / 3.0) - z))) end
function tmp = code(x, y, z) tmp = x + (((y - x) * 6.0) * ((2.0 / 3.0) - z)); end
code[x_, y_, z_] := N[(x + N[(N[(N[(y - x), $MachinePrecision] * 6.0), $MachinePrecision] * N[(N[(2.0 / 3.0), $MachinePrecision] - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \left(\left(y - x\right) \cdot 6\right) \cdot \left(\frac{2}{3} - z\right)
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 13 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z) :precision binary64 (+ x (* (* (- y x) 6.0) (- (/ 2.0 3.0) z))))
double code(double x, double y, double z) {
return x + (((y - x) * 6.0) * ((2.0 / 3.0) - z));
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
code = x + (((y - x) * 6.0d0) * ((2.0d0 / 3.0d0) - z))
end function
public static double code(double x, double y, double z) {
return x + (((y - x) * 6.0) * ((2.0 / 3.0) - z));
}
def code(x, y, z): return x + (((y - x) * 6.0) * ((2.0 / 3.0) - z))
function code(x, y, z) return Float64(x + Float64(Float64(Float64(y - x) * 6.0) * Float64(Float64(2.0 / 3.0) - z))) end
function tmp = code(x, y, z) tmp = x + (((y - x) * 6.0) * ((2.0 / 3.0) - z)); end
code[x_, y_, z_] := N[(x + N[(N[(N[(y - x), $MachinePrecision] * 6.0), $MachinePrecision] * N[(N[(2.0 / 3.0), $MachinePrecision] - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \left(\left(y - x\right) \cdot 6\right) \cdot \left(\frac{2}{3} - z\right)
\end{array}
(FPCore (x y z) :precision binary64 (fma (- y x) (+ 4.0 (* z -6.0)) x))
double code(double x, double y, double z) {
return fma((y - x), (4.0 + (z * -6.0)), x);
}
function code(x, y, z) return fma(Float64(y - x), Float64(4.0 + Float64(z * -6.0)), x) end
code[x_, y_, z_] := N[(N[(y - x), $MachinePrecision] * N[(4.0 + N[(z * -6.0), $MachinePrecision]), $MachinePrecision] + x), $MachinePrecision]
\begin{array}{l}
\\
\mathsf{fma}\left(y - x, 4 + z \cdot -6, x\right)
\end{array}
Initial program 99.2%
+-commutative99.2%
associate-*l*99.8%
fma-define99.8%
sub-neg99.8%
distribute-rgt-in99.8%
metadata-eval99.8%
metadata-eval99.8%
distribute-lft-neg-out99.8%
distribute-rgt-neg-in99.8%
metadata-eval99.8%
Simplified99.8%
Final simplification99.8%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (* 6.0 (* x z))))
(if (<= z -0.09)
t_0
(if (<= z -5e-83)
(* y 4.0)
(if (<= z -3e-185)
(* x -3.0)
(if (<= z -1.7e-225)
(* y 4.0)
(if (<= z 1.1e-303)
(* x -3.0)
(if (<= z 1.9e-259)
(* y 4.0)
(if (<= z 5.8e-73)
(* x -3.0)
(if (<= z 0.5) (* y 4.0) t_0))))))))))
double code(double x, double y, double z) {
double t_0 = 6.0 * (x * z);
double tmp;
if (z <= -0.09) {
tmp = t_0;
} else if (z <= -5e-83) {
tmp = y * 4.0;
} else if (z <= -3e-185) {
tmp = x * -3.0;
} else if (z <= -1.7e-225) {
tmp = y * 4.0;
} else if (z <= 1.1e-303) {
tmp = x * -3.0;
} else if (z <= 1.9e-259) {
tmp = y * 4.0;
} else if (z <= 5.8e-73) {
tmp = x * -3.0;
} else if (z <= 0.5) {
tmp = y * 4.0;
} else {
tmp = t_0;
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: t_0
real(8) :: tmp
t_0 = 6.0d0 * (x * z)
if (z <= (-0.09d0)) then
tmp = t_0
else if (z <= (-5d-83)) then
tmp = y * 4.0d0
else if (z <= (-3d-185)) then
tmp = x * (-3.0d0)
else if (z <= (-1.7d-225)) then
tmp = y * 4.0d0
else if (z <= 1.1d-303) then
tmp = x * (-3.0d0)
else if (z <= 1.9d-259) then
tmp = y * 4.0d0
else if (z <= 5.8d-73) then
tmp = x * (-3.0d0)
else if (z <= 0.5d0) then
tmp = y * 4.0d0
else
tmp = t_0
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double t_0 = 6.0 * (x * z);
double tmp;
if (z <= -0.09) {
tmp = t_0;
} else if (z <= -5e-83) {
tmp = y * 4.0;
} else if (z <= -3e-185) {
tmp = x * -3.0;
} else if (z <= -1.7e-225) {
tmp = y * 4.0;
} else if (z <= 1.1e-303) {
tmp = x * -3.0;
} else if (z <= 1.9e-259) {
tmp = y * 4.0;
} else if (z <= 5.8e-73) {
tmp = x * -3.0;
} else if (z <= 0.5) {
tmp = y * 4.0;
} else {
tmp = t_0;
}
return tmp;
}
def code(x, y, z): t_0 = 6.0 * (x * z) tmp = 0 if z <= -0.09: tmp = t_0 elif z <= -5e-83: tmp = y * 4.0 elif z <= -3e-185: tmp = x * -3.0 elif z <= -1.7e-225: tmp = y * 4.0 elif z <= 1.1e-303: tmp = x * -3.0 elif z <= 1.9e-259: tmp = y * 4.0 elif z <= 5.8e-73: tmp = x * -3.0 elif z <= 0.5: tmp = y * 4.0 else: tmp = t_0 return tmp
function code(x, y, z) t_0 = Float64(6.0 * Float64(x * z)) tmp = 0.0 if (z <= -0.09) tmp = t_0; elseif (z <= -5e-83) tmp = Float64(y * 4.0); elseif (z <= -3e-185) tmp = Float64(x * -3.0); elseif (z <= -1.7e-225) tmp = Float64(y * 4.0); elseif (z <= 1.1e-303) tmp = Float64(x * -3.0); elseif (z <= 1.9e-259) tmp = Float64(y * 4.0); elseif (z <= 5.8e-73) tmp = Float64(x * -3.0); elseif (z <= 0.5) tmp = Float64(y * 4.0); else tmp = t_0; end return tmp end
function tmp_2 = code(x, y, z) t_0 = 6.0 * (x * z); tmp = 0.0; if (z <= -0.09) tmp = t_0; elseif (z <= -5e-83) tmp = y * 4.0; elseif (z <= -3e-185) tmp = x * -3.0; elseif (z <= -1.7e-225) tmp = y * 4.0; elseif (z <= 1.1e-303) tmp = x * -3.0; elseif (z <= 1.9e-259) tmp = y * 4.0; elseif (z <= 5.8e-73) tmp = x * -3.0; elseif (z <= 0.5) tmp = y * 4.0; else tmp = t_0; end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(6.0 * N[(x * z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -0.09], t$95$0, If[LessEqual[z, -5e-83], N[(y * 4.0), $MachinePrecision], If[LessEqual[z, -3e-185], N[(x * -3.0), $MachinePrecision], If[LessEqual[z, -1.7e-225], N[(y * 4.0), $MachinePrecision], If[LessEqual[z, 1.1e-303], N[(x * -3.0), $MachinePrecision], If[LessEqual[z, 1.9e-259], N[(y * 4.0), $MachinePrecision], If[LessEqual[z, 5.8e-73], N[(x * -3.0), $MachinePrecision], If[LessEqual[z, 0.5], N[(y * 4.0), $MachinePrecision], t$95$0]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 6 \cdot \left(x \cdot z\right)\\
\mathbf{if}\;z \leq -0.09:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;z \leq -5 \cdot 10^{-83}:\\
\;\;\;\;y \cdot 4\\
\mathbf{elif}\;z \leq -3 \cdot 10^{-185}:\\
\;\;\;\;x \cdot -3\\
\mathbf{elif}\;z \leq -1.7 \cdot 10^{-225}:\\
\;\;\;\;y \cdot 4\\
\mathbf{elif}\;z \leq 1.1 \cdot 10^{-303}:\\
\;\;\;\;x \cdot -3\\
\mathbf{elif}\;z \leq 1.9 \cdot 10^{-259}:\\
\;\;\;\;y \cdot 4\\
\mathbf{elif}\;z \leq 5.8 \cdot 10^{-73}:\\
\;\;\;\;x \cdot -3\\
\mathbf{elif}\;z \leq 0.5:\\
\;\;\;\;y \cdot 4\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if z < -0.089999999999999997 or 0.5 < z Initial program 99.8%
metadata-eval99.8%
Simplified99.8%
Taylor expanded in x around inf 47.5%
metadata-eval47.5%
cancel-sign-sub-inv47.5%
sub-neg47.5%
distribute-lft-in47.5%
metadata-eval47.5%
distribute-rgt-neg-in47.5%
distribute-lft-neg-in47.5%
metadata-eval47.5%
+-commutative47.5%
*-commutative47.5%
fma-undefine47.4%
unsub-neg47.4%
fma-undefine47.5%
*-commutative47.5%
+-commutative47.5%
mul-1-neg47.5%
distribute-rgt-in47.5%
metadata-eval47.5%
associate-+r+47.5%
metadata-eval47.5%
*-commutative47.5%
associate-*l*47.5%
metadata-eval47.5%
Simplified47.5%
Taylor expanded in z around inf 46.0%
if -0.089999999999999997 < z < -5e-83 or -3.0000000000000003e-185 < z < -1.7e-225 or 1.10000000000000007e-303 < z < 1.9e-259 or 5.8e-73 < z < 0.5Initial program 98.2%
+-commutative98.2%
associate-*l*99.9%
fma-define99.9%
sub-neg99.9%
distribute-rgt-in99.9%
metadata-eval99.9%
metadata-eval99.9%
distribute-lft-neg-out99.9%
distribute-rgt-neg-in99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in y around inf 71.6%
Taylor expanded in z around 0 70.5%
if -5e-83 < z < -3.0000000000000003e-185 or -1.7e-225 < z < 1.10000000000000007e-303 or 1.9e-259 < z < 5.8e-73Initial program 99.3%
metadata-eval99.3%
Simplified99.3%
Taylor expanded in x around inf 66.6%
metadata-eval66.6%
cancel-sign-sub-inv66.6%
sub-neg66.6%
distribute-lft-in66.6%
metadata-eval66.6%
distribute-rgt-neg-in66.6%
distribute-lft-neg-in66.6%
metadata-eval66.6%
+-commutative66.6%
*-commutative66.6%
fma-undefine66.6%
unsub-neg66.6%
fma-undefine66.6%
*-commutative66.6%
+-commutative66.6%
mul-1-neg66.6%
distribute-rgt-in66.6%
metadata-eval66.6%
associate-+r+66.6%
metadata-eval66.6%
*-commutative66.6%
associate-*l*66.6%
metadata-eval66.6%
Simplified66.6%
Taylor expanded in z around 0 66.6%
*-commutative66.6%
Simplified66.6%
Final simplification58.6%
(FPCore (x y z)
:precision binary64
(if (<= z -0.0066)
(* x (* z 6.0))
(if (<= z -1.4e-82)
(* y 4.0)
(if (<= z -9.5e-186)
(* x -3.0)
(if (<= z -2.8e-225)
(* y 4.0)
(if (<= z 8e-303)
(* x -3.0)
(if (<= z 6.2e-263)
(* y 4.0)
(if (<= z 2.55e-71)
(* x -3.0)
(if (<= z 0.6) (* y 4.0) (* 6.0 (* x z)))))))))))
double code(double x, double y, double z) {
double tmp;
if (z <= -0.0066) {
tmp = x * (z * 6.0);
} else if (z <= -1.4e-82) {
tmp = y * 4.0;
} else if (z <= -9.5e-186) {
tmp = x * -3.0;
} else if (z <= -2.8e-225) {
tmp = y * 4.0;
} else if (z <= 8e-303) {
tmp = x * -3.0;
} else if (z <= 6.2e-263) {
tmp = y * 4.0;
} else if (z <= 2.55e-71) {
tmp = x * -3.0;
} else if (z <= 0.6) {
tmp = y * 4.0;
} else {
tmp = 6.0 * (x * z);
}
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 <= (-0.0066d0)) then
tmp = x * (z * 6.0d0)
else if (z <= (-1.4d-82)) then
tmp = y * 4.0d0
else if (z <= (-9.5d-186)) then
tmp = x * (-3.0d0)
else if (z <= (-2.8d-225)) then
tmp = y * 4.0d0
else if (z <= 8d-303) then
tmp = x * (-3.0d0)
else if (z <= 6.2d-263) then
tmp = y * 4.0d0
else if (z <= 2.55d-71) then
tmp = x * (-3.0d0)
else if (z <= 0.6d0) then
tmp = y * 4.0d0
else
tmp = 6.0d0 * (x * z)
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (z <= -0.0066) {
tmp = x * (z * 6.0);
} else if (z <= -1.4e-82) {
tmp = y * 4.0;
} else if (z <= -9.5e-186) {
tmp = x * -3.0;
} else if (z <= -2.8e-225) {
tmp = y * 4.0;
} else if (z <= 8e-303) {
tmp = x * -3.0;
} else if (z <= 6.2e-263) {
tmp = y * 4.0;
} else if (z <= 2.55e-71) {
tmp = x * -3.0;
} else if (z <= 0.6) {
tmp = y * 4.0;
} else {
tmp = 6.0 * (x * z);
}
return tmp;
}
def code(x, y, z): tmp = 0 if z <= -0.0066: tmp = x * (z * 6.0) elif z <= -1.4e-82: tmp = y * 4.0 elif z <= -9.5e-186: tmp = x * -3.0 elif z <= -2.8e-225: tmp = y * 4.0 elif z <= 8e-303: tmp = x * -3.0 elif z <= 6.2e-263: tmp = y * 4.0 elif z <= 2.55e-71: tmp = x * -3.0 elif z <= 0.6: tmp = y * 4.0 else: tmp = 6.0 * (x * z) return tmp
function code(x, y, z) tmp = 0.0 if (z <= -0.0066) tmp = Float64(x * Float64(z * 6.0)); elseif (z <= -1.4e-82) tmp = Float64(y * 4.0); elseif (z <= -9.5e-186) tmp = Float64(x * -3.0); elseif (z <= -2.8e-225) tmp = Float64(y * 4.0); elseif (z <= 8e-303) tmp = Float64(x * -3.0); elseif (z <= 6.2e-263) tmp = Float64(y * 4.0); elseif (z <= 2.55e-71) tmp = Float64(x * -3.0); elseif (z <= 0.6) tmp = Float64(y * 4.0); else tmp = Float64(6.0 * Float64(x * z)); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (z <= -0.0066) tmp = x * (z * 6.0); elseif (z <= -1.4e-82) tmp = y * 4.0; elseif (z <= -9.5e-186) tmp = x * -3.0; elseif (z <= -2.8e-225) tmp = y * 4.0; elseif (z <= 8e-303) tmp = x * -3.0; elseif (z <= 6.2e-263) tmp = y * 4.0; elseif (z <= 2.55e-71) tmp = x * -3.0; elseif (z <= 0.6) tmp = y * 4.0; else tmp = 6.0 * (x * z); end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[z, -0.0066], N[(x * N[(z * 6.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -1.4e-82], N[(y * 4.0), $MachinePrecision], If[LessEqual[z, -9.5e-186], N[(x * -3.0), $MachinePrecision], If[LessEqual[z, -2.8e-225], N[(y * 4.0), $MachinePrecision], If[LessEqual[z, 8e-303], N[(x * -3.0), $MachinePrecision], If[LessEqual[z, 6.2e-263], N[(y * 4.0), $MachinePrecision], If[LessEqual[z, 2.55e-71], N[(x * -3.0), $MachinePrecision], If[LessEqual[z, 0.6], N[(y * 4.0), $MachinePrecision], N[(6.0 * N[(x * z), $MachinePrecision]), $MachinePrecision]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -0.0066:\\
\;\;\;\;x \cdot \left(z \cdot 6\right)\\
\mathbf{elif}\;z \leq -1.4 \cdot 10^{-82}:\\
\;\;\;\;y \cdot 4\\
\mathbf{elif}\;z \leq -9.5 \cdot 10^{-186}:\\
\;\;\;\;x \cdot -3\\
\mathbf{elif}\;z \leq -2.8 \cdot 10^{-225}:\\
\;\;\;\;y \cdot 4\\
\mathbf{elif}\;z \leq 8 \cdot 10^{-303}:\\
\;\;\;\;x \cdot -3\\
\mathbf{elif}\;z \leq 6.2 \cdot 10^{-263}:\\
\;\;\;\;y \cdot 4\\
\mathbf{elif}\;z \leq 2.55 \cdot 10^{-71}:\\
\;\;\;\;x \cdot -3\\
\mathbf{elif}\;z \leq 0.6:\\
\;\;\;\;y \cdot 4\\
\mathbf{else}:\\
\;\;\;\;6 \cdot \left(x \cdot z\right)\\
\end{array}
\end{array}
if z < -0.0066Initial program 99.7%
metadata-eval99.7%
Simplified99.7%
Taylor expanded in x around inf 46.8%
metadata-eval46.8%
cancel-sign-sub-inv46.8%
sub-neg46.8%
distribute-lft-in46.8%
metadata-eval46.8%
distribute-rgt-neg-in46.8%
distribute-lft-neg-in46.8%
metadata-eval46.8%
+-commutative46.8%
*-commutative46.8%
fma-undefine46.8%
unsub-neg46.8%
fma-undefine46.8%
*-commutative46.8%
+-commutative46.8%
mul-1-neg46.8%
distribute-rgt-in46.8%
metadata-eval46.8%
associate-+r+46.8%
metadata-eval46.8%
*-commutative46.8%
associate-*l*46.8%
metadata-eval46.8%
Simplified46.8%
Taylor expanded in z around inf 44.2%
*-commutative44.2%
associate-*l*44.3%
*-commutative44.3%
*-commutative44.3%
Simplified44.3%
if -0.0066 < z < -1.40000000000000012e-82 or -9.4999999999999998e-186 < z < -2.8e-225 or 7.99999999999999944e-303 < z < 6.20000000000000008e-263 or 2.5500000000000001e-71 < z < 0.599999999999999978Initial program 98.2%
+-commutative98.2%
associate-*l*99.9%
fma-define99.9%
sub-neg99.9%
distribute-rgt-in99.9%
metadata-eval99.9%
metadata-eval99.9%
distribute-lft-neg-out99.9%
distribute-rgt-neg-in99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in y around inf 71.6%
Taylor expanded in z around 0 70.5%
if -1.40000000000000012e-82 < z < -9.4999999999999998e-186 or -2.8e-225 < z < 7.99999999999999944e-303 or 6.20000000000000008e-263 < z < 2.5500000000000001e-71Initial program 99.3%
metadata-eval99.3%
Simplified99.3%
Taylor expanded in x around inf 66.6%
metadata-eval66.6%
cancel-sign-sub-inv66.6%
sub-neg66.6%
distribute-lft-in66.6%
metadata-eval66.6%
distribute-rgt-neg-in66.6%
distribute-lft-neg-in66.6%
metadata-eval66.6%
+-commutative66.6%
*-commutative66.6%
fma-undefine66.6%
unsub-neg66.6%
fma-undefine66.6%
*-commutative66.6%
+-commutative66.6%
mul-1-neg66.6%
distribute-rgt-in66.6%
metadata-eval66.6%
associate-+r+66.6%
metadata-eval66.6%
*-commutative66.6%
associate-*l*66.6%
metadata-eval66.6%
Simplified66.6%
Taylor expanded in z around 0 66.6%
*-commutative66.6%
Simplified66.6%
if 0.599999999999999978 < z Initial program 99.8%
metadata-eval99.8%
Simplified99.8%
Taylor expanded in x around inf 48.3%
metadata-eval48.3%
cancel-sign-sub-inv48.3%
sub-neg48.3%
distribute-lft-in48.3%
metadata-eval48.3%
distribute-rgt-neg-in48.3%
distribute-lft-neg-in48.3%
metadata-eval48.3%
+-commutative48.3%
*-commutative48.3%
fma-undefine48.3%
unsub-neg48.3%
fma-undefine48.3%
*-commutative48.3%
+-commutative48.3%
mul-1-neg48.3%
distribute-rgt-in48.3%
metadata-eval48.3%
associate-+r+48.3%
metadata-eval48.3%
*-commutative48.3%
associate-*l*48.3%
metadata-eval48.3%
Simplified48.3%
Taylor expanded in z around inf 48.4%
Final simplification58.6%
(FPCore (x y z)
:precision binary64
(if (or (<= x -6e+79)
(not (or (<= x -2.15e-51) (and (not (<= x -2.5e-156)) (<= x 9e-37)))))
(* x -3.0)
(* y 4.0)))
double code(double x, double y, double z) {
double tmp;
if ((x <= -6e+79) || !((x <= -2.15e-51) || (!(x <= -2.5e-156) && (x <= 9e-37)))) {
tmp = x * -3.0;
} else {
tmp = y * 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 <= (-6d+79)) .or. (.not. (x <= (-2.15d-51)) .or. (.not. (x <= (-2.5d-156))) .and. (x <= 9d-37))) then
tmp = x * (-3.0d0)
else
tmp = y * 4.0d0
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if ((x <= -6e+79) || !((x <= -2.15e-51) || (!(x <= -2.5e-156) && (x <= 9e-37)))) {
tmp = x * -3.0;
} else {
tmp = y * 4.0;
}
return tmp;
}
def code(x, y, z): tmp = 0 if (x <= -6e+79) or not ((x <= -2.15e-51) or (not (x <= -2.5e-156) and (x <= 9e-37))): tmp = x * -3.0 else: tmp = y * 4.0 return tmp
function code(x, y, z) tmp = 0.0 if ((x <= -6e+79) || !((x <= -2.15e-51) || (!(x <= -2.5e-156) && (x <= 9e-37)))) tmp = Float64(x * -3.0); else tmp = Float64(y * 4.0); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if ((x <= -6e+79) || ~(((x <= -2.15e-51) || (~((x <= -2.5e-156)) && (x <= 9e-37))))) tmp = x * -3.0; else tmp = y * 4.0; end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[x, -6e+79], N[Not[Or[LessEqual[x, -2.15e-51], And[N[Not[LessEqual[x, -2.5e-156]], $MachinePrecision], LessEqual[x, 9e-37]]]], $MachinePrecision]], N[(x * -3.0), $MachinePrecision], N[(y * 4.0), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -6 \cdot 10^{+79} \lor \neg \left(x \leq -2.15 \cdot 10^{-51} \lor \neg \left(x \leq -2.5 \cdot 10^{-156}\right) \land x \leq 9 \cdot 10^{-37}\right):\\
\;\;\;\;x \cdot -3\\
\mathbf{else}:\\
\;\;\;\;y \cdot 4\\
\end{array}
\end{array}
if x < -5.99999999999999948e79 or -2.1499999999999999e-51 < x < -2.50000000000000004e-156 or 9.00000000000000081e-37 < x Initial program 99.5%
metadata-eval99.5%
Simplified99.5%
Taylor expanded in x around inf 72.3%
metadata-eval72.3%
cancel-sign-sub-inv72.3%
sub-neg72.3%
distribute-lft-in72.3%
metadata-eval72.3%
distribute-rgt-neg-in72.3%
distribute-lft-neg-in72.3%
metadata-eval72.3%
+-commutative72.3%
*-commutative72.3%
fma-undefine72.2%
unsub-neg72.2%
fma-undefine72.3%
*-commutative72.3%
+-commutative72.3%
mul-1-neg72.3%
distribute-rgt-in72.3%
metadata-eval72.3%
associate-+r+72.3%
metadata-eval72.3%
*-commutative72.3%
associate-*l*72.3%
metadata-eval72.3%
Simplified72.3%
Taylor expanded in z around 0 48.2%
*-commutative48.2%
Simplified48.2%
if -5.99999999999999948e79 < x < -2.1499999999999999e-51 or -2.50000000000000004e-156 < x < 9.00000000000000081e-37Initial program 99.0%
+-commutative99.0%
associate-*l*99.8%
fma-define99.8%
sub-neg99.8%
distribute-rgt-in99.8%
metadata-eval99.8%
metadata-eval99.8%
distribute-lft-neg-out99.8%
distribute-rgt-neg-in99.8%
metadata-eval99.8%
Simplified99.8%
Taylor expanded in y around inf 74.6%
Taylor expanded in z around 0 46.7%
Final simplification47.5%
(FPCore (x y z) :precision binary64 (if (or (<= x -1.05e+90) (not (<= x 1.4e-16))) (* x -3.0) (* 6.0 (* y (- 0.6666666666666666 z)))))
double code(double x, double y, double z) {
double tmp;
if ((x <= -1.05e+90) || !(x <= 1.4e-16)) {
tmp = x * -3.0;
} else {
tmp = 6.0 * (y * (0.6666666666666666 - z));
}
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 <= (-1.05d+90)) .or. (.not. (x <= 1.4d-16))) then
tmp = x * (-3.0d0)
else
tmp = 6.0d0 * (y * (0.6666666666666666d0 - z))
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if ((x <= -1.05e+90) || !(x <= 1.4e-16)) {
tmp = x * -3.0;
} else {
tmp = 6.0 * (y * (0.6666666666666666 - z));
}
return tmp;
}
def code(x, y, z): tmp = 0 if (x <= -1.05e+90) or not (x <= 1.4e-16): tmp = x * -3.0 else: tmp = 6.0 * (y * (0.6666666666666666 - z)) return tmp
function code(x, y, z) tmp = 0.0 if ((x <= -1.05e+90) || !(x <= 1.4e-16)) tmp = Float64(x * -3.0); else tmp = Float64(6.0 * Float64(y * Float64(0.6666666666666666 - z))); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if ((x <= -1.05e+90) || ~((x <= 1.4e-16))) tmp = x * -3.0; else tmp = 6.0 * (y * (0.6666666666666666 - z)); end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[x, -1.05e+90], N[Not[LessEqual[x, 1.4e-16]], $MachinePrecision]], N[(x * -3.0), $MachinePrecision], N[(6.0 * N[(y * N[(0.6666666666666666 - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.05 \cdot 10^{+90} \lor \neg \left(x \leq 1.4 \cdot 10^{-16}\right):\\
\;\;\;\;x \cdot -3\\
\mathbf{else}:\\
\;\;\;\;6 \cdot \left(y \cdot \left(0.6666666666666666 - z\right)\right)\\
\end{array}
\end{array}
if x < -1.0499999999999999e90 or 1.4000000000000001e-16 < x Initial program 99.5%
metadata-eval99.5%
Simplified99.5%
Taylor expanded in x around inf 76.2%
metadata-eval76.2%
cancel-sign-sub-inv76.2%
sub-neg76.2%
distribute-lft-in76.2%
metadata-eval76.2%
distribute-rgt-neg-in76.2%
distribute-lft-neg-in76.2%
metadata-eval76.2%
+-commutative76.2%
*-commutative76.2%
fma-undefine76.2%
unsub-neg76.2%
fma-undefine76.2%
*-commutative76.2%
+-commutative76.2%
mul-1-neg76.2%
distribute-rgt-in76.2%
metadata-eval76.2%
associate-+r+76.2%
metadata-eval76.2%
*-commutative76.2%
associate-*l*76.2%
metadata-eval76.2%
Simplified76.2%
Taylor expanded in z around 0 51.3%
*-commutative51.3%
Simplified51.3%
if -1.0499999999999999e90 < x < 1.4000000000000001e-16Initial program 99.1%
metadata-eval99.1%
Simplified99.1%
flip-+61.9%
clear-num61.8%
associate-*l*61.8%
pow261.8%
pow261.8%
associate-*l*62.0%
Applied egg-rr62.0%
frac-2neg62.0%
distribute-frac-neg62.0%
distribute-neg-frac262.0%
/-rgt-identity62.0%
clear-num62.0%
distribute-neg-frac62.0%
metadata-eval62.0%
clear-num62.0%
Applied egg-rr99.6%
Taylor expanded in x around 0 68.9%
Final simplification61.8%
(FPCore (x y z) :precision binary64 (if (or (<= x -5.6e-118) (not (<= x 3.5e-38))) (* x (+ -3.0 (* z 6.0))) (* 6.0 (* y (- 0.6666666666666666 z)))))
double code(double x, double y, double z) {
double tmp;
if ((x <= -5.6e-118) || !(x <= 3.5e-38)) {
tmp = x * (-3.0 + (z * 6.0));
} else {
tmp = 6.0 * (y * (0.6666666666666666 - z));
}
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 <= (-5.6d-118)) .or. (.not. (x <= 3.5d-38))) then
tmp = x * ((-3.0d0) + (z * 6.0d0))
else
tmp = 6.0d0 * (y * (0.6666666666666666d0 - z))
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if ((x <= -5.6e-118) || !(x <= 3.5e-38)) {
tmp = x * (-3.0 + (z * 6.0));
} else {
tmp = 6.0 * (y * (0.6666666666666666 - z));
}
return tmp;
}
def code(x, y, z): tmp = 0 if (x <= -5.6e-118) or not (x <= 3.5e-38): tmp = x * (-3.0 + (z * 6.0)) else: tmp = 6.0 * (y * (0.6666666666666666 - z)) return tmp
function code(x, y, z) tmp = 0.0 if ((x <= -5.6e-118) || !(x <= 3.5e-38)) tmp = Float64(x * Float64(-3.0 + Float64(z * 6.0))); else tmp = Float64(6.0 * Float64(y * Float64(0.6666666666666666 - z))); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if ((x <= -5.6e-118) || ~((x <= 3.5e-38))) tmp = x * (-3.0 + (z * 6.0)); else tmp = 6.0 * (y * (0.6666666666666666 - z)); end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[x, -5.6e-118], N[Not[LessEqual[x, 3.5e-38]], $MachinePrecision]], N[(x * N[(-3.0 + N[(z * 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(6.0 * N[(y * N[(0.6666666666666666 - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -5.6 \cdot 10^{-118} \lor \neg \left(x \leq 3.5 \cdot 10^{-38}\right):\\
\;\;\;\;x \cdot \left(-3 + z \cdot 6\right)\\
\mathbf{else}:\\
\;\;\;\;6 \cdot \left(y \cdot \left(0.6666666666666666 - z\right)\right)\\
\end{array}
\end{array}
if x < -5.6e-118 or 3.5000000000000001e-38 < x Initial program 99.0%
metadata-eval99.0%
Simplified99.0%
Taylor expanded in x around inf 69.0%
metadata-eval69.0%
cancel-sign-sub-inv69.0%
sub-neg69.0%
distribute-lft-in69.0%
metadata-eval69.0%
distribute-rgt-neg-in69.0%
distribute-lft-neg-in69.0%
metadata-eval69.0%
+-commutative69.0%
*-commutative69.0%
fma-undefine69.0%
unsub-neg69.0%
fma-undefine69.0%
*-commutative69.0%
+-commutative69.0%
mul-1-neg69.0%
distribute-rgt-in69.0%
metadata-eval69.0%
associate-+r+69.0%
metadata-eval69.0%
*-commutative69.0%
associate-*l*69.0%
metadata-eval69.0%
Simplified69.0%
if -5.6e-118 < x < 3.5000000000000001e-38Initial program 99.6%
metadata-eval99.6%
Simplified99.6%
flip-+63.4%
clear-num63.2%
associate-*l*63.0%
pow263.0%
pow263.0%
associate-*l*63.3%
Applied egg-rr63.3%
frac-2neg63.3%
distribute-frac-neg63.3%
distribute-neg-frac263.3%
/-rgt-identity63.3%
clear-num63.3%
distribute-neg-frac63.3%
metadata-eval63.3%
clear-num63.3%
Applied egg-rr99.6%
Taylor expanded in x around 0 81.8%
Final simplification73.9%
(FPCore (x y z) :precision binary64 (if (or (<= x -5.6e-118) (not (<= x 3e-37))) (* x (+ -3.0 (* z 6.0))) (* y (+ 4.0 (* z -6.0)))))
double code(double x, double y, double z) {
double tmp;
if ((x <= -5.6e-118) || !(x <= 3e-37)) {
tmp = x * (-3.0 + (z * 6.0));
} else {
tmp = y * (4.0 + (z * -6.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 <= (-5.6d-118)) .or. (.not. (x <= 3d-37))) then
tmp = x * ((-3.0d0) + (z * 6.0d0))
else
tmp = y * (4.0d0 + (z * (-6.0d0)))
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if ((x <= -5.6e-118) || !(x <= 3e-37)) {
tmp = x * (-3.0 + (z * 6.0));
} else {
tmp = y * (4.0 + (z * -6.0));
}
return tmp;
}
def code(x, y, z): tmp = 0 if (x <= -5.6e-118) or not (x <= 3e-37): tmp = x * (-3.0 + (z * 6.0)) else: tmp = y * (4.0 + (z * -6.0)) return tmp
function code(x, y, z) tmp = 0.0 if ((x <= -5.6e-118) || !(x <= 3e-37)) tmp = Float64(x * Float64(-3.0 + Float64(z * 6.0))); else tmp = Float64(y * Float64(4.0 + Float64(z * -6.0))); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if ((x <= -5.6e-118) || ~((x <= 3e-37))) tmp = x * (-3.0 + (z * 6.0)); else tmp = y * (4.0 + (z * -6.0)); end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[x, -5.6e-118], N[Not[LessEqual[x, 3e-37]], $MachinePrecision]], N[(x * N[(-3.0 + N[(z * 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(y * N[(4.0 + N[(z * -6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -5.6 \cdot 10^{-118} \lor \neg \left(x \leq 3 \cdot 10^{-37}\right):\\
\;\;\;\;x \cdot \left(-3 + z \cdot 6\right)\\
\mathbf{else}:\\
\;\;\;\;y \cdot \left(4 + z \cdot -6\right)\\
\end{array}
\end{array}
if x < -5.6e-118 or 3e-37 < x Initial program 99.0%
metadata-eval99.0%
Simplified99.0%
Taylor expanded in x around inf 69.0%
metadata-eval69.0%
cancel-sign-sub-inv69.0%
sub-neg69.0%
distribute-lft-in69.0%
metadata-eval69.0%
distribute-rgt-neg-in69.0%
distribute-lft-neg-in69.0%
metadata-eval69.0%
+-commutative69.0%
*-commutative69.0%
fma-undefine69.0%
unsub-neg69.0%
fma-undefine69.0%
*-commutative69.0%
+-commutative69.0%
mul-1-neg69.0%
distribute-rgt-in69.0%
metadata-eval69.0%
associate-+r+69.0%
metadata-eval69.0%
*-commutative69.0%
associate-*l*69.0%
metadata-eval69.0%
Simplified69.0%
if -5.6e-118 < x < 3e-37Initial program 99.6%
+-commutative99.6%
associate-*l*99.8%
fma-define99.8%
sub-neg99.8%
distribute-rgt-in99.8%
metadata-eval99.8%
metadata-eval99.8%
distribute-lft-neg-out99.8%
distribute-rgt-neg-in99.8%
metadata-eval99.8%
Simplified99.8%
Taylor expanded in y around inf 82.0%
Final simplification74.0%
(FPCore (x y z) :precision binary64 (if (or (<= z -0.56) (not (<= z 0.66))) (* z (* (- y x) -6.0)) (+ x (* (- y x) 4.0))))
double code(double x, double y, double z) {
double tmp;
if ((z <= -0.56) || !(z <= 0.66)) {
tmp = z * ((y - x) * -6.0);
} else {
tmp = x + ((y - x) * 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 ((z <= (-0.56d0)) .or. (.not. (z <= 0.66d0))) then
tmp = z * ((y - x) * (-6.0d0))
else
tmp = x + ((y - x) * 4.0d0)
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if ((z <= -0.56) || !(z <= 0.66)) {
tmp = z * ((y - x) * -6.0);
} else {
tmp = x + ((y - x) * 4.0);
}
return tmp;
}
def code(x, y, z): tmp = 0 if (z <= -0.56) or not (z <= 0.66): tmp = z * ((y - x) * -6.0) else: tmp = x + ((y - x) * 4.0) return tmp
function code(x, y, z) tmp = 0.0 if ((z <= -0.56) || !(z <= 0.66)) tmp = Float64(z * Float64(Float64(y - x) * -6.0)); else tmp = Float64(x + Float64(Float64(y - x) * 4.0)); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if ((z <= -0.56) || ~((z <= 0.66))) tmp = z * ((y - x) * -6.0); else tmp = x + ((y - x) * 4.0); end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[z, -0.56], N[Not[LessEqual[z, 0.66]], $MachinePrecision]], N[(z * N[(N[(y - x), $MachinePrecision] * -6.0), $MachinePrecision]), $MachinePrecision], N[(x + N[(N[(y - x), $MachinePrecision] * 4.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -0.56 \lor \neg \left(z \leq 0.66\right):\\
\;\;\;\;z \cdot \left(\left(y - x\right) \cdot -6\right)\\
\mathbf{else}:\\
\;\;\;\;x + \left(y - x\right) \cdot 4\\
\end{array}
\end{array}
if z < -0.56000000000000005 or 0.660000000000000031 < z Initial program 99.8%
metadata-eval99.8%
Simplified99.8%
flip-+33.5%
clear-num33.5%
associate-*l*33.3%
pow233.3%
pow233.3%
associate-*l*33.4%
Applied egg-rr33.4%
frac-2neg33.4%
distribute-frac-neg33.4%
distribute-neg-frac233.4%
/-rgt-identity33.4%
clear-num33.4%
distribute-neg-frac33.4%
metadata-eval33.4%
clear-num33.4%
Applied egg-rr99.7%
Taylor expanded in z around inf 97.3%
associate-*r*97.2%
*-commutative97.2%
associate-*l*97.3%
Simplified97.3%
if -0.56000000000000005 < z < 0.660000000000000031Initial program 98.9%
metadata-eval98.9%
Simplified98.9%
Taylor expanded in z around 0 98.5%
Final simplification98.0%
(FPCore (x y z) :precision binary64 (if (<= z -0.66) (- x (* -6.0 (* z (- x y)))) (if (<= z 0.6) (+ x (* (- y x) 4.0)) (* z (* (- y x) -6.0)))))
double code(double x, double y, double z) {
double tmp;
if (z <= -0.66) {
tmp = x - (-6.0 * (z * (x - y)));
} else if (z <= 0.6) {
tmp = x + ((y - x) * 4.0);
} else {
tmp = z * ((y - x) * -6.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 <= (-0.66d0)) then
tmp = x - ((-6.0d0) * (z * (x - y)))
else if (z <= 0.6d0) then
tmp = x + ((y - x) * 4.0d0)
else
tmp = z * ((y - x) * (-6.0d0))
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (z <= -0.66) {
tmp = x - (-6.0 * (z * (x - y)));
} else if (z <= 0.6) {
tmp = x + ((y - x) * 4.0);
} else {
tmp = z * ((y - x) * -6.0);
}
return tmp;
}
def code(x, y, z): tmp = 0 if z <= -0.66: tmp = x - (-6.0 * (z * (x - y))) elif z <= 0.6: tmp = x + ((y - x) * 4.0) else: tmp = z * ((y - x) * -6.0) return tmp
function code(x, y, z) tmp = 0.0 if (z <= -0.66) tmp = Float64(x - Float64(-6.0 * Float64(z * Float64(x - y)))); elseif (z <= 0.6) tmp = Float64(x + Float64(Float64(y - x) * 4.0)); else tmp = Float64(z * Float64(Float64(y - x) * -6.0)); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (z <= -0.66) tmp = x - (-6.0 * (z * (x - y))); elseif (z <= 0.6) tmp = x + ((y - x) * 4.0); else tmp = z * ((y - x) * -6.0); end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[z, -0.66], N[(x - N[(-6.0 * N[(z * N[(x - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 0.6], N[(x + N[(N[(y - x), $MachinePrecision] * 4.0), $MachinePrecision]), $MachinePrecision], N[(z * N[(N[(y - x), $MachinePrecision] * -6.0), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -0.66:\\
\;\;\;\;x - -6 \cdot \left(z \cdot \left(x - y\right)\right)\\
\mathbf{elif}\;z \leq 0.6:\\
\;\;\;\;x + \left(y - x\right) \cdot 4\\
\mathbf{else}:\\
\;\;\;\;z \cdot \left(\left(y - x\right) \cdot -6\right)\\
\end{array}
\end{array}
if z < -0.660000000000000031Initial program 99.7%
metadata-eval99.7%
Simplified99.7%
Taylor expanded in z around inf 97.7%
if -0.660000000000000031 < z < 0.599999999999999978Initial program 98.9%
metadata-eval98.9%
Simplified98.9%
Taylor expanded in z around 0 98.5%
if 0.599999999999999978 < z Initial program 99.8%
metadata-eval99.8%
Simplified99.8%
flip-+32.2%
clear-num32.2%
associate-*l*32.0%
pow232.0%
pow232.0%
associate-*l*32.0%
Applied egg-rr32.0%
frac-2neg32.0%
distribute-frac-neg32.0%
distribute-neg-frac232.0%
/-rgt-identity32.0%
clear-num32.0%
distribute-neg-frac32.0%
metadata-eval32.0%
clear-num32.0%
Applied egg-rr99.6%
Taylor expanded in z around inf 96.8%
associate-*r*96.7%
*-commutative96.7%
associate-*l*96.9%
Simplified96.9%
Final simplification98.0%
(FPCore (x y z) :precision binary64 (/ 1.0 (/ -1.0 (- (* (- y x) (* 6.0 (- z 0.6666666666666666))) x))))
double code(double x, double y, double z) {
return 1.0 / (-1.0 / (((y - x) * (6.0 * (z - 0.6666666666666666))) - x));
}
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 / ((-1.0d0) / (((y - x) * (6.0d0 * (z - 0.6666666666666666d0))) - x))
end function
public static double code(double x, double y, double z) {
return 1.0 / (-1.0 / (((y - x) * (6.0 * (z - 0.6666666666666666))) - x));
}
def code(x, y, z): return 1.0 / (-1.0 / (((y - x) * (6.0 * (z - 0.6666666666666666))) - x))
function code(x, y, z) return Float64(1.0 / Float64(-1.0 / Float64(Float64(Float64(y - x) * Float64(6.0 * Float64(z - 0.6666666666666666))) - x))) end
function tmp = code(x, y, z) tmp = 1.0 / (-1.0 / (((y - x) * (6.0 * (z - 0.6666666666666666))) - x)); end
code[x_, y_, z_] := N[(1.0 / N[(-1.0 / N[(N[(N[(y - x), $MachinePrecision] * N[(6.0 * N[(z - 0.6666666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{1}{\frac{-1}{\left(y - x\right) \cdot \left(6 \cdot \left(z - 0.6666666666666666\right)\right) - x}}
\end{array}
Initial program 99.2%
metadata-eval99.2%
Simplified99.2%
flip-+47.6%
clear-num47.6%
associate-*l*47.5%
pow247.5%
pow247.5%
associate-*l*47.7%
Applied egg-rr47.7%
frac-2neg47.7%
distribute-frac-neg47.7%
distribute-neg-frac247.7%
/-rgt-identity47.7%
clear-num47.7%
distribute-neg-frac47.7%
metadata-eval47.7%
clear-num47.7%
Applied egg-rr99.6%
Final simplification99.6%
(FPCore (x y z) :precision binary64 (+ x (* (- z 0.6666666666666666) (* 6.0 (- x y)))))
double code(double x, double y, double z) {
return x + ((z - 0.6666666666666666) * (6.0 * (x - y)));
}
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 - 0.6666666666666666d0) * (6.0d0 * (x - y)))
end function
public static double code(double x, double y, double z) {
return x + ((z - 0.6666666666666666) * (6.0 * (x - y)));
}
def code(x, y, z): return x + ((z - 0.6666666666666666) * (6.0 * (x - y)))
function code(x, y, z) return Float64(x + Float64(Float64(z - 0.6666666666666666) * Float64(6.0 * Float64(x - y)))) end
function tmp = code(x, y, z) tmp = x + ((z - 0.6666666666666666) * (6.0 * (x - y))); end
code[x_, y_, z_] := N[(x + N[(N[(z - 0.6666666666666666), $MachinePrecision] * N[(6.0 * N[(x - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \left(z - 0.6666666666666666\right) \cdot \left(6 \cdot \left(x - y\right)\right)
\end{array}
Initial program 99.2%
metadata-eval99.2%
Simplified99.2%
Final simplification99.2%
(FPCore (x y z) :precision binary64 (* x -3.0))
double code(double x, double y, double z) {
return x * -3.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 * (-3.0d0)
end function
public static double code(double x, double y, double z) {
return x * -3.0;
}
def code(x, y, z): return x * -3.0
function code(x, y, z) return Float64(x * -3.0) end
function tmp = code(x, y, z) tmp = x * -3.0; end
code[x_, y_, z_] := N[(x * -3.0), $MachinePrecision]
\begin{array}{l}
\\
x \cdot -3
\end{array}
Initial program 99.2%
metadata-eval99.2%
Simplified99.2%
Taylor expanded in x around inf 50.1%
metadata-eval50.1%
cancel-sign-sub-inv50.1%
sub-neg50.1%
distribute-lft-in50.1%
metadata-eval50.1%
distribute-rgt-neg-in50.1%
distribute-lft-neg-in50.1%
metadata-eval50.1%
+-commutative50.1%
*-commutative50.1%
fma-undefine50.1%
unsub-neg50.1%
fma-undefine50.1%
*-commutative50.1%
+-commutative50.1%
mul-1-neg50.1%
distribute-rgt-in50.1%
metadata-eval50.1%
associate-+r+50.1%
metadata-eval50.1%
*-commutative50.1%
associate-*l*50.1%
metadata-eval50.1%
Simplified50.1%
Taylor expanded in z around 0 30.7%
*-commutative30.7%
Simplified30.7%
Final simplification30.7%
(FPCore (x y z) :precision binary64 x)
double code(double x, double y, double z) {
return x;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
code = x
end function
public static double code(double x, double y, double z) {
return x;
}
def code(x, y, z): return x
function code(x, y, z) return x end
function tmp = code(x, y, z) tmp = x; end
code[x_, y_, z_] := x
\begin{array}{l}
\\
x
\end{array}
Initial program 99.2%
metadata-eval99.2%
Simplified99.2%
Taylor expanded in y around inf 51.8%
Taylor expanded in x around inf 2.4%
Final simplification2.4%
herbie shell --seed 2024053
(FPCore (x y z)
:name "Data.Colour.RGBSpace.HSL:hsl from colour-2.3.3, D"
:precision binary64
(+ x (* (* (- y x) 6.0) (- (/ 2.0 3.0) z))))