
(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 10 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}
(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(x * Float64(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[(x * N[(N[(y - z), $MachinePrecision] / N[(t - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x \cdot \frac{y - z}{t - z}
\end{array}
Initial program 86.2%
*-commutative86.2%
associate-*l/97.5%
*-commutative97.5%
Simplified97.5%
Final simplification97.5%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (- x (* y (/ x z)))) (t_2 (* x (/ (- y z) t))))
(if (<= t -5.8e+72)
t_2
(if (<= t -3.8e-18)
t_1
(if (<= t -6.4e-81)
t_2
(if (<= t -3.5e-107)
t_1
(if (<= t -1.15e-144)
(* x (/ y (- t z)))
(if (<= t 6.2) t_1 t_2))))))))
double code(double x, double y, double z, double t) {
double t_1 = x - (y * (x / z));
double t_2 = x * ((y - z) / t);
double tmp;
if (t <= -5.8e+72) {
tmp = t_2;
} else if (t <= -3.8e-18) {
tmp = t_1;
} else if (t <= -6.4e-81) {
tmp = t_2;
} else if (t <= -3.5e-107) {
tmp = t_1;
} else if (t <= -1.15e-144) {
tmp = x * (y / (t - z));
} else if (t <= 6.2) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
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
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = x - (y * (x / z))
t_2 = x * ((y - z) / t)
if (t <= (-5.8d+72)) then
tmp = t_2
else if (t <= (-3.8d-18)) then
tmp = t_1
else if (t <= (-6.4d-81)) then
tmp = t_2
else if (t <= (-3.5d-107)) then
tmp = t_1
else if (t <= (-1.15d-144)) then
tmp = x * (y / (t - z))
else if (t <= 6.2d0) then
tmp = t_1
else
tmp = t_2
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = x - (y * (x / z));
double t_2 = x * ((y - z) / t);
double tmp;
if (t <= -5.8e+72) {
tmp = t_2;
} else if (t <= -3.8e-18) {
tmp = t_1;
} else if (t <= -6.4e-81) {
tmp = t_2;
} else if (t <= -3.5e-107) {
tmp = t_1;
} else if (t <= -1.15e-144) {
tmp = x * (y / (t - z));
} else if (t <= 6.2) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t): t_1 = x - (y * (x / z)) t_2 = x * ((y - z) / t) tmp = 0 if t <= -5.8e+72: tmp = t_2 elif t <= -3.8e-18: tmp = t_1 elif t <= -6.4e-81: tmp = t_2 elif t <= -3.5e-107: tmp = t_1 elif t <= -1.15e-144: tmp = x * (y / (t - z)) elif t <= 6.2: tmp = t_1 else: tmp = t_2 return tmp
function code(x, y, z, t) t_1 = Float64(x - Float64(y * Float64(x / z))) t_2 = Float64(x * Float64(Float64(y - z) / t)) tmp = 0.0 if (t <= -5.8e+72) tmp = t_2; elseif (t <= -3.8e-18) tmp = t_1; elseif (t <= -6.4e-81) tmp = t_2; elseif (t <= -3.5e-107) tmp = t_1; elseif (t <= -1.15e-144) tmp = Float64(x * Float64(y / Float64(t - z))); elseif (t <= 6.2) tmp = t_1; else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = x - (y * (x / z)); t_2 = x * ((y - z) / t); tmp = 0.0; if (t <= -5.8e+72) tmp = t_2; elseif (t <= -3.8e-18) tmp = t_1; elseif (t <= -6.4e-81) tmp = t_2; elseif (t <= -3.5e-107) tmp = t_1; elseif (t <= -1.15e-144) tmp = x * (y / (t - z)); elseif (t <= 6.2) tmp = t_1; else tmp = t_2; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(x - N[(y * N[(x / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(x * N[(N[(y - z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -5.8e+72], t$95$2, If[LessEqual[t, -3.8e-18], t$95$1, If[LessEqual[t, -6.4e-81], t$95$2, If[LessEqual[t, -3.5e-107], t$95$1, If[LessEqual[t, -1.15e-144], N[(x * N[(y / N[(t - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 6.2], t$95$1, t$95$2]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x - y \cdot \frac{x}{z}\\
t_2 := x \cdot \frac{y - z}{t}\\
\mathbf{if}\;t \leq -5.8 \cdot 10^{+72}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;t \leq -3.8 \cdot 10^{-18}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;t \leq -6.4 \cdot 10^{-81}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;t \leq -3.5 \cdot 10^{-107}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;t \leq -1.15 \cdot 10^{-144}:\\
\;\;\;\;x \cdot \frac{y}{t - z}\\
\mathbf{elif}\;t \leq 6.2:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;t_2\\
\end{array}
\end{array}
if t < -5.80000000000000034e72 or -3.7999999999999998e-18 < t < -6.4e-81 or 6.20000000000000018 < t Initial program 85.7%
*-commutative85.7%
associate-*l/98.1%
*-commutative98.1%
Simplified98.1%
Taylor expanded in t around inf 77.3%
if -5.80000000000000034e72 < t < -3.7999999999999998e-18 or -6.4e-81 < t < -3.49999999999999985e-107 or -1.15e-144 < t < 6.20000000000000018Initial program 85.8%
*-commutative85.8%
associate-*l/96.8%
*-commutative96.8%
Simplified96.8%
Taylor expanded in t around 0 71.1%
mul-1-neg71.1%
associate-/l*83.2%
distribute-neg-frac83.2%
Simplified83.2%
Taylor expanded in z around 0 82.2%
mul-1-neg82.2%
unsub-neg82.2%
associate-*l/83.5%
*-commutative83.5%
Simplified83.5%
if -3.49999999999999985e-107 < t < -1.15e-144Initial program 99.8%
*-commutative99.8%
associate-*l/99.6%
*-commutative99.6%
Simplified99.6%
Taylor expanded in y around inf 94.0%
Final simplification80.8%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (- x (* y (/ x z)))) (t_2 (* x (/ (- y z) t))))
(if (<= t -2.65e+73)
t_2
(if (<= t -2.4e-18)
t_1
(if (<= t -5.8e-81)
(/ x (/ t (- y z)))
(if (<= t -2.6e-107)
t_1
(if (<= t -7.4e-147)
(* x (/ y (- t z)))
(if (<= t 3.7) t_1 t_2))))))))
double code(double x, double y, double z, double t) {
double t_1 = x - (y * (x / z));
double t_2 = x * ((y - z) / t);
double tmp;
if (t <= -2.65e+73) {
tmp = t_2;
} else if (t <= -2.4e-18) {
tmp = t_1;
} else if (t <= -5.8e-81) {
tmp = x / (t / (y - z));
} else if (t <= -2.6e-107) {
tmp = t_1;
} else if (t <= -7.4e-147) {
tmp = x * (y / (t - z));
} else if (t <= 3.7) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
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
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = x - (y * (x / z))
t_2 = x * ((y - z) / t)
if (t <= (-2.65d+73)) then
tmp = t_2
else if (t <= (-2.4d-18)) then
tmp = t_1
else if (t <= (-5.8d-81)) then
tmp = x / (t / (y - z))
else if (t <= (-2.6d-107)) then
tmp = t_1
else if (t <= (-7.4d-147)) then
tmp = x * (y / (t - z))
else if (t <= 3.7d0) then
tmp = t_1
else
tmp = t_2
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = x - (y * (x / z));
double t_2 = x * ((y - z) / t);
double tmp;
if (t <= -2.65e+73) {
tmp = t_2;
} else if (t <= -2.4e-18) {
tmp = t_1;
} else if (t <= -5.8e-81) {
tmp = x / (t / (y - z));
} else if (t <= -2.6e-107) {
tmp = t_1;
} else if (t <= -7.4e-147) {
tmp = x * (y / (t - z));
} else if (t <= 3.7) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t): t_1 = x - (y * (x / z)) t_2 = x * ((y - z) / t) tmp = 0 if t <= -2.65e+73: tmp = t_2 elif t <= -2.4e-18: tmp = t_1 elif t <= -5.8e-81: tmp = x / (t / (y - z)) elif t <= -2.6e-107: tmp = t_1 elif t <= -7.4e-147: tmp = x * (y / (t - z)) elif t <= 3.7: tmp = t_1 else: tmp = t_2 return tmp
function code(x, y, z, t) t_1 = Float64(x - Float64(y * Float64(x / z))) t_2 = Float64(x * Float64(Float64(y - z) / t)) tmp = 0.0 if (t <= -2.65e+73) tmp = t_2; elseif (t <= -2.4e-18) tmp = t_1; elseif (t <= -5.8e-81) tmp = Float64(x / Float64(t / Float64(y - z))); elseif (t <= -2.6e-107) tmp = t_1; elseif (t <= -7.4e-147) tmp = Float64(x * Float64(y / Float64(t - z))); elseif (t <= 3.7) tmp = t_1; else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = x - (y * (x / z)); t_2 = x * ((y - z) / t); tmp = 0.0; if (t <= -2.65e+73) tmp = t_2; elseif (t <= -2.4e-18) tmp = t_1; elseif (t <= -5.8e-81) tmp = x / (t / (y - z)); elseif (t <= -2.6e-107) tmp = t_1; elseif (t <= -7.4e-147) tmp = x * (y / (t - z)); elseif (t <= 3.7) tmp = t_1; else tmp = t_2; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(x - N[(y * N[(x / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(x * N[(N[(y - z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -2.65e+73], t$95$2, If[LessEqual[t, -2.4e-18], t$95$1, If[LessEqual[t, -5.8e-81], N[(x / N[(t / N[(y - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, -2.6e-107], t$95$1, If[LessEqual[t, -7.4e-147], N[(x * N[(y / N[(t - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 3.7], t$95$1, t$95$2]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x - y \cdot \frac{x}{z}\\
t_2 := x \cdot \frac{y - z}{t}\\
\mathbf{if}\;t \leq -2.65 \cdot 10^{+73}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;t \leq -2.4 \cdot 10^{-18}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;t \leq -5.8 \cdot 10^{-81}:\\
\;\;\;\;\frac{x}{\frac{t}{y - z}}\\
\mathbf{elif}\;t \leq -2.6 \cdot 10^{-107}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;t \leq -7.4 \cdot 10^{-147}:\\
\;\;\;\;x \cdot \frac{y}{t - z}\\
\mathbf{elif}\;t \leq 3.7:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;t_2\\
\end{array}
\end{array}
if t < -2.64999999999999998e73 or 3.7000000000000002 < t Initial program 84.2%
*-commutative84.2%
associate-*l/97.9%
*-commutative97.9%
Simplified97.9%
Taylor expanded in t around inf 78.3%
if -2.64999999999999998e73 < t < -2.39999999999999994e-18 or -5.79999999999999978e-81 < t < -2.6000000000000001e-107 or -7.40000000000000039e-147 < t < 3.7000000000000002Initial program 85.8%
*-commutative85.8%
associate-*l/96.8%
*-commutative96.8%
Simplified96.8%
Taylor expanded in t around 0 71.1%
mul-1-neg71.1%
associate-/l*83.2%
distribute-neg-frac83.2%
Simplified83.2%
Taylor expanded in z around 0 82.2%
mul-1-neg82.2%
unsub-neg82.2%
associate-*l/83.5%
*-commutative83.5%
Simplified83.5%
if -2.39999999999999994e-18 < t < -5.79999999999999978e-81Initial program 99.6%
*-commutative99.6%
associate-*l/99.7%
*-commutative99.7%
Simplified99.7%
Taylor expanded in t around inf 68.0%
associate-/l*68.1%
Simplified68.1%
if -2.6000000000000001e-107 < t < -7.40000000000000039e-147Initial program 99.8%
*-commutative99.8%
associate-*l/99.6%
*-commutative99.6%
Simplified99.6%
Taylor expanded in y around inf 94.0%
Final simplification80.8%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (- x (* y (/ x z)))) (t_2 (* x (/ (- y z) t))))
(if (<= t -5.5e+72)
t_2
(if (<= t -1.06e-17)
t_1
(if (<= t -6.4e-81)
(/ x (/ t (- y z)))
(if (<= t -4.1e-107)
t_1
(if (<= t -1.18e-144)
(/ x (/ (- t z) y))
(if (<= t 1.2) t_1 t_2))))))))
double code(double x, double y, double z, double t) {
double t_1 = x - (y * (x / z));
double t_2 = x * ((y - z) / t);
double tmp;
if (t <= -5.5e+72) {
tmp = t_2;
} else if (t <= -1.06e-17) {
tmp = t_1;
} else if (t <= -6.4e-81) {
tmp = x / (t / (y - z));
} else if (t <= -4.1e-107) {
tmp = t_1;
} else if (t <= -1.18e-144) {
tmp = x / ((t - z) / y);
} else if (t <= 1.2) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
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
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = x - (y * (x / z))
t_2 = x * ((y - z) / t)
if (t <= (-5.5d+72)) then
tmp = t_2
else if (t <= (-1.06d-17)) then
tmp = t_1
else if (t <= (-6.4d-81)) then
tmp = x / (t / (y - z))
else if (t <= (-4.1d-107)) then
tmp = t_1
else if (t <= (-1.18d-144)) then
tmp = x / ((t - z) / y)
else if (t <= 1.2d0) then
tmp = t_1
else
tmp = t_2
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = x - (y * (x / z));
double t_2 = x * ((y - z) / t);
double tmp;
if (t <= -5.5e+72) {
tmp = t_2;
} else if (t <= -1.06e-17) {
tmp = t_1;
} else if (t <= -6.4e-81) {
tmp = x / (t / (y - z));
} else if (t <= -4.1e-107) {
tmp = t_1;
} else if (t <= -1.18e-144) {
tmp = x / ((t - z) / y);
} else if (t <= 1.2) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t): t_1 = x - (y * (x / z)) t_2 = x * ((y - z) / t) tmp = 0 if t <= -5.5e+72: tmp = t_2 elif t <= -1.06e-17: tmp = t_1 elif t <= -6.4e-81: tmp = x / (t / (y - z)) elif t <= -4.1e-107: tmp = t_1 elif t <= -1.18e-144: tmp = x / ((t - z) / y) elif t <= 1.2: tmp = t_1 else: tmp = t_2 return tmp
function code(x, y, z, t) t_1 = Float64(x - Float64(y * Float64(x / z))) t_2 = Float64(x * Float64(Float64(y - z) / t)) tmp = 0.0 if (t <= -5.5e+72) tmp = t_2; elseif (t <= -1.06e-17) tmp = t_1; elseif (t <= -6.4e-81) tmp = Float64(x / Float64(t / Float64(y - z))); elseif (t <= -4.1e-107) tmp = t_1; elseif (t <= -1.18e-144) tmp = Float64(x / Float64(Float64(t - z) / y)); elseif (t <= 1.2) tmp = t_1; else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = x - (y * (x / z)); t_2 = x * ((y - z) / t); tmp = 0.0; if (t <= -5.5e+72) tmp = t_2; elseif (t <= -1.06e-17) tmp = t_1; elseif (t <= -6.4e-81) tmp = x / (t / (y - z)); elseif (t <= -4.1e-107) tmp = t_1; elseif (t <= -1.18e-144) tmp = x / ((t - z) / y); elseif (t <= 1.2) tmp = t_1; else tmp = t_2; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(x - N[(y * N[(x / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(x * N[(N[(y - z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -5.5e+72], t$95$2, If[LessEqual[t, -1.06e-17], t$95$1, If[LessEqual[t, -6.4e-81], N[(x / N[(t / N[(y - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, -4.1e-107], t$95$1, If[LessEqual[t, -1.18e-144], N[(x / N[(N[(t - z), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 1.2], t$95$1, t$95$2]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x - y \cdot \frac{x}{z}\\
t_2 := x \cdot \frac{y - z}{t}\\
\mathbf{if}\;t \leq -5.5 \cdot 10^{+72}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;t \leq -1.06 \cdot 10^{-17}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;t \leq -6.4 \cdot 10^{-81}:\\
\;\;\;\;\frac{x}{\frac{t}{y - z}}\\
\mathbf{elif}\;t \leq -4.1 \cdot 10^{-107}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;t \leq -1.18 \cdot 10^{-144}:\\
\;\;\;\;\frac{x}{\frac{t - z}{y}}\\
\mathbf{elif}\;t \leq 1.2:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;t_2\\
\end{array}
\end{array}
if t < -5.5e72 or 1.19999999999999996 < t Initial program 84.2%
*-commutative84.2%
associate-*l/97.9%
*-commutative97.9%
Simplified97.9%
Taylor expanded in t around inf 78.3%
if -5.5e72 < t < -1.06000000000000006e-17 or -6.4e-81 < t < -4.0999999999999999e-107 or -1.18e-144 < t < 1.19999999999999996Initial program 85.8%
*-commutative85.8%
associate-*l/96.8%
*-commutative96.8%
Simplified96.8%
Taylor expanded in t around 0 71.1%
mul-1-neg71.1%
associate-/l*83.2%
distribute-neg-frac83.2%
Simplified83.2%
Taylor expanded in z around 0 82.2%
mul-1-neg82.2%
unsub-neg82.2%
associate-*l/83.5%
*-commutative83.5%
Simplified83.5%
if -1.06000000000000006e-17 < t < -6.4e-81Initial program 99.6%
*-commutative99.6%
associate-*l/99.7%
*-commutative99.7%
Simplified99.7%
Taylor expanded in t around inf 68.0%
associate-/l*68.1%
Simplified68.1%
if -4.0999999999999999e-107 < t < -1.18e-144Initial program 99.8%
*-commutative99.8%
associate-*l/99.6%
*-commutative99.6%
Simplified99.6%
Taylor expanded in y around inf 94.2%
associate-/l*94.0%
Simplified94.0%
Final simplification80.8%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* x (/ (- y z) t))) (t_2 (- x (/ x (/ z y)))))
(if (<= t -5.8e+72)
t_1
(if (<= t -1.35e-17)
(- x (* y (/ x z)))
(if (<= t -5.2e-81)
(/ x (/ t (- y z)))
(if (<= t -2.75e-110)
t_2
(if (<= t -1.35e-161)
(/ (* x y) (- t z))
(if (<= t 4.6e-5) t_2 t_1))))))))
double code(double x, double y, double z, double t) {
double t_1 = x * ((y - z) / t);
double t_2 = x - (x / (z / y));
double tmp;
if (t <= -5.8e+72) {
tmp = t_1;
} else if (t <= -1.35e-17) {
tmp = x - (y * (x / z));
} else if (t <= -5.2e-81) {
tmp = x / (t / (y - z));
} else if (t <= -2.75e-110) {
tmp = t_2;
} else if (t <= -1.35e-161) {
tmp = (x * y) / (t - z);
} else if (t <= 4.6e-5) {
tmp = t_2;
} else {
tmp = t_1;
}
return tmp;
}
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
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = x * ((y - z) / t)
t_2 = x - (x / (z / y))
if (t <= (-5.8d+72)) then
tmp = t_1
else if (t <= (-1.35d-17)) then
tmp = x - (y * (x / z))
else if (t <= (-5.2d-81)) then
tmp = x / (t / (y - z))
else if (t <= (-2.75d-110)) then
tmp = t_2
else if (t <= (-1.35d-161)) then
tmp = (x * y) / (t - z)
else if (t <= 4.6d-5) then
tmp = t_2
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = x * ((y - z) / t);
double t_2 = x - (x / (z / y));
double tmp;
if (t <= -5.8e+72) {
tmp = t_1;
} else if (t <= -1.35e-17) {
tmp = x - (y * (x / z));
} else if (t <= -5.2e-81) {
tmp = x / (t / (y - z));
} else if (t <= -2.75e-110) {
tmp = t_2;
} else if (t <= -1.35e-161) {
tmp = (x * y) / (t - z);
} else if (t <= 4.6e-5) {
tmp = t_2;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = x * ((y - z) / t) t_2 = x - (x / (z / y)) tmp = 0 if t <= -5.8e+72: tmp = t_1 elif t <= -1.35e-17: tmp = x - (y * (x / z)) elif t <= -5.2e-81: tmp = x / (t / (y - z)) elif t <= -2.75e-110: tmp = t_2 elif t <= -1.35e-161: tmp = (x * y) / (t - z) elif t <= 4.6e-5: tmp = t_2 else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(x * Float64(Float64(y - z) / t)) t_2 = Float64(x - Float64(x / Float64(z / y))) tmp = 0.0 if (t <= -5.8e+72) tmp = t_1; elseif (t <= -1.35e-17) tmp = Float64(x - Float64(y * Float64(x / z))); elseif (t <= -5.2e-81) tmp = Float64(x / Float64(t / Float64(y - z))); elseif (t <= -2.75e-110) tmp = t_2; elseif (t <= -1.35e-161) tmp = Float64(Float64(x * y) / Float64(t - z)); elseif (t <= 4.6e-5) tmp = t_2; else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = x * ((y - z) / t); t_2 = x - (x / (z / y)); tmp = 0.0; if (t <= -5.8e+72) tmp = t_1; elseif (t <= -1.35e-17) tmp = x - (y * (x / z)); elseif (t <= -5.2e-81) tmp = x / (t / (y - z)); elseif (t <= -2.75e-110) tmp = t_2; elseif (t <= -1.35e-161) tmp = (x * y) / (t - z); elseif (t <= 4.6e-5) tmp = t_2; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(x * N[(N[(y - z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(x - N[(x / N[(z / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -5.8e+72], t$95$1, If[LessEqual[t, -1.35e-17], N[(x - N[(y * N[(x / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, -5.2e-81], N[(x / N[(t / N[(y - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, -2.75e-110], t$95$2, If[LessEqual[t, -1.35e-161], N[(N[(x * y), $MachinePrecision] / N[(t - z), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 4.6e-5], t$95$2, t$95$1]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot \frac{y - z}{t}\\
t_2 := x - \frac{x}{\frac{z}{y}}\\
\mathbf{if}\;t \leq -5.8 \cdot 10^{+72}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;t \leq -1.35 \cdot 10^{-17}:\\
\;\;\;\;x - y \cdot \frac{x}{z}\\
\mathbf{elif}\;t \leq -5.2 \cdot 10^{-81}:\\
\;\;\;\;\frac{x}{\frac{t}{y - z}}\\
\mathbf{elif}\;t \leq -2.75 \cdot 10^{-110}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;t \leq -1.35 \cdot 10^{-161}:\\
\;\;\;\;\frac{x \cdot y}{t - z}\\
\mathbf{elif}\;t \leq 4.6 \cdot 10^{-5}:\\
\;\;\;\;t_2\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if t < -5.80000000000000034e72 or 4.6e-5 < t Initial program 84.2%
*-commutative84.2%
associate-*l/97.9%
*-commutative97.9%
Simplified97.9%
Taylor expanded in t around inf 78.3%
if -5.80000000000000034e72 < t < -1.3500000000000001e-17Initial program 76.4%
*-commutative76.4%
associate-*l/99.8%
*-commutative99.8%
Simplified99.8%
Taylor expanded in t around 0 52.3%
mul-1-neg52.3%
associate-/l*75.8%
distribute-neg-frac75.8%
Simplified75.8%
Taylor expanded in z around 0 75.8%
mul-1-neg75.8%
unsub-neg75.8%
associate-*l/75.8%
*-commutative75.8%
Simplified75.8%
if -1.3500000000000001e-17 < t < -5.1999999999999998e-81Initial program 99.6%
*-commutative99.6%
associate-*l/99.7%
*-commutative99.7%
Simplified99.7%
Taylor expanded in t around inf 68.0%
associate-/l*68.1%
Simplified68.1%
if -5.1999999999999998e-81 < t < -2.7499999999999999e-110 or -1.35e-161 < t < 4.6e-5Initial program 87.5%
*-commutative87.5%
associate-*l/97.1%
*-commutative97.1%
Simplified97.1%
Taylor expanded in t around 0 75.4%
mul-1-neg75.4%
associate-/l*86.3%
distribute-neg-frac86.3%
Simplified86.3%
Taylor expanded in z around 0 84.1%
mul-1-neg84.1%
unsub-neg84.1%
associate-*l/84.8%
*-commutative84.8%
Simplified84.8%
associate-*r/84.1%
*-commutative84.1%
associate-/l*86.3%
Applied egg-rr86.3%
if -2.7499999999999999e-110 < t < -1.35e-161Initial program 100.0%
*-commutative100.0%
associate-*l/90.1%
*-commutative90.1%
Simplified90.1%
Taylor expanded in y around inf 85.7%
Final simplification81.0%
(FPCore (x y z t)
:precision binary64
(if (<= z -1.85e+143)
x
(if (<= z -2.1e+95)
(* x (- (/ y z)))
(if (<= z -1.7e+46) x (if (<= z 850000000.0) (* x (/ y t)) x)))))
double code(double x, double y, double z, double t) {
double tmp;
if (z <= -1.85e+143) {
tmp = x;
} else if (z <= -2.1e+95) {
tmp = x * -(y / z);
} else if (z <= -1.7e+46) {
tmp = x;
} else if (z <= 850000000.0) {
tmp = x * (y / t);
} else {
tmp = x;
}
return tmp;
}
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
real(8) :: tmp
if (z <= (-1.85d+143)) then
tmp = x
else if (z <= (-2.1d+95)) then
tmp = x * -(y / z)
else if (z <= (-1.7d+46)) then
tmp = x
else if (z <= 850000000.0d0) then
tmp = x * (y / t)
else
tmp = x
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (z <= -1.85e+143) {
tmp = x;
} else if (z <= -2.1e+95) {
tmp = x * -(y / z);
} else if (z <= -1.7e+46) {
tmp = x;
} else if (z <= 850000000.0) {
tmp = x * (y / t);
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if z <= -1.85e+143: tmp = x elif z <= -2.1e+95: tmp = x * -(y / z) elif z <= -1.7e+46: tmp = x elif z <= 850000000.0: tmp = x * (y / t) else: tmp = x return tmp
function code(x, y, z, t) tmp = 0.0 if (z <= -1.85e+143) tmp = x; elseif (z <= -2.1e+95) tmp = Float64(x * Float64(-Float64(y / z))); elseif (z <= -1.7e+46) tmp = x; elseif (z <= 850000000.0) tmp = Float64(x * Float64(y / t)); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (z <= -1.85e+143) tmp = x; elseif (z <= -2.1e+95) tmp = x * -(y / z); elseif (z <= -1.7e+46) tmp = x; elseif (z <= 850000000.0) tmp = x * (y / t); else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[z, -1.85e+143], x, If[LessEqual[z, -2.1e+95], N[(x * (-N[(y / z), $MachinePrecision])), $MachinePrecision], If[LessEqual[z, -1.7e+46], x, If[LessEqual[z, 850000000.0], N[(x * N[(y / t), $MachinePrecision]), $MachinePrecision], x]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.85 \cdot 10^{+143}:\\
\;\;\;\;x\\
\mathbf{elif}\;z \leq -2.1 \cdot 10^{+95}:\\
\;\;\;\;x \cdot \left(-\frac{y}{z}\right)\\
\mathbf{elif}\;z \leq -1.7 \cdot 10^{+46}:\\
\;\;\;\;x\\
\mathbf{elif}\;z \leq 850000000:\\
\;\;\;\;x \cdot \frac{y}{t}\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if z < -1.8500000000000001e143 or -2.1e95 < z < -1.6999999999999999e46 or 8.5e8 < z Initial program 75.4%
*-commutative75.4%
associate-*l/100.0%
*-commutative100.0%
Simplified100.0%
Taylor expanded in z around inf 64.0%
if -1.8500000000000001e143 < z < -2.1e95Initial program 89.7%
*-commutative89.7%
associate-*l/99.7%
*-commutative99.7%
Simplified99.7%
Taylor expanded in y around inf 67.9%
Taylor expanded in t around 0 57.5%
associate-*r/57.5%
neg-mul-157.5%
Simplified57.5%
if -1.6999999999999999e46 < z < 8.5e8Initial program 93.9%
*-commutative93.9%
associate-*l/95.6%
*-commutative95.6%
Simplified95.6%
Taylor expanded in z around 0 58.9%
Final simplification60.9%
(FPCore (x y z t) :precision binary64 (if (or (<= y -4.5e+24) (not (<= y 0.0275))) (/ x (/ (- t z) y)) (* x (/ (- z) (- t z)))))
double code(double x, double y, double z, double t) {
double tmp;
if ((y <= -4.5e+24) || !(y <= 0.0275)) {
tmp = x / ((t - z) / y);
} else {
tmp = x * (-z / (t - z));
}
return tmp;
}
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
real(8) :: tmp
if ((y <= (-4.5d+24)) .or. (.not. (y <= 0.0275d0))) then
tmp = x / ((t - z) / y)
else
tmp = x * (-z / (t - z))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((y <= -4.5e+24) || !(y <= 0.0275)) {
tmp = x / ((t - z) / y);
} else {
tmp = x * (-z / (t - z));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (y <= -4.5e+24) or not (y <= 0.0275): tmp = x / ((t - z) / y) else: tmp = x * (-z / (t - z)) return tmp
function code(x, y, z, t) tmp = 0.0 if ((y <= -4.5e+24) || !(y <= 0.0275)) tmp = Float64(x / Float64(Float64(t - z) / y)); else tmp = Float64(x * Float64(Float64(-z) / Float64(t - z))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((y <= -4.5e+24) || ~((y <= 0.0275))) tmp = x / ((t - z) / y); else tmp = x * (-z / (t - z)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[y, -4.5e+24], N[Not[LessEqual[y, 0.0275]], $MachinePrecision]], N[(x / N[(N[(t - z), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision], N[(x * N[((-z) / N[(t - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -4.5 \cdot 10^{+24} \lor \neg \left(y \leq 0.0275\right):\\
\;\;\;\;\frac{x}{\frac{t - z}{y}}\\
\mathbf{else}:\\
\;\;\;\;x \cdot \frac{-z}{t - z}\\
\end{array}
\end{array}
if y < -4.50000000000000019e24 or 0.0275000000000000001 < y Initial program 83.6%
*-commutative83.6%
associate-*l/96.7%
*-commutative96.7%
Simplified96.7%
Taylor expanded in y around inf 76.2%
associate-/l*83.3%
Simplified83.3%
if -4.50000000000000019e24 < y < 0.0275000000000000001Initial program 88.6%
*-commutative88.6%
associate-*l/98.2%
*-commutative98.2%
Simplified98.2%
Taylor expanded in y around 0 80.6%
neg-mul-180.6%
distribute-neg-frac80.6%
Simplified80.6%
Final simplification81.9%
(FPCore (x y z t) :precision binary64 (if (<= z -8.5e+165) x (if (<= z 8.2e+65) (* x (/ y (- t z))) x)))
double code(double x, double y, double z, double t) {
double tmp;
if (z <= -8.5e+165) {
tmp = x;
} else if (z <= 8.2e+65) {
tmp = x * (y / (t - z));
} else {
tmp = x;
}
return tmp;
}
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
real(8) :: tmp
if (z <= (-8.5d+165)) then
tmp = x
else if (z <= 8.2d+65) then
tmp = x * (y / (t - z))
else
tmp = x
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (z <= -8.5e+165) {
tmp = x;
} else if (z <= 8.2e+65) {
tmp = x * (y / (t - z));
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if z <= -8.5e+165: tmp = x elif z <= 8.2e+65: tmp = x * (y / (t - z)) else: tmp = x return tmp
function code(x, y, z, t) tmp = 0.0 if (z <= -8.5e+165) tmp = x; elseif (z <= 8.2e+65) tmp = Float64(x * Float64(y / Float64(t - z))); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (z <= -8.5e+165) tmp = x; elseif (z <= 8.2e+65) tmp = x * (y / (t - z)); else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[z, -8.5e+165], x, If[LessEqual[z, 8.2e+65], N[(x * N[(y / N[(t - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], x]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -8.5 \cdot 10^{+165}:\\
\;\;\;\;x\\
\mathbf{elif}\;z \leq 8.2 \cdot 10^{+65}:\\
\;\;\;\;x \cdot \frac{y}{t - z}\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if z < -8.5000000000000001e165 or 8.2000000000000003e65 < z Initial program 70.5%
*-commutative70.5%
associate-*l/100.0%
*-commutative100.0%
Simplified100.0%
Taylor expanded in z around inf 69.9%
if -8.5000000000000001e165 < z < 8.2000000000000003e65Initial program 92.6%
*-commutative92.6%
associate-*l/96.5%
*-commutative96.5%
Simplified96.5%
Taylor expanded in y around inf 70.6%
Final simplification70.4%
(FPCore (x y z t) :precision binary64 (if (<= z -4.5e+46) x (if (<= z 4800000000.0) (* x (/ y t)) x)))
double code(double x, double y, double z, double t) {
double tmp;
if (z <= -4.5e+46) {
tmp = x;
} else if (z <= 4800000000.0) {
tmp = x * (y / t);
} else {
tmp = x;
}
return tmp;
}
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
real(8) :: tmp
if (z <= (-4.5d+46)) then
tmp = x
else if (z <= 4800000000.0d0) then
tmp = x * (y / t)
else
tmp = x
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (z <= -4.5e+46) {
tmp = x;
} else if (z <= 4800000000.0) {
tmp = x * (y / t);
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if z <= -4.5e+46: tmp = x elif z <= 4800000000.0: tmp = x * (y / t) else: tmp = x return tmp
function code(x, y, z, t) tmp = 0.0 if (z <= -4.5e+46) tmp = x; elseif (z <= 4800000000.0) tmp = Float64(x * Float64(y / t)); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (z <= -4.5e+46) tmp = x; elseif (z <= 4800000000.0) tmp = x * (y / t); else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[z, -4.5e+46], x, If[LessEqual[z, 4800000000.0], N[(x * N[(y / t), $MachinePrecision]), $MachinePrecision], x]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -4.5 \cdot 10^{+46}:\\
\;\;\;\;x\\
\mathbf{elif}\;z \leq 4800000000:\\
\;\;\;\;x \cdot \frac{y}{t}\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if z < -4.5000000000000001e46 or 4.8e9 < z Initial program 76.5%
*-commutative76.5%
associate-*l/99.9%
*-commutative99.9%
Simplified99.9%
Taylor expanded in z around inf 59.3%
if -4.5000000000000001e46 < z < 4.8e9Initial program 93.9%
*-commutative93.9%
associate-*l/95.6%
*-commutative95.6%
Simplified95.6%
Taylor expanded in z around 0 58.9%
Final simplification59.0%
(FPCore (x y z t) :precision binary64 x)
double code(double x, double y, double z, double t) {
return x;
}
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
end function
public static double code(double x, double y, double z, double t) {
return x;
}
def code(x, y, z, t): return x
function code(x, y, z, t) return x end
function tmp = code(x, y, z, t) tmp = x; end
code[x_, y_, z_, t_] := x
\begin{array}{l}
\\
x
\end{array}
Initial program 86.2%
*-commutative86.2%
associate-*l/97.5%
*-commutative97.5%
Simplified97.5%
Taylor expanded in z around inf 31.7%
Final simplification31.7%
(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 2024024
(FPCore (x y z t)
:name "Graphics.Rendering.Chart.Plot.AreaSpots:renderAreaSpots4D from Chart-1.5.3"
:precision binary64
:herbie-target
(/ x (/ (- t z) (- y z)))
(/ (* x (- y z)) (- t z)))