
(FPCore (x y z) :precision binary64 (* x (- 1.0 (* (- 1.0 y) z))))
double code(double x, double y, double z) {
return x * (1.0 - ((1.0 - y) * 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 * (1.0d0 - ((1.0d0 - y) * z))
end function
public static double code(double x, double y, double z) {
return x * (1.0 - ((1.0 - y) * z));
}
def code(x, y, z): return x * (1.0 - ((1.0 - y) * z))
function code(x, y, z) return Float64(x * Float64(1.0 - Float64(Float64(1.0 - y) * z))) end
function tmp = code(x, y, z) tmp = x * (1.0 - ((1.0 - y) * z)); end
code[x_, y_, z_] := N[(x * N[(1.0 - N[(N[(1.0 - y), $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x \cdot \left(1 - \left(1 - y\right) \cdot z\right)
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 11 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z) :precision binary64 (* x (- 1.0 (* (- 1.0 y) z))))
double code(double x, double y, double z) {
return x * (1.0 - ((1.0 - y) * 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 * (1.0d0 - ((1.0d0 - y) * z))
end function
public static double code(double x, double y, double z) {
return x * (1.0 - ((1.0 - y) * z));
}
def code(x, y, z): return x * (1.0 - ((1.0 - y) * z))
function code(x, y, z) return Float64(x * Float64(1.0 - Float64(Float64(1.0 - y) * z))) end
function tmp = code(x, y, z) tmp = x * (1.0 - ((1.0 - y) * z)); end
code[x_, y_, z_] := N[(x * N[(1.0 - N[(N[(1.0 - y), $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x \cdot \left(1 - \left(1 - y\right) \cdot z\right)
\end{array}
x_m = (fabs.f64 x)
x_s = (copysign.f64 1 x)
(FPCore (x_s x_m y z)
:precision binary64
(*
x_s
(if (<= x_m 8e-10)
(+ x_m (* z (* x_m (+ -1.0 y))))
(+ x_m (* x_m (* z (+ -1.0 y)))))))x_m = fabs(x);
x_s = copysign(1.0, x);
double code(double x_s, double x_m, double y, double z) {
double tmp;
if (x_m <= 8e-10) {
tmp = x_m + (z * (x_m * (-1.0 + y)));
} else {
tmp = x_m + (x_m * (z * (-1.0 + y)));
}
return x_s * tmp;
}
x_m = abs(x)
x_s = copysign(1.0d0, x)
real(8) function code(x_s, x_m, y, z)
real(8), intent (in) :: x_s
real(8), intent (in) :: x_m
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: tmp
if (x_m <= 8d-10) then
tmp = x_m + (z * (x_m * ((-1.0d0) + y)))
else
tmp = x_m + (x_m * (z * ((-1.0d0) + y)))
end if
code = x_s * tmp
end function
x_m = Math.abs(x);
x_s = Math.copySign(1.0, x);
public static double code(double x_s, double x_m, double y, double z) {
double tmp;
if (x_m <= 8e-10) {
tmp = x_m + (z * (x_m * (-1.0 + y)));
} else {
tmp = x_m + (x_m * (z * (-1.0 + y)));
}
return x_s * tmp;
}
x_m = math.fabs(x) x_s = math.copysign(1.0, x) def code(x_s, x_m, y, z): tmp = 0 if x_m <= 8e-10: tmp = x_m + (z * (x_m * (-1.0 + y))) else: tmp = x_m + (x_m * (z * (-1.0 + y))) return x_s * tmp
x_m = abs(x) x_s = copysign(1.0, x) function code(x_s, x_m, y, z) tmp = 0.0 if (x_m <= 8e-10) tmp = Float64(x_m + Float64(z * Float64(x_m * Float64(-1.0 + y)))); else tmp = Float64(x_m + Float64(x_m * Float64(z * Float64(-1.0 + y)))); end return Float64(x_s * tmp) end
x_m = abs(x); x_s = sign(x) * abs(1.0); function tmp_2 = code(x_s, x_m, y, z) tmp = 0.0; if (x_m <= 8e-10) tmp = x_m + (z * (x_m * (-1.0 + y))); else tmp = x_m + (x_m * (z * (-1.0 + y))); end tmp_2 = x_s * tmp; end
x_m = N[Abs[x], $MachinePrecision]
x_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[x]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[x$95$s_, x$95$m_, y_, z_] := N[(x$95$s * If[LessEqual[x$95$m, 8e-10], N[(x$95$m + N[(z * N[(x$95$m * N[(-1.0 + y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x$95$m + N[(x$95$m * N[(z * N[(-1.0 + y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
x_m = \left|x\right|
\\
x_s = \mathsf{copysign}\left(1, x\right)
\\
x\_s \cdot \begin{array}{l}
\mathbf{if}\;x\_m \leq 8 \cdot 10^{-10}:\\
\;\;\;\;x\_m + z \cdot \left(x\_m \cdot \left(-1 + y\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x\_m + x\_m \cdot \left(z \cdot \left(-1 + y\right)\right)\\
\end{array}
\end{array}
if x < 8.00000000000000029e-10Initial program 92.6%
Taylor expanded in z around 0 92.6%
Taylor expanded in y around 0 91.0%
neg-mul-191.0%
distribute-lft-neg-in91.0%
mul-1-neg91.0%
associate-*r*94.9%
distribute-rgt-out96.4%
*-commutative96.4%
distribute-lft-in96.4%
Simplified96.4%
if 8.00000000000000029e-10 < x Initial program 100.0%
Taylor expanded in z around 0 100.0%
Final simplification97.3%
x_m = (fabs.f64 x)
x_s = (copysign.f64 1 x)
(FPCore (x_s x_m y z)
:precision binary64
(let* ((t_0 (* x_m (* z y))) (t_1 (* x_m (- z))))
(*
x_s
(if (<= z -1.65e+16)
t_1
(if (<= z -1.15e-62)
t_0
(if (<= z 1.25e-120)
x_m
(if (or (<= z 1.25e+136) (and (not (<= z 3.5e+259)) (<= z 3.2e+296)))
t_0
t_1)))))))x_m = fabs(x);
x_s = copysign(1.0, x);
double code(double x_s, double x_m, double y, double z) {
double t_0 = x_m * (z * y);
double t_1 = x_m * -z;
double tmp;
if (z <= -1.65e+16) {
tmp = t_1;
} else if (z <= -1.15e-62) {
tmp = t_0;
} else if (z <= 1.25e-120) {
tmp = x_m;
} else if ((z <= 1.25e+136) || (!(z <= 3.5e+259) && (z <= 3.2e+296))) {
tmp = t_0;
} else {
tmp = t_1;
}
return x_s * tmp;
}
x_m = abs(x)
x_s = copysign(1.0d0, x)
real(8) function code(x_s, x_m, y, z)
real(8), intent (in) :: x_s
real(8), intent (in) :: x_m
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: t_0
real(8) :: t_1
real(8) :: tmp
t_0 = x_m * (z * y)
t_1 = x_m * -z
if (z <= (-1.65d+16)) then
tmp = t_1
else if (z <= (-1.15d-62)) then
tmp = t_0
else if (z <= 1.25d-120) then
tmp = x_m
else if ((z <= 1.25d+136) .or. (.not. (z <= 3.5d+259)) .and. (z <= 3.2d+296)) then
tmp = t_0
else
tmp = t_1
end if
code = x_s * tmp
end function
x_m = Math.abs(x);
x_s = Math.copySign(1.0, x);
public static double code(double x_s, double x_m, double y, double z) {
double t_0 = x_m * (z * y);
double t_1 = x_m * -z;
double tmp;
if (z <= -1.65e+16) {
tmp = t_1;
} else if (z <= -1.15e-62) {
tmp = t_0;
} else if (z <= 1.25e-120) {
tmp = x_m;
} else if ((z <= 1.25e+136) || (!(z <= 3.5e+259) && (z <= 3.2e+296))) {
tmp = t_0;
} else {
tmp = t_1;
}
return x_s * tmp;
}
x_m = math.fabs(x) x_s = math.copysign(1.0, x) def code(x_s, x_m, y, z): t_0 = x_m * (z * y) t_1 = x_m * -z tmp = 0 if z <= -1.65e+16: tmp = t_1 elif z <= -1.15e-62: tmp = t_0 elif z <= 1.25e-120: tmp = x_m elif (z <= 1.25e+136) or (not (z <= 3.5e+259) and (z <= 3.2e+296)): tmp = t_0 else: tmp = t_1 return x_s * tmp
x_m = abs(x) x_s = copysign(1.0, x) function code(x_s, x_m, y, z) t_0 = Float64(x_m * Float64(z * y)) t_1 = Float64(x_m * Float64(-z)) tmp = 0.0 if (z <= -1.65e+16) tmp = t_1; elseif (z <= -1.15e-62) tmp = t_0; elseif (z <= 1.25e-120) tmp = x_m; elseif ((z <= 1.25e+136) || (!(z <= 3.5e+259) && (z <= 3.2e+296))) tmp = t_0; else tmp = t_1; end return Float64(x_s * tmp) end
x_m = abs(x); x_s = sign(x) * abs(1.0); function tmp_2 = code(x_s, x_m, y, z) t_0 = x_m * (z * y); t_1 = x_m * -z; tmp = 0.0; if (z <= -1.65e+16) tmp = t_1; elseif (z <= -1.15e-62) tmp = t_0; elseif (z <= 1.25e-120) tmp = x_m; elseif ((z <= 1.25e+136) || (~((z <= 3.5e+259)) && (z <= 3.2e+296))) tmp = t_0; else tmp = t_1; end tmp_2 = x_s * tmp; end
x_m = N[Abs[x], $MachinePrecision]
x_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[x]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[x$95$s_, x$95$m_, y_, z_] := Block[{t$95$0 = N[(x$95$m * N[(z * y), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(x$95$m * (-z)), $MachinePrecision]}, N[(x$95$s * If[LessEqual[z, -1.65e+16], t$95$1, If[LessEqual[z, -1.15e-62], t$95$0, If[LessEqual[z, 1.25e-120], x$95$m, If[Or[LessEqual[z, 1.25e+136], And[N[Not[LessEqual[z, 3.5e+259]], $MachinePrecision], LessEqual[z, 3.2e+296]]], t$95$0, t$95$1]]]]), $MachinePrecision]]]
\begin{array}{l}
x_m = \left|x\right|
\\
x_s = \mathsf{copysign}\left(1, x\right)
\\
\begin{array}{l}
t_0 := x\_m \cdot \left(z \cdot y\right)\\
t_1 := x\_m \cdot \left(-z\right)\\
x\_s \cdot \begin{array}{l}
\mathbf{if}\;z \leq -1.65 \cdot 10^{+16}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq -1.15 \cdot 10^{-62}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;z \leq 1.25 \cdot 10^{-120}:\\
\;\;\;\;x\_m\\
\mathbf{elif}\;z \leq 1.25 \cdot 10^{+136} \lor \neg \left(z \leq 3.5 \cdot 10^{+259}\right) \land z \leq 3.2 \cdot 10^{+296}:\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
\end{array}
if z < -1.65e16 or 1.25e136 < z < 3.4999999999999998e259 or 3.1999999999999999e296 < z Initial program 87.8%
Taylor expanded in z around inf 87.8%
*-commutative87.8%
associate-*l*99.9%
sub-neg99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in y around 0 62.6%
associate-*r*62.6%
mul-1-neg62.6%
Simplified62.6%
if -1.65e16 < z < -1.15e-62 or 1.25000000000000002e-120 < z < 1.25e136 or 3.4999999999999998e259 < z < 3.1999999999999999e296Initial program 93.8%
Taylor expanded in y around inf 65.2%
*-commutative65.2%
Simplified65.2%
if -1.15e-62 < z < 1.25000000000000002e-120Initial program 99.9%
Taylor expanded in z around 0 83.8%
Final simplification71.8%
x_m = (fabs.f64 x) x_s = (copysign.f64 1 x) (FPCore (x_s x_m y z) :precision binary64 (* x_s (if (or (<= z -2e-62) (not (<= z 5.5e-100))) (* z (* x_m (+ -1.0 y))) x_m)))
x_m = fabs(x);
x_s = copysign(1.0, x);
double code(double x_s, double x_m, double y, double z) {
double tmp;
if ((z <= -2e-62) || !(z <= 5.5e-100)) {
tmp = z * (x_m * (-1.0 + y));
} else {
tmp = x_m;
}
return x_s * tmp;
}
x_m = abs(x)
x_s = copysign(1.0d0, x)
real(8) function code(x_s, x_m, y, z)
real(8), intent (in) :: x_s
real(8), intent (in) :: x_m
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: tmp
if ((z <= (-2d-62)) .or. (.not. (z <= 5.5d-100))) then
tmp = z * (x_m * ((-1.0d0) + y))
else
tmp = x_m
end if
code = x_s * tmp
end function
x_m = Math.abs(x);
x_s = Math.copySign(1.0, x);
public static double code(double x_s, double x_m, double y, double z) {
double tmp;
if ((z <= -2e-62) || !(z <= 5.5e-100)) {
tmp = z * (x_m * (-1.0 + y));
} else {
tmp = x_m;
}
return x_s * tmp;
}
x_m = math.fabs(x) x_s = math.copysign(1.0, x) def code(x_s, x_m, y, z): tmp = 0 if (z <= -2e-62) or not (z <= 5.5e-100): tmp = z * (x_m * (-1.0 + y)) else: tmp = x_m return x_s * tmp
x_m = abs(x) x_s = copysign(1.0, x) function code(x_s, x_m, y, z) tmp = 0.0 if ((z <= -2e-62) || !(z <= 5.5e-100)) tmp = Float64(z * Float64(x_m * Float64(-1.0 + y))); else tmp = x_m; end return Float64(x_s * tmp) end
x_m = abs(x); x_s = sign(x) * abs(1.0); function tmp_2 = code(x_s, x_m, y, z) tmp = 0.0; if ((z <= -2e-62) || ~((z <= 5.5e-100))) tmp = z * (x_m * (-1.0 + y)); else tmp = x_m; end tmp_2 = x_s * tmp; end
x_m = N[Abs[x], $MachinePrecision]
x_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[x]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[x$95$s_, x$95$m_, y_, z_] := N[(x$95$s * If[Or[LessEqual[z, -2e-62], N[Not[LessEqual[z, 5.5e-100]], $MachinePrecision]], N[(z * N[(x$95$m * N[(-1.0 + y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], x$95$m]), $MachinePrecision]
\begin{array}{l}
x_m = \left|x\right|
\\
x_s = \mathsf{copysign}\left(1, x\right)
\\
x\_s \cdot \begin{array}{l}
\mathbf{if}\;z \leq -2 \cdot 10^{-62} \lor \neg \left(z \leq 5.5 \cdot 10^{-100}\right):\\
\;\;\;\;z \cdot \left(x\_m \cdot \left(-1 + y\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x\_m\\
\end{array}
\end{array}
if z < -2.0000000000000001e-62 or 5.50000000000000011e-100 < z Initial program 90.5%
Taylor expanded in z around inf 84.0%
*-commutative84.0%
associate-*l*93.4%
sub-neg93.4%
metadata-eval93.4%
Simplified93.4%
if -2.0000000000000001e-62 < z < 5.50000000000000011e-100Initial program 99.9%
Taylor expanded in z around 0 82.0%
Final simplification88.6%
x_m = (fabs.f64 x)
x_s = (copysign.f64 1 x)
(FPCore (x_s x_m y z)
:precision binary64
(*
x_s
(if (or (<= z -1.0) (not (<= z 1.0)))
(* z (* x_m (+ -1.0 y)))
(+ x_m (* z (* x_m y))))))x_m = fabs(x);
x_s = copysign(1.0, x);
double code(double x_s, double x_m, double y, double z) {
double tmp;
if ((z <= -1.0) || !(z <= 1.0)) {
tmp = z * (x_m * (-1.0 + y));
} else {
tmp = x_m + (z * (x_m * y));
}
return x_s * tmp;
}
x_m = abs(x)
x_s = copysign(1.0d0, x)
real(8) function code(x_s, x_m, y, z)
real(8), intent (in) :: x_s
real(8), intent (in) :: x_m
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: tmp
if ((z <= (-1.0d0)) .or. (.not. (z <= 1.0d0))) then
tmp = z * (x_m * ((-1.0d0) + y))
else
tmp = x_m + (z * (x_m * y))
end if
code = x_s * tmp
end function
x_m = Math.abs(x);
x_s = Math.copySign(1.0, x);
public static double code(double x_s, double x_m, double y, double z) {
double tmp;
if ((z <= -1.0) || !(z <= 1.0)) {
tmp = z * (x_m * (-1.0 + y));
} else {
tmp = x_m + (z * (x_m * y));
}
return x_s * tmp;
}
x_m = math.fabs(x) x_s = math.copysign(1.0, x) def code(x_s, x_m, y, z): tmp = 0 if (z <= -1.0) or not (z <= 1.0): tmp = z * (x_m * (-1.0 + y)) else: tmp = x_m + (z * (x_m * y)) return x_s * tmp
x_m = abs(x) x_s = copysign(1.0, x) function code(x_s, x_m, y, z) tmp = 0.0 if ((z <= -1.0) || !(z <= 1.0)) tmp = Float64(z * Float64(x_m * Float64(-1.0 + y))); else tmp = Float64(x_m + Float64(z * Float64(x_m * y))); end return Float64(x_s * tmp) end
x_m = abs(x); x_s = sign(x) * abs(1.0); function tmp_2 = code(x_s, x_m, y, z) tmp = 0.0; if ((z <= -1.0) || ~((z <= 1.0))) tmp = z * (x_m * (-1.0 + y)); else tmp = x_m + (z * (x_m * y)); end tmp_2 = x_s * tmp; end
x_m = N[Abs[x], $MachinePrecision]
x_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[x]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[x$95$s_, x$95$m_, y_, z_] := N[(x$95$s * If[Or[LessEqual[z, -1.0], N[Not[LessEqual[z, 1.0]], $MachinePrecision]], N[(z * N[(x$95$m * N[(-1.0 + y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x$95$m + N[(z * N[(x$95$m * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
x_m = \left|x\right|
\\
x_s = \mathsf{copysign}\left(1, x\right)
\\
x\_s \cdot \begin{array}{l}
\mathbf{if}\;z \leq -1 \lor \neg \left(z \leq 1\right):\\
\;\;\;\;z \cdot \left(x\_m \cdot \left(-1 + y\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x\_m + z \cdot \left(x\_m \cdot y\right)\\
\end{array}
\end{array}
if z < -1 or 1 < z Initial program 88.5%
Taylor expanded in z around inf 87.5%
*-commutative87.5%
associate-*l*98.9%
sub-neg98.9%
metadata-eval98.9%
Simplified98.9%
if -1 < z < 1Initial program 99.9%
Taylor expanded in z around 0 99.9%
Taylor expanded in y around 0 99.9%
neg-mul-199.9%
distribute-lft-neg-in99.9%
mul-1-neg99.9%
associate-*r*91.4%
distribute-rgt-out91.4%
*-commutative91.4%
distribute-lft-in91.4%
Simplified91.4%
Taylor expanded in y around inf 90.4%
Final simplification94.5%
x_m = (fabs.f64 x)
x_s = (copysign.f64 1 x)
(FPCore (x_s x_m y z)
:precision binary64
(*
x_s
(if (or (<= z -1.0) (not (<= z 1.0)))
(* z (* x_m (+ -1.0 y)))
(+ x_m (* x_m (* z y))))))x_m = fabs(x);
x_s = copysign(1.0, x);
double code(double x_s, double x_m, double y, double z) {
double tmp;
if ((z <= -1.0) || !(z <= 1.0)) {
tmp = z * (x_m * (-1.0 + y));
} else {
tmp = x_m + (x_m * (z * y));
}
return x_s * tmp;
}
x_m = abs(x)
x_s = copysign(1.0d0, x)
real(8) function code(x_s, x_m, y, z)
real(8), intent (in) :: x_s
real(8), intent (in) :: x_m
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: tmp
if ((z <= (-1.0d0)) .or. (.not. (z <= 1.0d0))) then
tmp = z * (x_m * ((-1.0d0) + y))
else
tmp = x_m + (x_m * (z * y))
end if
code = x_s * tmp
end function
x_m = Math.abs(x);
x_s = Math.copySign(1.0, x);
public static double code(double x_s, double x_m, double y, double z) {
double tmp;
if ((z <= -1.0) || !(z <= 1.0)) {
tmp = z * (x_m * (-1.0 + y));
} else {
tmp = x_m + (x_m * (z * y));
}
return x_s * tmp;
}
x_m = math.fabs(x) x_s = math.copysign(1.0, x) def code(x_s, x_m, y, z): tmp = 0 if (z <= -1.0) or not (z <= 1.0): tmp = z * (x_m * (-1.0 + y)) else: tmp = x_m + (x_m * (z * y)) return x_s * tmp
x_m = abs(x) x_s = copysign(1.0, x) function code(x_s, x_m, y, z) tmp = 0.0 if ((z <= -1.0) || !(z <= 1.0)) tmp = Float64(z * Float64(x_m * Float64(-1.0 + y))); else tmp = Float64(x_m + Float64(x_m * Float64(z * y))); end return Float64(x_s * tmp) end
x_m = abs(x); x_s = sign(x) * abs(1.0); function tmp_2 = code(x_s, x_m, y, z) tmp = 0.0; if ((z <= -1.0) || ~((z <= 1.0))) tmp = z * (x_m * (-1.0 + y)); else tmp = x_m + (x_m * (z * y)); end tmp_2 = x_s * tmp; end
x_m = N[Abs[x], $MachinePrecision]
x_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[x]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[x$95$s_, x$95$m_, y_, z_] := N[(x$95$s * If[Or[LessEqual[z, -1.0], N[Not[LessEqual[z, 1.0]], $MachinePrecision]], N[(z * N[(x$95$m * N[(-1.0 + y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x$95$m + N[(x$95$m * N[(z * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
x_m = \left|x\right|
\\
x_s = \mathsf{copysign}\left(1, x\right)
\\
x\_s \cdot \begin{array}{l}
\mathbf{if}\;z \leq -1 \lor \neg \left(z \leq 1\right):\\
\;\;\;\;z \cdot \left(x\_m \cdot \left(-1 + y\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x\_m + x\_m \cdot \left(z \cdot y\right)\\
\end{array}
\end{array}
if z < -1 or 1 < z Initial program 88.5%
Taylor expanded in z around inf 87.5%
*-commutative87.5%
associate-*l*98.9%
sub-neg98.9%
metadata-eval98.9%
Simplified98.9%
if -1 < z < 1Initial program 99.9%
Taylor expanded in y around inf 98.9%
mul-1-neg98.9%
distribute-lft-neg-out98.9%
*-commutative98.9%
Simplified98.9%
*-commutative98.9%
cancel-sign-sub98.9%
*-commutative98.9%
distribute-rgt-in98.9%
*-un-lft-identity98.9%
Applied egg-rr98.9%
Final simplification98.9%
x_m = (fabs.f64 x)
x_s = (copysign.f64 1 x)
(FPCore (x_s x_m y z)
:precision binary64
(*
x_s
(if (or (<= y -1.9e+91) (not (<= y 4.3e+111)))
(* x_m (* z y))
(* x_m (- 1.0 z)))))x_m = fabs(x);
x_s = copysign(1.0, x);
double code(double x_s, double x_m, double y, double z) {
double tmp;
if ((y <= -1.9e+91) || !(y <= 4.3e+111)) {
tmp = x_m * (z * y);
} else {
tmp = x_m * (1.0 - z);
}
return x_s * tmp;
}
x_m = abs(x)
x_s = copysign(1.0d0, x)
real(8) function code(x_s, x_m, y, z)
real(8), intent (in) :: x_s
real(8), intent (in) :: x_m
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: tmp
if ((y <= (-1.9d+91)) .or. (.not. (y <= 4.3d+111))) then
tmp = x_m * (z * y)
else
tmp = x_m * (1.0d0 - z)
end if
code = x_s * tmp
end function
x_m = Math.abs(x);
x_s = Math.copySign(1.0, x);
public static double code(double x_s, double x_m, double y, double z) {
double tmp;
if ((y <= -1.9e+91) || !(y <= 4.3e+111)) {
tmp = x_m * (z * y);
} else {
tmp = x_m * (1.0 - z);
}
return x_s * tmp;
}
x_m = math.fabs(x) x_s = math.copysign(1.0, x) def code(x_s, x_m, y, z): tmp = 0 if (y <= -1.9e+91) or not (y <= 4.3e+111): tmp = x_m * (z * y) else: tmp = x_m * (1.0 - z) return x_s * tmp
x_m = abs(x) x_s = copysign(1.0, x) function code(x_s, x_m, y, z) tmp = 0.0 if ((y <= -1.9e+91) || !(y <= 4.3e+111)) tmp = Float64(x_m * Float64(z * y)); else tmp = Float64(x_m * Float64(1.0 - z)); end return Float64(x_s * tmp) end
x_m = abs(x); x_s = sign(x) * abs(1.0); function tmp_2 = code(x_s, x_m, y, z) tmp = 0.0; if ((y <= -1.9e+91) || ~((y <= 4.3e+111))) tmp = x_m * (z * y); else tmp = x_m * (1.0 - z); end tmp_2 = x_s * tmp; end
x_m = N[Abs[x], $MachinePrecision]
x_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[x]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[x$95$s_, x$95$m_, y_, z_] := N[(x$95$s * If[Or[LessEqual[y, -1.9e+91], N[Not[LessEqual[y, 4.3e+111]], $MachinePrecision]], N[(x$95$m * N[(z * y), $MachinePrecision]), $MachinePrecision], N[(x$95$m * N[(1.0 - z), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
x_m = \left|x\right|
\\
x_s = \mathsf{copysign}\left(1, x\right)
\\
x\_s \cdot \begin{array}{l}
\mathbf{if}\;y \leq -1.9 \cdot 10^{+91} \lor \neg \left(y \leq 4.3 \cdot 10^{+111}\right):\\
\;\;\;\;x\_m \cdot \left(z \cdot y\right)\\
\mathbf{else}:\\
\;\;\;\;x\_m \cdot \left(1 - z\right)\\
\end{array}
\end{array}
if y < -1.8999999999999999e91 or 4.29999999999999993e111 < y Initial program 87.8%
Taylor expanded in y around inf 74.1%
*-commutative74.1%
Simplified74.1%
if -1.8999999999999999e91 < y < 4.29999999999999993e111Initial program 98.2%
Taylor expanded in y around 0 87.3%
Final simplification82.5%
x_m = (fabs.f64 x)
x_s = (copysign.f64 1 x)
(FPCore (x_s x_m y z)
:precision binary64
(*
x_s
(if (or (<= y -1.45e+91) (not (<= y 4.8e+36)))
(* z (* x_m y))
(* x_m (- 1.0 z)))))x_m = fabs(x);
x_s = copysign(1.0, x);
double code(double x_s, double x_m, double y, double z) {
double tmp;
if ((y <= -1.45e+91) || !(y <= 4.8e+36)) {
tmp = z * (x_m * y);
} else {
tmp = x_m * (1.0 - z);
}
return x_s * tmp;
}
x_m = abs(x)
x_s = copysign(1.0d0, x)
real(8) function code(x_s, x_m, y, z)
real(8), intent (in) :: x_s
real(8), intent (in) :: x_m
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: tmp
if ((y <= (-1.45d+91)) .or. (.not. (y <= 4.8d+36))) then
tmp = z * (x_m * y)
else
tmp = x_m * (1.0d0 - z)
end if
code = x_s * tmp
end function
x_m = Math.abs(x);
x_s = Math.copySign(1.0, x);
public static double code(double x_s, double x_m, double y, double z) {
double tmp;
if ((y <= -1.45e+91) || !(y <= 4.8e+36)) {
tmp = z * (x_m * y);
} else {
tmp = x_m * (1.0 - z);
}
return x_s * tmp;
}
x_m = math.fabs(x) x_s = math.copysign(1.0, x) def code(x_s, x_m, y, z): tmp = 0 if (y <= -1.45e+91) or not (y <= 4.8e+36): tmp = z * (x_m * y) else: tmp = x_m * (1.0 - z) return x_s * tmp
x_m = abs(x) x_s = copysign(1.0, x) function code(x_s, x_m, y, z) tmp = 0.0 if ((y <= -1.45e+91) || !(y <= 4.8e+36)) tmp = Float64(z * Float64(x_m * y)); else tmp = Float64(x_m * Float64(1.0 - z)); end return Float64(x_s * tmp) end
x_m = abs(x); x_s = sign(x) * abs(1.0); function tmp_2 = code(x_s, x_m, y, z) tmp = 0.0; if ((y <= -1.45e+91) || ~((y <= 4.8e+36))) tmp = z * (x_m * y); else tmp = x_m * (1.0 - z); end tmp_2 = x_s * tmp; end
x_m = N[Abs[x], $MachinePrecision]
x_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[x]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[x$95$s_, x$95$m_, y_, z_] := N[(x$95$s * If[Or[LessEqual[y, -1.45e+91], N[Not[LessEqual[y, 4.8e+36]], $MachinePrecision]], N[(z * N[(x$95$m * y), $MachinePrecision]), $MachinePrecision], N[(x$95$m * N[(1.0 - z), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
x_m = \left|x\right|
\\
x_s = \mathsf{copysign}\left(1, x\right)
\\
x\_s \cdot \begin{array}{l}
\mathbf{if}\;y \leq -1.45 \cdot 10^{+91} \lor \neg \left(y \leq 4.8 \cdot 10^{+36}\right):\\
\;\;\;\;z \cdot \left(x\_m \cdot y\right)\\
\mathbf{else}:\\
\;\;\;\;x\_m \cdot \left(1 - z\right)\\
\end{array}
\end{array}
if y < -1.45000000000000007e91 or 4.79999999999999985e36 < y Initial program 87.5%
Taylor expanded in z around inf 68.5%
*-commutative68.5%
associate-*l*76.1%
sub-neg76.1%
metadata-eval76.1%
Simplified76.1%
Taylor expanded in y around inf 76.1%
if -1.45000000000000007e91 < y < 4.79999999999999985e36Initial program 100.0%
Taylor expanded in y around 0 93.2%
Final simplification85.6%
x_m = (fabs.f64 x) x_s = (copysign.f64 1 x) (FPCore (x_s x_m y z) :precision binary64 (* x_s (if (or (<= z -1.0) (not (<= z 1.0))) (* x_m (- z)) x_m)))
x_m = fabs(x);
x_s = copysign(1.0, x);
double code(double x_s, double x_m, double y, double z) {
double tmp;
if ((z <= -1.0) || !(z <= 1.0)) {
tmp = x_m * -z;
} else {
tmp = x_m;
}
return x_s * tmp;
}
x_m = abs(x)
x_s = copysign(1.0d0, x)
real(8) function code(x_s, x_m, y, z)
real(8), intent (in) :: x_s
real(8), intent (in) :: x_m
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: tmp
if ((z <= (-1.0d0)) .or. (.not. (z <= 1.0d0))) then
tmp = x_m * -z
else
tmp = x_m
end if
code = x_s * tmp
end function
x_m = Math.abs(x);
x_s = Math.copySign(1.0, x);
public static double code(double x_s, double x_m, double y, double z) {
double tmp;
if ((z <= -1.0) || !(z <= 1.0)) {
tmp = x_m * -z;
} else {
tmp = x_m;
}
return x_s * tmp;
}
x_m = math.fabs(x) x_s = math.copysign(1.0, x) def code(x_s, x_m, y, z): tmp = 0 if (z <= -1.0) or not (z <= 1.0): tmp = x_m * -z else: tmp = x_m return x_s * tmp
x_m = abs(x) x_s = copysign(1.0, x) function code(x_s, x_m, y, z) tmp = 0.0 if ((z <= -1.0) || !(z <= 1.0)) tmp = Float64(x_m * Float64(-z)); else tmp = x_m; end return Float64(x_s * tmp) end
x_m = abs(x); x_s = sign(x) * abs(1.0); function tmp_2 = code(x_s, x_m, y, z) tmp = 0.0; if ((z <= -1.0) || ~((z <= 1.0))) tmp = x_m * -z; else tmp = x_m; end tmp_2 = x_s * tmp; end
x_m = N[Abs[x], $MachinePrecision]
x_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[x]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[x$95$s_, x$95$m_, y_, z_] := N[(x$95$s * If[Or[LessEqual[z, -1.0], N[Not[LessEqual[z, 1.0]], $MachinePrecision]], N[(x$95$m * (-z)), $MachinePrecision], x$95$m]), $MachinePrecision]
\begin{array}{l}
x_m = \left|x\right|
\\
x_s = \mathsf{copysign}\left(1, x\right)
\\
x\_s \cdot \begin{array}{l}
\mathbf{if}\;z \leq -1 \lor \neg \left(z \leq 1\right):\\
\;\;\;\;x\_m \cdot \left(-z\right)\\
\mathbf{else}:\\
\;\;\;\;x\_m\\
\end{array}
\end{array}
if z < -1 or 1 < z Initial program 88.5%
Taylor expanded in z around inf 87.5%
*-commutative87.5%
associate-*l*98.9%
sub-neg98.9%
metadata-eval98.9%
Simplified98.9%
Taylor expanded in y around 0 52.6%
associate-*r*52.6%
mul-1-neg52.6%
Simplified52.6%
if -1 < z < 1Initial program 99.9%
Taylor expanded in z around 0 72.4%
Final simplification62.9%
x_m = (fabs.f64 x)
x_s = (copysign.f64 1 x)
(FPCore (x_s x_m y z)
:precision binary64
(*
x_s
(if (<= z 2500000000000.0)
(* x_m (+ 1.0 (* z (+ -1.0 y))))
(* z (* x_m (+ -1.0 y))))))x_m = fabs(x);
x_s = copysign(1.0, x);
double code(double x_s, double x_m, double y, double z) {
double tmp;
if (z <= 2500000000000.0) {
tmp = x_m * (1.0 + (z * (-1.0 + y)));
} else {
tmp = z * (x_m * (-1.0 + y));
}
return x_s * tmp;
}
x_m = abs(x)
x_s = copysign(1.0d0, x)
real(8) function code(x_s, x_m, y, z)
real(8), intent (in) :: x_s
real(8), intent (in) :: x_m
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: tmp
if (z <= 2500000000000.0d0) then
tmp = x_m * (1.0d0 + (z * ((-1.0d0) + y)))
else
tmp = z * (x_m * ((-1.0d0) + y))
end if
code = x_s * tmp
end function
x_m = Math.abs(x);
x_s = Math.copySign(1.0, x);
public static double code(double x_s, double x_m, double y, double z) {
double tmp;
if (z <= 2500000000000.0) {
tmp = x_m * (1.0 + (z * (-1.0 + y)));
} else {
tmp = z * (x_m * (-1.0 + y));
}
return x_s * tmp;
}
x_m = math.fabs(x) x_s = math.copysign(1.0, x) def code(x_s, x_m, y, z): tmp = 0 if z <= 2500000000000.0: tmp = x_m * (1.0 + (z * (-1.0 + y))) else: tmp = z * (x_m * (-1.0 + y)) return x_s * tmp
x_m = abs(x) x_s = copysign(1.0, x) function code(x_s, x_m, y, z) tmp = 0.0 if (z <= 2500000000000.0) tmp = Float64(x_m * Float64(1.0 + Float64(z * Float64(-1.0 + y)))); else tmp = Float64(z * Float64(x_m * Float64(-1.0 + y))); end return Float64(x_s * tmp) end
x_m = abs(x); x_s = sign(x) * abs(1.0); function tmp_2 = code(x_s, x_m, y, z) tmp = 0.0; if (z <= 2500000000000.0) tmp = x_m * (1.0 + (z * (-1.0 + y))); else tmp = z * (x_m * (-1.0 + y)); end tmp_2 = x_s * tmp; end
x_m = N[Abs[x], $MachinePrecision]
x_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[x]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[x$95$s_, x$95$m_, y_, z_] := N[(x$95$s * If[LessEqual[z, 2500000000000.0], N[(x$95$m * N[(1.0 + N[(z * N[(-1.0 + y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(z * N[(x$95$m * N[(-1.0 + y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
x_m = \left|x\right|
\\
x_s = \mathsf{copysign}\left(1, x\right)
\\
x\_s \cdot \begin{array}{l}
\mathbf{if}\;z \leq 2500000000000:\\
\;\;\;\;x\_m \cdot \left(1 + z \cdot \left(-1 + y\right)\right)\\
\mathbf{else}:\\
\;\;\;\;z \cdot \left(x\_m \cdot \left(-1 + y\right)\right)\\
\end{array}
\end{array}
if z < 2.5e12Initial program 97.8%
if 2.5e12 < z Initial program 85.9%
Taylor expanded in z around inf 85.9%
*-commutative85.9%
associate-*l*99.9%
sub-neg99.9%
metadata-eval99.9%
Simplified99.9%
Final simplification98.4%
x_m = (fabs.f64 x)
x_s = (copysign.f64 1 x)
(FPCore (x_s x_m y z)
:precision binary64
(*
x_s
(if (<= z 2500000000000.0)
(+ x_m (* x_m (* z (+ -1.0 y))))
(* z (* x_m (+ -1.0 y))))))x_m = fabs(x);
x_s = copysign(1.0, x);
double code(double x_s, double x_m, double y, double z) {
double tmp;
if (z <= 2500000000000.0) {
tmp = x_m + (x_m * (z * (-1.0 + y)));
} else {
tmp = z * (x_m * (-1.0 + y));
}
return x_s * tmp;
}
x_m = abs(x)
x_s = copysign(1.0d0, x)
real(8) function code(x_s, x_m, y, z)
real(8), intent (in) :: x_s
real(8), intent (in) :: x_m
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: tmp
if (z <= 2500000000000.0d0) then
tmp = x_m + (x_m * (z * ((-1.0d0) + y)))
else
tmp = z * (x_m * ((-1.0d0) + y))
end if
code = x_s * tmp
end function
x_m = Math.abs(x);
x_s = Math.copySign(1.0, x);
public static double code(double x_s, double x_m, double y, double z) {
double tmp;
if (z <= 2500000000000.0) {
tmp = x_m + (x_m * (z * (-1.0 + y)));
} else {
tmp = z * (x_m * (-1.0 + y));
}
return x_s * tmp;
}
x_m = math.fabs(x) x_s = math.copysign(1.0, x) def code(x_s, x_m, y, z): tmp = 0 if z <= 2500000000000.0: tmp = x_m + (x_m * (z * (-1.0 + y))) else: tmp = z * (x_m * (-1.0 + y)) return x_s * tmp
x_m = abs(x) x_s = copysign(1.0, x) function code(x_s, x_m, y, z) tmp = 0.0 if (z <= 2500000000000.0) tmp = Float64(x_m + Float64(x_m * Float64(z * Float64(-1.0 + y)))); else tmp = Float64(z * Float64(x_m * Float64(-1.0 + y))); end return Float64(x_s * tmp) end
x_m = abs(x); x_s = sign(x) * abs(1.0); function tmp_2 = code(x_s, x_m, y, z) tmp = 0.0; if (z <= 2500000000000.0) tmp = x_m + (x_m * (z * (-1.0 + y))); else tmp = z * (x_m * (-1.0 + y)); end tmp_2 = x_s * tmp; end
x_m = N[Abs[x], $MachinePrecision]
x_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[x]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[x$95$s_, x$95$m_, y_, z_] := N[(x$95$s * If[LessEqual[z, 2500000000000.0], N[(x$95$m + N[(x$95$m * N[(z * N[(-1.0 + y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(z * N[(x$95$m * N[(-1.0 + y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
x_m = \left|x\right|
\\
x_s = \mathsf{copysign}\left(1, x\right)
\\
x\_s \cdot \begin{array}{l}
\mathbf{if}\;z \leq 2500000000000:\\
\;\;\;\;x\_m + x\_m \cdot \left(z \cdot \left(-1 + y\right)\right)\\
\mathbf{else}:\\
\;\;\;\;z \cdot \left(x\_m \cdot \left(-1 + y\right)\right)\\
\end{array}
\end{array}
if z < 2.5e12Initial program 97.8%
Taylor expanded in z around 0 97.8%
if 2.5e12 < z Initial program 85.9%
Taylor expanded in z around inf 85.9%
*-commutative85.9%
associate-*l*99.9%
sub-neg99.9%
metadata-eval99.9%
Simplified99.9%
Final simplification98.4%
x_m = (fabs.f64 x) x_s = (copysign.f64 1 x) (FPCore (x_s x_m y z) :precision binary64 (* x_s x_m))
x_m = fabs(x);
x_s = copysign(1.0, x);
double code(double x_s, double x_m, double y, double z) {
return x_s * x_m;
}
x_m = abs(x)
x_s = copysign(1.0d0, x)
real(8) function code(x_s, x_m, y, z)
real(8), intent (in) :: x_s
real(8), intent (in) :: x_m
real(8), intent (in) :: y
real(8), intent (in) :: z
code = x_s * x_m
end function
x_m = Math.abs(x);
x_s = Math.copySign(1.0, x);
public static double code(double x_s, double x_m, double y, double z) {
return x_s * x_m;
}
x_m = math.fabs(x) x_s = math.copysign(1.0, x) def code(x_s, x_m, y, z): return x_s * x_m
x_m = abs(x) x_s = copysign(1.0, x) function code(x_s, x_m, y, z) return Float64(x_s * x_m) end
x_m = abs(x); x_s = sign(x) * abs(1.0); function tmp = code(x_s, x_m, y, z) tmp = x_s * x_m; end
x_m = N[Abs[x], $MachinePrecision]
x_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[x]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[x$95$s_, x$95$m_, y_, z_] := N[(x$95$s * x$95$m), $MachinePrecision]
\begin{array}{l}
x_m = \left|x\right|
\\
x_s = \mathsf{copysign}\left(1, x\right)
\\
x\_s \cdot x\_m
\end{array}
Initial program 94.4%
Taylor expanded in z around 0 39.0%
Final simplification39.0%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (* x (- 1.0 (* (- 1.0 y) z))))
(t_1 (+ x (* (- 1.0 y) (* (- z) x)))))
(if (< t_0 -1.618195973607049e+50)
t_1
(if (< t_0 3.892237649663903e+134) (- (* (* x y) z) (- (* x z) x)) t_1))))
double code(double x, double y, double z) {
double t_0 = x * (1.0 - ((1.0 - y) * z));
double t_1 = x + ((1.0 - y) * (-z * x));
double tmp;
if (t_0 < -1.618195973607049e+50) {
tmp = t_1;
} else if (t_0 < 3.892237649663903e+134) {
tmp = ((x * y) * z) - ((x * z) - x);
} 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 = x * (1.0d0 - ((1.0d0 - y) * z))
t_1 = x + ((1.0d0 - y) * (-z * x))
if (t_0 < (-1.618195973607049d+50)) then
tmp = t_1
else if (t_0 < 3.892237649663903d+134) then
tmp = ((x * y) * z) - ((x * z) - x)
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double t_0 = x * (1.0 - ((1.0 - y) * z));
double t_1 = x + ((1.0 - y) * (-z * x));
double tmp;
if (t_0 < -1.618195973607049e+50) {
tmp = t_1;
} else if (t_0 < 3.892237649663903e+134) {
tmp = ((x * y) * z) - ((x * z) - x);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z): t_0 = x * (1.0 - ((1.0 - y) * z)) t_1 = x + ((1.0 - y) * (-z * x)) tmp = 0 if t_0 < -1.618195973607049e+50: tmp = t_1 elif t_0 < 3.892237649663903e+134: tmp = ((x * y) * z) - ((x * z) - x) else: tmp = t_1 return tmp
function code(x, y, z) t_0 = Float64(x * Float64(1.0 - Float64(Float64(1.0 - y) * z))) t_1 = Float64(x + Float64(Float64(1.0 - y) * Float64(Float64(-z) * x))) tmp = 0.0 if (t_0 < -1.618195973607049e+50) tmp = t_1; elseif (t_0 < 3.892237649663903e+134) tmp = Float64(Float64(Float64(x * y) * z) - Float64(Float64(x * z) - x)); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z) t_0 = x * (1.0 - ((1.0 - y) * z)); t_1 = x + ((1.0 - y) * (-z * x)); tmp = 0.0; if (t_0 < -1.618195973607049e+50) tmp = t_1; elseif (t_0 < 3.892237649663903e+134) tmp = ((x * y) * z) - ((x * z) - x); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(x * N[(1.0 - N[(N[(1.0 - y), $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(x + N[(N[(1.0 - y), $MachinePrecision] * N[((-z) * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[Less[t$95$0, -1.618195973607049e+50], t$95$1, If[Less[t$95$0, 3.892237649663903e+134], N[(N[(N[(x * y), $MachinePrecision] * z), $MachinePrecision] - N[(N[(x * z), $MachinePrecision] - x), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x \cdot \left(1 - \left(1 - y\right) \cdot z\right)\\
t_1 := x + \left(1 - y\right) \cdot \left(\left(-z\right) \cdot x\right)\\
\mathbf{if}\;t\_0 < -1.618195973607049 \cdot 10^{+50}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t\_0 < 3.892237649663903 \cdot 10^{+134}:\\
\;\;\;\;\left(x \cdot y\right) \cdot z - \left(x \cdot z - x\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
herbie shell --seed 2024048
(FPCore (x y z)
:name "Data.Colour.RGBSpace.HSV:hsv from colour-2.3.3, J"
:precision binary64
:alt
(if (< (* x (- 1.0 (* (- 1.0 y) z))) -1.618195973607049e+50) (+ x (* (- 1.0 y) (* (- z) x))) (if (< (* x (- 1.0 (* (- 1.0 y) z))) 3.892237649663903e+134) (- (* (* x y) z) (- (* x z) x)) (+ x (* (- 1.0 y) (* (- z) x)))))
(* x (- 1.0 (* (- 1.0 y) z))))