
(FPCore (x y z t) :precision binary64 (/ (* x (- y z)) (- t z)))
double code(double x, double y, double z, double t) {
return (x * (y - z)) / (t - z);
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = (x * (y - z)) / (t - z)
end function
public static double code(double x, double y, double z, double t) {
return (x * (y - z)) / (t - z);
}
def code(x, y, z, t): return (x * (y - z)) / (t - z)
function code(x, y, z, t) return Float64(Float64(x * Float64(y - z)) / Float64(t - z)) end
function tmp = code(x, y, z, t) tmp = (x * (y - z)) / (t - z); end
code[x_, y_, z_, t_] := N[(N[(x * N[(y - z), $MachinePrecision]), $MachinePrecision] / N[(t - z), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{x \cdot \left(y - z\right)}{t - z}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 9 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t) :precision binary64 (/ (* x (- y z)) (- t z)))
double code(double x, double y, double z, double t) {
return (x * (y - z)) / (t - z);
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = (x * (y - z)) / (t - z)
end function
public static double code(double x, double y, double z, double t) {
return (x * (y - z)) / (t - z);
}
def code(x, y, z, t): return (x * (y - z)) / (t - z)
function code(x, y, z, t) return Float64(Float64(x * Float64(y - z)) / Float64(t - z)) end
function tmp = code(x, y, z, t) tmp = (x * (y - z)) / (t - z); end
code[x_, y_, z_, t_] := N[(N[(x * N[(y - z), $MachinePrecision]), $MachinePrecision] / N[(t - z), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{x \cdot \left(y - z\right)}{t - z}
\end{array}
x\_m = (fabs.f64 x) x\_s = (copysign.f64 #s(literal 1 binary64) x) (FPCore (x_s x_m y z t) :precision binary64 (* x_s (if (<= x_m 2e-8) (/ (* x_m (- y z)) (- t z)) (* (- y z) (/ x_m (- t z))))))
x\_m = fabs(x);
x\_s = copysign(1.0, x);
double code(double x_s, double x_m, double y, double z, double t) {
double tmp;
if (x_m <= 2e-8) {
tmp = (x_m * (y - z)) / (t - z);
} else {
tmp = (y - z) * (x_m / (t - 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, t)
real(8), intent (in) :: x_s
real(8), intent (in) :: x_m
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (x_m <= 2d-8) then
tmp = (x_m * (y - z)) / (t - z)
else
tmp = (y - z) * (x_m / (t - 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 t) {
double tmp;
if (x_m <= 2e-8) {
tmp = (x_m * (y - z)) / (t - z);
} else {
tmp = (y - z) * (x_m / (t - 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, t): tmp = 0 if x_m <= 2e-8: tmp = (x_m * (y - z)) / (t - z) else: tmp = (y - z) * (x_m / (t - z)) return x_s * tmp
x\_m = abs(x) x\_s = copysign(1.0, x) function code(x_s, x_m, y, z, t) tmp = 0.0 if (x_m <= 2e-8) tmp = Float64(Float64(x_m * Float64(y - z)) / Float64(t - z)); else tmp = Float64(Float64(y - z) * Float64(x_m / Float64(t - 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, t) tmp = 0.0; if (x_m <= 2e-8) tmp = (x_m * (y - z)) / (t - z); else tmp = (y - z) * (x_m / (t - 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_, t_] := N[(x$95$s * If[LessEqual[x$95$m, 2e-8], N[(N[(x$95$m * N[(y - z), $MachinePrecision]), $MachinePrecision] / N[(t - z), $MachinePrecision]), $MachinePrecision], N[(N[(y - z), $MachinePrecision] * N[(x$95$m / N[(t - z), $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 2 \cdot 10^{-8}:\\
\;\;\;\;\frac{x\_m \cdot \left(y - z\right)}{t - z}\\
\mathbf{else}:\\
\;\;\;\;\left(y - z\right) \cdot \frac{x\_m}{t - z}\\
\end{array}
\end{array}
if x < 2e-8Initial program 87.4%
if 2e-8 < x Initial program 73.4%
*-commutativeN/A
associate-/l*N/A
*-commutativeN/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
--lowering--.f64N/A
--lowering--.f6495.0%
Applied egg-rr95.0%
Final simplification89.1%
x\_m = (fabs.f64 x)
x\_s = (copysign.f64 #s(literal 1 binary64) x)
(FPCore (x_s x_m y z t)
:precision binary64
(let* ((t_1 (* x_m (- 1.0 (/ y z)))))
(*
x_s
(if (<= z -2.85e+48)
t_1
(if (<= z 1.5e-147)
(* y (/ x_m (- t z)))
(if (<= z 1.12e+54) (/ (* x_m (- y z)) t) 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) {
double t_1 = x_m * (1.0 - (y / z));
double tmp;
if (z <= -2.85e+48) {
tmp = t_1;
} else if (z <= 1.5e-147) {
tmp = y * (x_m / (t - z));
} else if (z <= 1.12e+54) {
tmp = (x_m * (y - z)) / t;
} 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, t)
real(8), intent (in) :: x_s
real(8), intent (in) :: x_m
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: tmp
t_1 = x_m * (1.0d0 - (y / z))
if (z <= (-2.85d+48)) then
tmp = t_1
else if (z <= 1.5d-147) then
tmp = y * (x_m / (t - z))
else if (z <= 1.12d+54) then
tmp = (x_m * (y - z)) / t
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) {
double t_1 = x_m * (1.0 - (y / z));
double tmp;
if (z <= -2.85e+48) {
tmp = t_1;
} else if (z <= 1.5e-147) {
tmp = y * (x_m / (t - z));
} else if (z <= 1.12e+54) {
tmp = (x_m * (y - z)) / t;
} 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): t_1 = x_m * (1.0 - (y / z)) tmp = 0 if z <= -2.85e+48: tmp = t_1 elif z <= 1.5e-147: tmp = y * (x_m / (t - z)) elif z <= 1.12e+54: tmp = (x_m * (y - z)) / t 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) t_1 = Float64(x_m * Float64(1.0 - Float64(y / z))) tmp = 0.0 if (z <= -2.85e+48) tmp = t_1; elseif (z <= 1.5e-147) tmp = Float64(y * Float64(x_m / Float64(t - z))); elseif (z <= 1.12e+54) tmp = Float64(Float64(x_m * Float64(y - z)) / t); 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) t_1 = x_m * (1.0 - (y / z)); tmp = 0.0; if (z <= -2.85e+48) tmp = t_1; elseif (z <= 1.5e-147) tmp = y * (x_m / (t - z)); elseif (z <= 1.12e+54) tmp = (x_m * (y - z)) / t; 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_, t_] := Block[{t$95$1 = N[(x$95$m * N[(1.0 - N[(y / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, N[(x$95$s * If[LessEqual[z, -2.85e+48], t$95$1, If[LessEqual[z, 1.5e-147], N[(y * N[(x$95$m / N[(t - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.12e+54], N[(N[(x$95$m * N[(y - z), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision], t$95$1]]]), $MachinePrecision]]
\begin{array}{l}
x\_m = \left|x\right|
\\
x\_s = \mathsf{copysign}\left(1, x\right)
\\
\begin{array}{l}
t_1 := x\_m \cdot \left(1 - \frac{y}{z}\right)\\
x\_s \cdot \begin{array}{l}
\mathbf{if}\;z \leq -2.85 \cdot 10^{+48}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 1.5 \cdot 10^{-147}:\\
\;\;\;\;y \cdot \frac{x\_m}{t - z}\\
\mathbf{elif}\;z \leq 1.12 \cdot 10^{+54}:\\
\;\;\;\;\frac{x\_m \cdot \left(y - z\right)}{t}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
\end{array}
if z < -2.84999999999999984e48 or 1.12e54 < z Initial program 68.6%
Taylor expanded in t around 0
mul-1-negN/A
associate-/l*N/A
distribute-rgt-neg-inN/A
*-lowering-*.f64N/A
neg-sub0N/A
div-subN/A
*-inversesN/A
associate-+l-N/A
neg-sub0N/A
mul-1-negN/A
+-commutativeN/A
mul-1-negN/A
unsub-negN/A
--lowering--.f64N/A
/-lowering-/.f6482.7%
Simplified82.7%
if -2.84999999999999984e48 < z < 1.5000000000000001e-147Initial program 94.9%
Taylor expanded in y around inf
*-commutativeN/A
associate-*r/N/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
--lowering--.f6483.6%
Simplified83.6%
if 1.5000000000000001e-147 < z < 1.12e54Initial program 97.9%
Taylor expanded in t around inf
Simplified67.5%
x\_m = (fabs.f64 x)
x\_s = (copysign.f64 #s(literal 1 binary64) x)
(FPCore (x_s x_m y z t)
:precision binary64
(let* ((t_1 (* x_m (- 1.0 (/ y z)))))
(*
x_s
(if (<= z -1.8e+50)
t_1
(if (<= z 1.45e-148)
(* y (/ x_m (- t z)))
(if (<= z 1.5e+56) (* x_m (/ (- y z) t)) 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) {
double t_1 = x_m * (1.0 - (y / z));
double tmp;
if (z <= -1.8e+50) {
tmp = t_1;
} else if (z <= 1.45e-148) {
tmp = y * (x_m / (t - z));
} else if (z <= 1.5e+56) {
tmp = x_m * ((y - z) / t);
} 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, t)
real(8), intent (in) :: x_s
real(8), intent (in) :: x_m
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: tmp
t_1 = x_m * (1.0d0 - (y / z))
if (z <= (-1.8d+50)) then
tmp = t_1
else if (z <= 1.45d-148) then
tmp = y * (x_m / (t - z))
else if (z <= 1.5d+56) then
tmp = x_m * ((y - z) / t)
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) {
double t_1 = x_m * (1.0 - (y / z));
double tmp;
if (z <= -1.8e+50) {
tmp = t_1;
} else if (z <= 1.45e-148) {
tmp = y * (x_m / (t - z));
} else if (z <= 1.5e+56) {
tmp = x_m * ((y - z) / t);
} 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): t_1 = x_m * (1.0 - (y / z)) tmp = 0 if z <= -1.8e+50: tmp = t_1 elif z <= 1.45e-148: tmp = y * (x_m / (t - z)) elif z <= 1.5e+56: tmp = x_m * ((y - z) / t) 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) t_1 = Float64(x_m * Float64(1.0 - Float64(y / z))) tmp = 0.0 if (z <= -1.8e+50) tmp = t_1; elseif (z <= 1.45e-148) tmp = Float64(y * Float64(x_m / Float64(t - z))); elseif (z <= 1.5e+56) tmp = Float64(x_m * Float64(Float64(y - z) / t)); 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) t_1 = x_m * (1.0 - (y / z)); tmp = 0.0; if (z <= -1.8e+50) tmp = t_1; elseif (z <= 1.45e-148) tmp = y * (x_m / (t - z)); elseif (z <= 1.5e+56) tmp = x_m * ((y - z) / t); 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_, t_] := Block[{t$95$1 = N[(x$95$m * N[(1.0 - N[(y / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, N[(x$95$s * If[LessEqual[z, -1.8e+50], t$95$1, If[LessEqual[z, 1.45e-148], N[(y * N[(x$95$m / N[(t - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.5e+56], N[(x$95$m * N[(N[(y - z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision], t$95$1]]]), $MachinePrecision]]
\begin{array}{l}
x\_m = \left|x\right|
\\
x\_s = \mathsf{copysign}\left(1, x\right)
\\
\begin{array}{l}
t_1 := x\_m \cdot \left(1 - \frac{y}{z}\right)\\
x\_s \cdot \begin{array}{l}
\mathbf{if}\;z \leq -1.8 \cdot 10^{+50}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 1.45 \cdot 10^{-148}:\\
\;\;\;\;y \cdot \frac{x\_m}{t - z}\\
\mathbf{elif}\;z \leq 1.5 \cdot 10^{+56}:\\
\;\;\;\;x\_m \cdot \frac{y - z}{t}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
\end{array}
if z < -1.79999999999999993e50 or 1.50000000000000003e56 < z Initial program 68.6%
Taylor expanded in t around 0
mul-1-negN/A
associate-/l*N/A
distribute-rgt-neg-inN/A
*-lowering-*.f64N/A
neg-sub0N/A
div-subN/A
*-inversesN/A
associate-+l-N/A
neg-sub0N/A
mul-1-negN/A
+-commutativeN/A
mul-1-negN/A
unsub-negN/A
--lowering--.f64N/A
/-lowering-/.f6482.7%
Simplified82.7%
if -1.79999999999999993e50 < z < 1.4499999999999999e-148Initial program 94.8%
Taylor expanded in y around inf
*-commutativeN/A
associate-*r/N/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
--lowering--.f6483.4%
Simplified83.4%
if 1.4499999999999999e-148 < z < 1.50000000000000003e56Initial program 97.9%
Taylor expanded in t around inf
associate-/l*N/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
--lowering--.f6467.9%
Simplified67.9%
x\_m = (fabs.f64 x)
x\_s = (copysign.f64 #s(literal 1 binary64) x)
(FPCore (x_s x_m y z t)
:precision binary64
(let* ((t_1 (* x_m (- 1.0 (/ y z)))))
(*
x_s
(if (<= z -1.62e+142)
t_1
(if (<= z 1.95e+158) (* (- y z) (/ x_m (- t z))) 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) {
double t_1 = x_m * (1.0 - (y / z));
double tmp;
if (z <= -1.62e+142) {
tmp = t_1;
} else if (z <= 1.95e+158) {
tmp = (y - z) * (x_m / (t - z));
} 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, t)
real(8), intent (in) :: x_s
real(8), intent (in) :: x_m
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: tmp
t_1 = x_m * (1.0d0 - (y / z))
if (z <= (-1.62d+142)) then
tmp = t_1
else if (z <= 1.95d+158) then
tmp = (y - z) * (x_m / (t - z))
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) {
double t_1 = x_m * (1.0 - (y / z));
double tmp;
if (z <= -1.62e+142) {
tmp = t_1;
} else if (z <= 1.95e+158) {
tmp = (y - z) * (x_m / (t - z));
} 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): t_1 = x_m * (1.0 - (y / z)) tmp = 0 if z <= -1.62e+142: tmp = t_1 elif z <= 1.95e+158: tmp = (y - z) * (x_m / (t - z)) 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) t_1 = Float64(x_m * Float64(1.0 - Float64(y / z))) tmp = 0.0 if (z <= -1.62e+142) tmp = t_1; elseif (z <= 1.95e+158) tmp = Float64(Float64(y - z) * Float64(x_m / Float64(t - z))); 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) t_1 = x_m * (1.0 - (y / z)); tmp = 0.0; if (z <= -1.62e+142) tmp = t_1; elseif (z <= 1.95e+158) tmp = (y - z) * (x_m / (t - z)); 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_, t_] := Block[{t$95$1 = N[(x$95$m * N[(1.0 - N[(y / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, N[(x$95$s * If[LessEqual[z, -1.62e+142], t$95$1, If[LessEqual[z, 1.95e+158], N[(N[(y - z), $MachinePrecision] * N[(x$95$m / N[(t - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]), $MachinePrecision]]
\begin{array}{l}
x\_m = \left|x\right|
\\
x\_s = \mathsf{copysign}\left(1, x\right)
\\
\begin{array}{l}
t_1 := x\_m \cdot \left(1 - \frac{y}{z}\right)\\
x\_s \cdot \begin{array}{l}
\mathbf{if}\;z \leq -1.62 \cdot 10^{+142}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 1.95 \cdot 10^{+158}:\\
\;\;\;\;\left(y - z\right) \cdot \frac{x\_m}{t - z}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
\end{array}
if z < -1.62000000000000006e142 or 1.95e158 < z Initial program 62.0%
Taylor expanded in t around 0
mul-1-negN/A
associate-/l*N/A
distribute-rgt-neg-inN/A
*-lowering-*.f64N/A
neg-sub0N/A
div-subN/A
*-inversesN/A
associate-+l-N/A
neg-sub0N/A
mul-1-negN/A
+-commutativeN/A
mul-1-negN/A
unsub-negN/A
--lowering--.f64N/A
/-lowering-/.f6490.8%
Simplified90.8%
if -1.62000000000000006e142 < z < 1.95e158Initial program 92.7%
*-commutativeN/A
associate-/l*N/A
*-commutativeN/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
--lowering--.f64N/A
--lowering--.f6494.2%
Applied egg-rr94.2%
Final simplification93.3%
x\_m = (fabs.f64 x)
x\_s = (copysign.f64 #s(literal 1 binary64) x)
(FPCore (x_s x_m y z t)
:precision binary64
(let* ((t_1 (* x_m (/ (- y z) t))))
(*
x_s
(if (<= t -9e+86) t_1 (if (<= t 5.2e+54) (* x_m (- 1.0 (/ y z))) 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) {
double t_1 = x_m * ((y - z) / t);
double tmp;
if (t <= -9e+86) {
tmp = t_1;
} else if (t <= 5.2e+54) {
tmp = x_m * (1.0 - (y / z));
} 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, t)
real(8), intent (in) :: x_s
real(8), intent (in) :: x_m
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: tmp
t_1 = x_m * ((y - z) / t)
if (t <= (-9d+86)) then
tmp = t_1
else if (t <= 5.2d+54) then
tmp = x_m * (1.0d0 - (y / z))
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) {
double t_1 = x_m * ((y - z) / t);
double tmp;
if (t <= -9e+86) {
tmp = t_1;
} else if (t <= 5.2e+54) {
tmp = x_m * (1.0 - (y / z));
} 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): t_1 = x_m * ((y - z) / t) tmp = 0 if t <= -9e+86: tmp = t_1 elif t <= 5.2e+54: tmp = x_m * (1.0 - (y / z)) 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) t_1 = Float64(x_m * Float64(Float64(y - z) / t)) tmp = 0.0 if (t <= -9e+86) tmp = t_1; elseif (t <= 5.2e+54) tmp = Float64(x_m * Float64(1.0 - Float64(y / z))); 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) t_1 = x_m * ((y - z) / t); tmp = 0.0; if (t <= -9e+86) tmp = t_1; elseif (t <= 5.2e+54) tmp = x_m * (1.0 - (y / z)); 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_, t_] := Block[{t$95$1 = N[(x$95$m * N[(N[(y - z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]}, N[(x$95$s * If[LessEqual[t, -9e+86], t$95$1, If[LessEqual[t, 5.2e+54], N[(x$95$m * N[(1.0 - N[(y / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]), $MachinePrecision]]
\begin{array}{l}
x\_m = \left|x\right|
\\
x\_s = \mathsf{copysign}\left(1, x\right)
\\
\begin{array}{l}
t_1 := x\_m \cdot \frac{y - z}{t}\\
x\_s \cdot \begin{array}{l}
\mathbf{if}\;t \leq -9 \cdot 10^{+86}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 5.2 \cdot 10^{+54}:\\
\;\;\;\;x\_m \cdot \left(1 - \frac{y}{z}\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
\end{array}
if t < -8.99999999999999986e86 or 5.20000000000000013e54 < t Initial program 84.1%
Taylor expanded in t around inf
associate-/l*N/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
--lowering--.f6476.4%
Simplified76.4%
if -8.99999999999999986e86 < t < 5.20000000000000013e54Initial program 84.4%
Taylor expanded in t around 0
mul-1-negN/A
associate-/l*N/A
distribute-rgt-neg-inN/A
*-lowering-*.f64N/A
neg-sub0N/A
div-subN/A
*-inversesN/A
associate-+l-N/A
neg-sub0N/A
mul-1-negN/A
+-commutativeN/A
mul-1-negN/A
unsub-negN/A
--lowering--.f64N/A
/-lowering-/.f6477.0%
Simplified77.0%
x\_m = (fabs.f64 x) x\_s = (copysign.f64 #s(literal 1 binary64) x) (FPCore (x_s x_m y z t) :precision binary64 (let* ((t_1 (* x_m (- 1.0 (/ y z))))) (* x_s (if (<= z -8e-82) t_1 (if (<= z 1.48e-33) (/ (* x_m y) t) 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) {
double t_1 = x_m * (1.0 - (y / z));
double tmp;
if (z <= -8e-82) {
tmp = t_1;
} else if (z <= 1.48e-33) {
tmp = (x_m * y) / t;
} 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, t)
real(8), intent (in) :: x_s
real(8), intent (in) :: x_m
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: tmp
t_1 = x_m * (1.0d0 - (y / z))
if (z <= (-8d-82)) then
tmp = t_1
else if (z <= 1.48d-33) then
tmp = (x_m * y) / t
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) {
double t_1 = x_m * (1.0 - (y / z));
double tmp;
if (z <= -8e-82) {
tmp = t_1;
} else if (z <= 1.48e-33) {
tmp = (x_m * y) / t;
} 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): t_1 = x_m * (1.0 - (y / z)) tmp = 0 if z <= -8e-82: tmp = t_1 elif z <= 1.48e-33: tmp = (x_m * y) / t 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) t_1 = Float64(x_m * Float64(1.0 - Float64(y / z))) tmp = 0.0 if (z <= -8e-82) tmp = t_1; elseif (z <= 1.48e-33) tmp = Float64(Float64(x_m * y) / t); 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) t_1 = x_m * (1.0 - (y / z)); tmp = 0.0; if (z <= -8e-82) tmp = t_1; elseif (z <= 1.48e-33) tmp = (x_m * y) / t; 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_, t_] := Block[{t$95$1 = N[(x$95$m * N[(1.0 - N[(y / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, N[(x$95$s * If[LessEqual[z, -8e-82], t$95$1, If[LessEqual[z, 1.48e-33], N[(N[(x$95$m * y), $MachinePrecision] / t), $MachinePrecision], t$95$1]]), $MachinePrecision]]
\begin{array}{l}
x\_m = \left|x\right|
\\
x\_s = \mathsf{copysign}\left(1, x\right)
\\
\begin{array}{l}
t_1 := x\_m \cdot \left(1 - \frac{y}{z}\right)\\
x\_s \cdot \begin{array}{l}
\mathbf{if}\;z \leq -8 \cdot 10^{-82}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 1.48 \cdot 10^{-33}:\\
\;\;\;\;\frac{x\_m \cdot y}{t}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
\end{array}
if z < -8e-82 or 1.47999999999999995e-33 < z Initial program 76.4%
Taylor expanded in t around 0
mul-1-negN/A
associate-/l*N/A
distribute-rgt-neg-inN/A
*-lowering-*.f64N/A
neg-sub0N/A
div-subN/A
*-inversesN/A
associate-+l-N/A
neg-sub0N/A
mul-1-negN/A
+-commutativeN/A
mul-1-negN/A
unsub-negN/A
--lowering--.f64N/A
/-lowering-/.f6472.0%
Simplified72.0%
if -8e-82 < z < 1.47999999999999995e-33Initial program 96.1%
Taylor expanded in z around 0
/-lowering-/.f64N/A
*-lowering-*.f6471.8%
Simplified71.8%
x\_m = (fabs.f64 x) x\_s = (copysign.f64 #s(literal 1 binary64) x) (FPCore (x_s x_m y z t) :precision binary64 (* x_s (if (<= z -1.16e+47) x_m (if (<= z 1.6e+65) (* y (/ x_m t)) 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 t) {
double tmp;
if (z <= -1.16e+47) {
tmp = x_m;
} else if (z <= 1.6e+65) {
tmp = y * (x_m / t);
} 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, t)
real(8), intent (in) :: x_s
real(8), intent (in) :: x_m
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (z <= (-1.16d+47)) then
tmp = x_m
else if (z <= 1.6d+65) then
tmp = y * (x_m / t)
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 t) {
double tmp;
if (z <= -1.16e+47) {
tmp = x_m;
} else if (z <= 1.6e+65) {
tmp = y * (x_m / t);
} 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, t): tmp = 0 if z <= -1.16e+47: tmp = x_m elif z <= 1.6e+65: tmp = y * (x_m / t) 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, t) tmp = 0.0 if (z <= -1.16e+47) tmp = x_m; elseif (z <= 1.6e+65) tmp = Float64(y * Float64(x_m / t)); 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, t) tmp = 0.0; if (z <= -1.16e+47) tmp = x_m; elseif (z <= 1.6e+65) tmp = y * (x_m / t); 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_, t_] := N[(x$95$s * If[LessEqual[z, -1.16e+47], x$95$m, If[LessEqual[z, 1.6e+65], N[(y * N[(x$95$m / t), $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 -1.16 \cdot 10^{+47}:\\
\;\;\;\;x\_m\\
\mathbf{elif}\;z \leq 1.6 \cdot 10^{+65}:\\
\;\;\;\;y \cdot \frac{x\_m}{t}\\
\mathbf{else}:\\
\;\;\;\;x\_m\\
\end{array}
\end{array}
if z < -1.1600000000000001e47 or 1.60000000000000003e65 < z Initial program 68.1%
Taylor expanded in z around inf
Simplified65.4%
if -1.1600000000000001e47 < z < 1.60000000000000003e65Initial program 96.0%
Taylor expanded in y around inf
*-commutativeN/A
associate-*r/N/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
--lowering--.f6473.5%
Simplified73.5%
Taylor expanded in t around inf
Simplified60.8%
x\_m = (fabs.f64 x)
x\_s = (copysign.f64 #s(literal 1 binary64) x)
(FPCore (x_s x_m y z t)
:precision binary64
(*
x_s
(if (<= x_m 1.5e-21)
(/ x_m (/ (- t z) (- y z)))
(* (- y z) (/ x_m (- t z))))))x\_m = fabs(x);
x\_s = copysign(1.0, x);
double code(double x_s, double x_m, double y, double z, double t) {
double tmp;
if (x_m <= 1.5e-21) {
tmp = x_m / ((t - z) / (y - z));
} else {
tmp = (y - z) * (x_m / (t - 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, t)
real(8), intent (in) :: x_s
real(8), intent (in) :: x_m
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (x_m <= 1.5d-21) then
tmp = x_m / ((t - z) / (y - z))
else
tmp = (y - z) * (x_m / (t - 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 t) {
double tmp;
if (x_m <= 1.5e-21) {
tmp = x_m / ((t - z) / (y - z));
} else {
tmp = (y - z) * (x_m / (t - 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, t): tmp = 0 if x_m <= 1.5e-21: tmp = x_m / ((t - z) / (y - z)) else: tmp = (y - z) * (x_m / (t - z)) return x_s * tmp
x\_m = abs(x) x\_s = copysign(1.0, x) function code(x_s, x_m, y, z, t) tmp = 0.0 if (x_m <= 1.5e-21) tmp = Float64(x_m / Float64(Float64(t - z) / Float64(y - z))); else tmp = Float64(Float64(y - z) * Float64(x_m / Float64(t - 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, t) tmp = 0.0; if (x_m <= 1.5e-21) tmp = x_m / ((t - z) / (y - z)); else tmp = (y - z) * (x_m / (t - 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_, t_] := N[(x$95$s * If[LessEqual[x$95$m, 1.5e-21], N[(x$95$m / N[(N[(t - z), $MachinePrecision] / N[(y - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(y - z), $MachinePrecision] * N[(x$95$m / N[(t - z), $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 1.5 \cdot 10^{-21}:\\
\;\;\;\;\frac{x\_m}{\frac{t - z}{y - z}}\\
\mathbf{else}:\\
\;\;\;\;\left(y - z\right) \cdot \frac{x\_m}{t - z}\\
\end{array}
\end{array}
if x < 1.49999999999999996e-21Initial program 87.1%
associate-/l*N/A
clear-numN/A
un-div-invN/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
--lowering--.f64N/A
--lowering--.f6495.4%
Applied egg-rr95.4%
if 1.49999999999999996e-21 < x Initial program 75.5%
*-commutativeN/A
associate-/l*N/A
*-commutativeN/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
--lowering--.f64N/A
--lowering--.f6495.4%
Applied egg-rr95.4%
Final simplification95.4%
x\_m = (fabs.f64 x) x\_s = (copysign.f64 #s(literal 1 binary64) x) (FPCore (x_s x_m y z t) :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, double t) {
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, t)
real(8), intent (in) :: x_s
real(8), intent (in) :: x_m
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
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, double t) {
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, t): return x_s * x_m
x\_m = abs(x) x\_s = copysign(1.0, x) function code(x_s, x_m, y, z, t) 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, t) 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_, t_] := 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 84.3%
Taylor expanded in z around inf
Simplified35.0%
(FPCore (x y z t) :precision binary64 (/ x (/ (- t z) (- y z))))
double code(double x, double y, double z, double t) {
return x / ((t - z) / (y - z));
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = x / ((t - z) / (y - z))
end function
public static double code(double x, double y, double z, double t) {
return x / ((t - z) / (y - z));
}
def code(x, y, z, t): return x / ((t - z) / (y - z))
function code(x, y, z, t) return Float64(x / Float64(Float64(t - z) / Float64(y - z))) end
function tmp = code(x, y, z, t) tmp = x / ((t - z) / (y - z)); end
code[x_, y_, z_, t_] := N[(x / N[(N[(t - z), $MachinePrecision] / N[(y - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{x}{\frac{t - z}{y - z}}
\end{array}
herbie shell --seed 2024158
(FPCore (x y z t)
:name "Graphics.Rendering.Chart.Plot.AreaSpots:renderAreaSpots4D from Chart-1.5.3"
:precision binary64
:alt
(! :herbie-platform default (/ x (/ (- t z) (- y z))))
(/ (* x (- y z)) (- t z)))