
(FPCore (x y z t) :precision binary64 (* (/ (- x y) (- z y)) t))
double code(double x, double y, double z, double t) {
return ((x - y) / (z - y)) * t;
}
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 - y)) * t
end function
public static double code(double x, double y, double z, double t) {
return ((x - y) / (z - y)) * t;
}
def code(x, y, z, t): return ((x - y) / (z - y)) * t
function code(x, y, z, t) return Float64(Float64(Float64(x - y) / Float64(z - y)) * t) end
function tmp = code(x, y, z, t) tmp = ((x - y) / (z - y)) * t; end
code[x_, y_, z_, t_] := N[(N[(N[(x - y), $MachinePrecision] / N[(z - y), $MachinePrecision]), $MachinePrecision] * t), $MachinePrecision]
\begin{array}{l}
\\
\frac{x - y}{z - y} \cdot t
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 12 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t) :precision binary64 (* (/ (- x y) (- z y)) t))
double code(double x, double y, double z, double t) {
return ((x - y) / (z - y)) * t;
}
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 - y)) * t
end function
public static double code(double x, double y, double z, double t) {
return ((x - y) / (z - y)) * t;
}
def code(x, y, z, t): return ((x - y) / (z - y)) * t
function code(x, y, z, t) return Float64(Float64(Float64(x - y) / Float64(z - y)) * t) end
function tmp = code(x, y, z, t) tmp = ((x - y) / (z - y)) * t; end
code[x_, y_, z_, t_] := N[(N[(N[(x - y), $MachinePrecision] / N[(z - y), $MachinePrecision]), $MachinePrecision] * t), $MachinePrecision]
\begin{array}{l}
\\
\frac{x - y}{z - y} \cdot t
\end{array}
(FPCore (x y z t) :precision binary64 (/ t (/ (- z y) (- x y))))
double code(double x, double y, double z, double t) {
return t / ((z - y) / (x - y));
}
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 = t / ((z - y) / (x - y))
end function
public static double code(double x, double y, double z, double t) {
return t / ((z - y) / (x - y));
}
def code(x, y, z, t): return t / ((z - y) / (x - y))
function code(x, y, z, t) return Float64(t / Float64(Float64(z - y) / Float64(x - y))) end
function tmp = code(x, y, z, t) tmp = t / ((z - y) / (x - y)); end
code[x_, y_, z_, t_] := N[(t / N[(N[(z - y), $MachinePrecision] / N[(x - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{t}{\frac{z - y}{x - y}}
\end{array}
Initial program 97.6%
associate-*l/83.0%
associate-*r/82.1%
Simplified82.1%
associate-*r/83.0%
associate-*l/97.6%
*-commutative97.6%
clear-num97.6%
un-div-inv97.6%
Applied egg-rr97.6%
Final simplification97.6%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* t (- 1.0 (/ x y)))))
(if (<= y -48.0)
t_1
(if (<= y -1.16e-29)
(* (- x y) (/ t z))
(if (<= y -3.2e-37)
t_1
(if (<= y 5.5e+16)
(* t (/ x (- z y)))
(if (<= y 6.2e+77) (* t (/ (- x y) z)) t_1)))))))
double code(double x, double y, double z, double t) {
double t_1 = t * (1.0 - (x / y));
double tmp;
if (y <= -48.0) {
tmp = t_1;
} else if (y <= -1.16e-29) {
tmp = (x - y) * (t / z);
} else if (y <= -3.2e-37) {
tmp = t_1;
} else if (y <= 5.5e+16) {
tmp = t * (x / (z - y));
} else if (y <= 6.2e+77) {
tmp = t * ((x - y) / z);
} 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) :: tmp
t_1 = t * (1.0d0 - (x / y))
if (y <= (-48.0d0)) then
tmp = t_1
else if (y <= (-1.16d-29)) then
tmp = (x - y) * (t / z)
else if (y <= (-3.2d-37)) then
tmp = t_1
else if (y <= 5.5d+16) then
tmp = t * (x / (z - y))
else if (y <= 6.2d+77) then
tmp = t * ((x - y) / z)
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 = t * (1.0 - (x / y));
double tmp;
if (y <= -48.0) {
tmp = t_1;
} else if (y <= -1.16e-29) {
tmp = (x - y) * (t / z);
} else if (y <= -3.2e-37) {
tmp = t_1;
} else if (y <= 5.5e+16) {
tmp = t * (x / (z - y));
} else if (y <= 6.2e+77) {
tmp = t * ((x - y) / z);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = t * (1.0 - (x / y)) tmp = 0 if y <= -48.0: tmp = t_1 elif y <= -1.16e-29: tmp = (x - y) * (t / z) elif y <= -3.2e-37: tmp = t_1 elif y <= 5.5e+16: tmp = t * (x / (z - y)) elif y <= 6.2e+77: tmp = t * ((x - y) / z) else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(t * Float64(1.0 - Float64(x / y))) tmp = 0.0 if (y <= -48.0) tmp = t_1; elseif (y <= -1.16e-29) tmp = Float64(Float64(x - y) * Float64(t / z)); elseif (y <= -3.2e-37) tmp = t_1; elseif (y <= 5.5e+16) tmp = Float64(t * Float64(x / Float64(z - y))); elseif (y <= 6.2e+77) tmp = Float64(t * Float64(Float64(x - y) / z)); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = t * (1.0 - (x / y)); tmp = 0.0; if (y <= -48.0) tmp = t_1; elseif (y <= -1.16e-29) tmp = (x - y) * (t / z); elseif (y <= -3.2e-37) tmp = t_1; elseif (y <= 5.5e+16) tmp = t * (x / (z - y)); elseif (y <= 6.2e+77) tmp = t * ((x - y) / z); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(t * N[(1.0 - N[(x / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -48.0], t$95$1, If[LessEqual[y, -1.16e-29], N[(N[(x - y), $MachinePrecision] * N[(t / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, -3.2e-37], t$95$1, If[LessEqual[y, 5.5e+16], N[(t * N[(x / N[(z - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 6.2e+77], N[(t * N[(N[(x - y), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision], t$95$1]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := t \cdot \left(1 - \frac{x}{y}\right)\\
\mathbf{if}\;y \leq -48:\\
\;\;\;\;t_1\\
\mathbf{elif}\;y \leq -1.16 \cdot 10^{-29}:\\
\;\;\;\;\left(x - y\right) \cdot \frac{t}{z}\\
\mathbf{elif}\;y \leq -3.2 \cdot 10^{-37}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;y \leq 5.5 \cdot 10^{+16}:\\
\;\;\;\;t \cdot \frac{x}{z - y}\\
\mathbf{elif}\;y \leq 6.2 \cdot 10^{+77}:\\
\;\;\;\;t \cdot \frac{x - y}{z}\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if y < -48 or -1.15999999999999996e-29 < y < -3.1999999999999999e-37 or 6.19999999999999997e77 < y Initial program 99.9%
associate-*l/72.4%
associate-*r/69.5%
Simplified69.5%
Taylor expanded in z around 0 59.4%
associate-*r/59.4%
*-commutative59.4%
neg-mul-159.4%
distribute-rgt-neg-in59.4%
Simplified59.4%
Taylor expanded in x around 0 76.4%
mul-1-neg76.4%
unsub-neg76.4%
associate-/l*85.3%
associate-/r/80.5%
Simplified80.5%
Taylor expanded in t around 0 85.3%
if -48 < y < -1.15999999999999996e-29Initial program 99.3%
associate-*l/86.0%
associate-*r/99.1%
Simplified99.1%
Taylor expanded in z around inf 85.3%
if -3.1999999999999999e-37 < y < 5.5e16Initial program 95.0%
Taylor expanded in x around inf 81.7%
if 5.5e16 < y < 6.19999999999999997e77Initial program 99.8%
Taylor expanded in z around inf 70.0%
Final simplification82.7%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* t (- 1.0 (/ x y)))))
(if (<= y -50.0)
t_1
(if (<= y -1.4e-30)
(* (- x y) (/ t z))
(if (<= y -4.4e-37)
t_1
(if (<= y 1.85e+15)
(/ t (/ (- z y) x))
(if (<= y 6e+77) (* t (/ (- x y) z)) t_1)))))))
double code(double x, double y, double z, double t) {
double t_1 = t * (1.0 - (x / y));
double tmp;
if (y <= -50.0) {
tmp = t_1;
} else if (y <= -1.4e-30) {
tmp = (x - y) * (t / z);
} else if (y <= -4.4e-37) {
tmp = t_1;
} else if (y <= 1.85e+15) {
tmp = t / ((z - y) / x);
} else if (y <= 6e+77) {
tmp = t * ((x - y) / z);
} 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) :: tmp
t_1 = t * (1.0d0 - (x / y))
if (y <= (-50.0d0)) then
tmp = t_1
else if (y <= (-1.4d-30)) then
tmp = (x - y) * (t / z)
else if (y <= (-4.4d-37)) then
tmp = t_1
else if (y <= 1.85d+15) then
tmp = t / ((z - y) / x)
else if (y <= 6d+77) then
tmp = t * ((x - y) / z)
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 = t * (1.0 - (x / y));
double tmp;
if (y <= -50.0) {
tmp = t_1;
} else if (y <= -1.4e-30) {
tmp = (x - y) * (t / z);
} else if (y <= -4.4e-37) {
tmp = t_1;
} else if (y <= 1.85e+15) {
tmp = t / ((z - y) / x);
} else if (y <= 6e+77) {
tmp = t * ((x - y) / z);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = t * (1.0 - (x / y)) tmp = 0 if y <= -50.0: tmp = t_1 elif y <= -1.4e-30: tmp = (x - y) * (t / z) elif y <= -4.4e-37: tmp = t_1 elif y <= 1.85e+15: tmp = t / ((z - y) / x) elif y <= 6e+77: tmp = t * ((x - y) / z) else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(t * Float64(1.0 - Float64(x / y))) tmp = 0.0 if (y <= -50.0) tmp = t_1; elseif (y <= -1.4e-30) tmp = Float64(Float64(x - y) * Float64(t / z)); elseif (y <= -4.4e-37) tmp = t_1; elseif (y <= 1.85e+15) tmp = Float64(t / Float64(Float64(z - y) / x)); elseif (y <= 6e+77) tmp = Float64(t * Float64(Float64(x - y) / z)); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = t * (1.0 - (x / y)); tmp = 0.0; if (y <= -50.0) tmp = t_1; elseif (y <= -1.4e-30) tmp = (x - y) * (t / z); elseif (y <= -4.4e-37) tmp = t_1; elseif (y <= 1.85e+15) tmp = t / ((z - y) / x); elseif (y <= 6e+77) tmp = t * ((x - y) / z); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(t * N[(1.0 - N[(x / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -50.0], t$95$1, If[LessEqual[y, -1.4e-30], N[(N[(x - y), $MachinePrecision] * N[(t / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, -4.4e-37], t$95$1, If[LessEqual[y, 1.85e+15], N[(t / N[(N[(z - y), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 6e+77], N[(t * N[(N[(x - y), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision], t$95$1]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := t \cdot \left(1 - \frac{x}{y}\right)\\
\mathbf{if}\;y \leq -50:\\
\;\;\;\;t_1\\
\mathbf{elif}\;y \leq -1.4 \cdot 10^{-30}:\\
\;\;\;\;\left(x - y\right) \cdot \frac{t}{z}\\
\mathbf{elif}\;y \leq -4.4 \cdot 10^{-37}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;y \leq 1.85 \cdot 10^{+15}:\\
\;\;\;\;\frac{t}{\frac{z - y}{x}}\\
\mathbf{elif}\;y \leq 6 \cdot 10^{+77}:\\
\;\;\;\;t \cdot \frac{x - y}{z}\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if y < -50 or -1.39999999999999994e-30 < y < -4.40000000000000004e-37 or 5.9999999999999996e77 < y Initial program 99.9%
associate-*l/72.4%
associate-*r/69.5%
Simplified69.5%
Taylor expanded in z around 0 59.4%
associate-*r/59.4%
*-commutative59.4%
neg-mul-159.4%
distribute-rgt-neg-in59.4%
Simplified59.4%
Taylor expanded in x around 0 76.4%
mul-1-neg76.4%
unsub-neg76.4%
associate-/l*85.3%
associate-/r/80.5%
Simplified80.5%
Taylor expanded in t around 0 85.3%
if -50 < y < -1.39999999999999994e-30Initial program 99.3%
associate-*l/86.0%
associate-*r/99.1%
Simplified99.1%
Taylor expanded in z around inf 85.3%
if -4.40000000000000004e-37 < y < 1.85e15Initial program 95.0%
associate-*l/95.3%
associate-*r/93.5%
Simplified93.5%
associate-*r/95.3%
clear-num95.1%
Applied egg-rr95.1%
Taylor expanded in x around inf 80.5%
associate-/l*81.7%
Simplified81.7%
if 1.85e15 < y < 5.9999999999999996e77Initial program 99.8%
Taylor expanded in z around inf 70.0%
Final simplification82.7%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* t (- 1.0 (/ x y)))))
(if (<= y -95.0)
t_1
(if (<= y -2.05e-30)
(* (- x y) (/ t z))
(if (or (<= y -1.25e-37) (not (<= y 1.4e+53)))
t_1
(* x (/ t (- z y))))))))
double code(double x, double y, double z, double t) {
double t_1 = t * (1.0 - (x / y));
double tmp;
if (y <= -95.0) {
tmp = t_1;
} else if (y <= -2.05e-30) {
tmp = (x - y) * (t / z);
} else if ((y <= -1.25e-37) || !(y <= 1.4e+53)) {
tmp = t_1;
} else {
tmp = x * (t / (z - y));
}
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) :: tmp
t_1 = t * (1.0d0 - (x / y))
if (y <= (-95.0d0)) then
tmp = t_1
else if (y <= (-2.05d-30)) then
tmp = (x - y) * (t / z)
else if ((y <= (-1.25d-37)) .or. (.not. (y <= 1.4d+53))) then
tmp = t_1
else
tmp = x * (t / (z - y))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = t * (1.0 - (x / y));
double tmp;
if (y <= -95.0) {
tmp = t_1;
} else if (y <= -2.05e-30) {
tmp = (x - y) * (t / z);
} else if ((y <= -1.25e-37) || !(y <= 1.4e+53)) {
tmp = t_1;
} else {
tmp = x * (t / (z - y));
}
return tmp;
}
def code(x, y, z, t): t_1 = t * (1.0 - (x / y)) tmp = 0 if y <= -95.0: tmp = t_1 elif y <= -2.05e-30: tmp = (x - y) * (t / z) elif (y <= -1.25e-37) or not (y <= 1.4e+53): tmp = t_1 else: tmp = x * (t / (z - y)) return tmp
function code(x, y, z, t) t_1 = Float64(t * Float64(1.0 - Float64(x / y))) tmp = 0.0 if (y <= -95.0) tmp = t_1; elseif (y <= -2.05e-30) tmp = Float64(Float64(x - y) * Float64(t / z)); elseif ((y <= -1.25e-37) || !(y <= 1.4e+53)) tmp = t_1; else tmp = Float64(x * Float64(t / Float64(z - y))); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = t * (1.0 - (x / y)); tmp = 0.0; if (y <= -95.0) tmp = t_1; elseif (y <= -2.05e-30) tmp = (x - y) * (t / z); elseif ((y <= -1.25e-37) || ~((y <= 1.4e+53))) tmp = t_1; else tmp = x * (t / (z - y)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(t * N[(1.0 - N[(x / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -95.0], t$95$1, If[LessEqual[y, -2.05e-30], N[(N[(x - y), $MachinePrecision] * N[(t / z), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[y, -1.25e-37], N[Not[LessEqual[y, 1.4e+53]], $MachinePrecision]], t$95$1, N[(x * N[(t / N[(z - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := t \cdot \left(1 - \frac{x}{y}\right)\\
\mathbf{if}\;y \leq -95:\\
\;\;\;\;t_1\\
\mathbf{elif}\;y \leq -2.05 \cdot 10^{-30}:\\
\;\;\;\;\left(x - y\right) \cdot \frac{t}{z}\\
\mathbf{elif}\;y \leq -1.25 \cdot 10^{-37} \lor \neg \left(y \leq 1.4 \cdot 10^{+53}\right):\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;x \cdot \frac{t}{z - y}\\
\end{array}
\end{array}
if y < -95 or -2.0500000000000002e-30 < y < -1.2499999999999999e-37 or 1.4e53 < y Initial program 99.9%
associate-*l/72.4%
associate-*r/69.9%
Simplified69.9%
Taylor expanded in z around 0 56.6%
associate-*r/56.6%
*-commutative56.6%
neg-mul-156.6%
distribute-rgt-neg-in56.6%
Simplified56.6%
Taylor expanded in x around 0 73.6%
mul-1-neg73.6%
unsub-neg73.6%
associate-/l*81.9%
associate-/r/77.5%
Simplified77.5%
Taylor expanded in t around 0 81.9%
if -95 < y < -2.0500000000000002e-30Initial program 99.3%
associate-*l/86.0%
associate-*r/99.1%
Simplified99.1%
Taylor expanded in z around inf 85.3%
if -1.2499999999999999e-37 < y < 1.4e53Initial program 95.2%
associate-*l/94.0%
associate-*r/93.8%
Simplified93.8%
Taylor expanded in x around inf 78.4%
associate-*l/77.9%
*-commutative77.9%
Simplified77.9%
Final simplification80.1%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* t (- 1.0 (/ x y)))))
(if (<= y -85.0)
t_1
(if (<= y -3.9e-30)
(* (- x y) (/ t z))
(if (or (<= y -4.4e-37) (not (<= y 1.25e+53)))
t_1
(* t (/ x (- z y))))))))
double code(double x, double y, double z, double t) {
double t_1 = t * (1.0 - (x / y));
double tmp;
if (y <= -85.0) {
tmp = t_1;
} else if (y <= -3.9e-30) {
tmp = (x - y) * (t / z);
} else if ((y <= -4.4e-37) || !(y <= 1.25e+53)) {
tmp = t_1;
} else {
tmp = t * (x / (z - y));
}
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) :: tmp
t_1 = t * (1.0d0 - (x / y))
if (y <= (-85.0d0)) then
tmp = t_1
else if (y <= (-3.9d-30)) then
tmp = (x - y) * (t / z)
else if ((y <= (-4.4d-37)) .or. (.not. (y <= 1.25d+53))) then
tmp = t_1
else
tmp = t * (x / (z - y))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = t * (1.0 - (x / y));
double tmp;
if (y <= -85.0) {
tmp = t_1;
} else if (y <= -3.9e-30) {
tmp = (x - y) * (t / z);
} else if ((y <= -4.4e-37) || !(y <= 1.25e+53)) {
tmp = t_1;
} else {
tmp = t * (x / (z - y));
}
return tmp;
}
def code(x, y, z, t): t_1 = t * (1.0 - (x / y)) tmp = 0 if y <= -85.0: tmp = t_1 elif y <= -3.9e-30: tmp = (x - y) * (t / z) elif (y <= -4.4e-37) or not (y <= 1.25e+53): tmp = t_1 else: tmp = t * (x / (z - y)) return tmp
function code(x, y, z, t) t_1 = Float64(t * Float64(1.0 - Float64(x / y))) tmp = 0.0 if (y <= -85.0) tmp = t_1; elseif (y <= -3.9e-30) tmp = Float64(Float64(x - y) * Float64(t / z)); elseif ((y <= -4.4e-37) || !(y <= 1.25e+53)) tmp = t_1; else tmp = Float64(t * Float64(x / Float64(z - y))); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = t * (1.0 - (x / y)); tmp = 0.0; if (y <= -85.0) tmp = t_1; elseif (y <= -3.9e-30) tmp = (x - y) * (t / z); elseif ((y <= -4.4e-37) || ~((y <= 1.25e+53))) tmp = t_1; else tmp = t * (x / (z - y)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(t * N[(1.0 - N[(x / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -85.0], t$95$1, If[LessEqual[y, -3.9e-30], N[(N[(x - y), $MachinePrecision] * N[(t / z), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[y, -4.4e-37], N[Not[LessEqual[y, 1.25e+53]], $MachinePrecision]], t$95$1, N[(t * N[(x / N[(z - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := t \cdot \left(1 - \frac{x}{y}\right)\\
\mathbf{if}\;y \leq -85:\\
\;\;\;\;t_1\\
\mathbf{elif}\;y \leq -3.9 \cdot 10^{-30}:\\
\;\;\;\;\left(x - y\right) \cdot \frac{t}{z}\\
\mathbf{elif}\;y \leq -4.4 \cdot 10^{-37} \lor \neg \left(y \leq 1.25 \cdot 10^{+53}\right):\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;t \cdot \frac{x}{z - y}\\
\end{array}
\end{array}
if y < -85 or -3.9000000000000003e-30 < y < -4.40000000000000004e-37 or 1.2500000000000001e53 < y Initial program 99.9%
associate-*l/72.4%
associate-*r/69.9%
Simplified69.9%
Taylor expanded in z around 0 56.6%
associate-*r/56.6%
*-commutative56.6%
neg-mul-156.6%
distribute-rgt-neg-in56.6%
Simplified56.6%
Taylor expanded in x around 0 73.6%
mul-1-neg73.6%
unsub-neg73.6%
associate-/l*81.9%
associate-/r/77.5%
Simplified77.5%
Taylor expanded in t around 0 81.9%
if -85 < y < -3.9000000000000003e-30Initial program 99.3%
associate-*l/86.0%
associate-*r/99.1%
Simplified99.1%
Taylor expanded in z around inf 85.3%
if -4.40000000000000004e-37 < y < 1.2500000000000001e53Initial program 95.2%
Taylor expanded in x around inf 80.2%
Final simplification81.2%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (/ t (/ (- z y) x))))
(if (<= x -0.0071)
t_1
(if (<= x 5.4e-74)
(* t (/ (- y) (- z y)))
(if (<= x 2.35e+73) (* t (- 1.0 (/ x y))) t_1)))))
double code(double x, double y, double z, double t) {
double t_1 = t / ((z - y) / x);
double tmp;
if (x <= -0.0071) {
tmp = t_1;
} else if (x <= 5.4e-74) {
tmp = t * (-y / (z - y));
} else if (x <= 2.35e+73) {
tmp = t * (1.0 - (x / y));
} 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) :: tmp
t_1 = t / ((z - y) / x)
if (x <= (-0.0071d0)) then
tmp = t_1
else if (x <= 5.4d-74) then
tmp = t * (-y / (z - y))
else if (x <= 2.35d+73) then
tmp = t * (1.0d0 - (x / y))
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 = t / ((z - y) / x);
double tmp;
if (x <= -0.0071) {
tmp = t_1;
} else if (x <= 5.4e-74) {
tmp = t * (-y / (z - y));
} else if (x <= 2.35e+73) {
tmp = t * (1.0 - (x / y));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = t / ((z - y) / x) tmp = 0 if x <= -0.0071: tmp = t_1 elif x <= 5.4e-74: tmp = t * (-y / (z - y)) elif x <= 2.35e+73: tmp = t * (1.0 - (x / y)) else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(t / Float64(Float64(z - y) / x)) tmp = 0.0 if (x <= -0.0071) tmp = t_1; elseif (x <= 5.4e-74) tmp = Float64(t * Float64(Float64(-y) / Float64(z - y))); elseif (x <= 2.35e+73) tmp = Float64(t * Float64(1.0 - Float64(x / y))); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = t / ((z - y) / x); tmp = 0.0; if (x <= -0.0071) tmp = t_1; elseif (x <= 5.4e-74) tmp = t * (-y / (z - y)); elseif (x <= 2.35e+73) tmp = t * (1.0 - (x / y)); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(t / N[(N[(z - y), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -0.0071], t$95$1, If[LessEqual[x, 5.4e-74], N[(t * N[((-y) / N[(z - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 2.35e+73], N[(t * N[(1.0 - N[(x / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{t}{\frac{z - y}{x}}\\
\mathbf{if}\;x \leq -0.0071:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \leq 5.4 \cdot 10^{-74}:\\
\;\;\;\;t \cdot \frac{-y}{z - y}\\
\mathbf{elif}\;x \leq 2.35 \cdot 10^{+73}:\\
\;\;\;\;t \cdot \left(1 - \frac{x}{y}\right)\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if x < -0.0071000000000000004 or 2.3500000000000001e73 < x Initial program 98.2%
associate-*l/82.4%
associate-*r/82.1%
Simplified82.1%
associate-*r/82.4%
clear-num82.4%
Applied egg-rr82.4%
Taylor expanded in x around inf 69.6%
associate-/l*77.2%
Simplified77.2%
if -0.0071000000000000004 < x < 5.40000000000000036e-74Initial program 96.5%
Taylor expanded in x around 0 85.5%
neg-mul-185.5%
distribute-neg-frac85.5%
Simplified85.5%
if 5.40000000000000036e-74 < x < 2.3500000000000001e73Initial program 99.9%
associate-*l/78.8%
associate-*r/78.6%
Simplified78.6%
Taylor expanded in z around 0 57.5%
associate-*r/57.5%
*-commutative57.5%
neg-mul-157.5%
distribute-rgt-neg-in57.5%
Simplified57.5%
Taylor expanded in x around 0 78.5%
mul-1-neg78.5%
unsub-neg78.5%
associate-/l*78.5%
associate-/r/78.5%
Simplified78.5%
Taylor expanded in t around 0 78.5%
Final simplification80.9%
(FPCore (x y z t) :precision binary64 (if (or (<= y -6.8e+172) (not (<= y 3e+131))) (* t (- 1.0 (/ x y))) (* (- x y) (/ t (- z y)))))
double code(double x, double y, double z, double t) {
double tmp;
if ((y <= -6.8e+172) || !(y <= 3e+131)) {
tmp = t * (1.0 - (x / y));
} else {
tmp = (x - y) * (t / (z - y));
}
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 <= (-6.8d+172)) .or. (.not. (y <= 3d+131))) then
tmp = t * (1.0d0 - (x / y))
else
tmp = (x - y) * (t / (z - y))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((y <= -6.8e+172) || !(y <= 3e+131)) {
tmp = t * (1.0 - (x / y));
} else {
tmp = (x - y) * (t / (z - y));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (y <= -6.8e+172) or not (y <= 3e+131): tmp = t * (1.0 - (x / y)) else: tmp = (x - y) * (t / (z - y)) return tmp
function code(x, y, z, t) tmp = 0.0 if ((y <= -6.8e+172) || !(y <= 3e+131)) tmp = Float64(t * Float64(1.0 - Float64(x / y))); else tmp = Float64(Float64(x - y) * Float64(t / Float64(z - y))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((y <= -6.8e+172) || ~((y <= 3e+131))) tmp = t * (1.0 - (x / y)); else tmp = (x - y) * (t / (z - y)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[y, -6.8e+172], N[Not[LessEqual[y, 3e+131]], $MachinePrecision]], N[(t * N[(1.0 - N[(x / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x - y), $MachinePrecision] * N[(t / N[(z - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -6.8 \cdot 10^{+172} \lor \neg \left(y \leq 3 \cdot 10^{+131}\right):\\
\;\;\;\;t \cdot \left(1 - \frac{x}{y}\right)\\
\mathbf{else}:\\
\;\;\;\;\left(x - y\right) \cdot \frac{t}{z - y}\\
\end{array}
\end{array}
if y < -6.7999999999999996e172 or 3.0000000000000001e131 < y Initial program 99.9%
associate-*l/65.5%
associate-*r/57.7%
Simplified57.7%
Taylor expanded in z around 0 63.5%
associate-*r/63.5%
*-commutative63.5%
neg-mul-163.5%
distribute-rgt-neg-in63.5%
Simplified63.5%
Taylor expanded in x around 0 89.7%
mul-1-neg89.7%
unsub-neg89.7%
associate-/l*98.0%
associate-/r/93.7%
Simplified93.7%
Taylor expanded in t around 0 98.0%
if -6.7999999999999996e172 < y < 3.0000000000000001e131Initial program 96.8%
associate-*l/89.5%
associate-*r/91.1%
Simplified91.1%
Final simplification93.0%
(FPCore (x y z t) :precision binary64 (if (or (<= y -2.1e-67) (not (<= y 6.2e-9))) (* t (- 1.0 (/ x y))) (/ t (/ z x))))
double code(double x, double y, double z, double t) {
double tmp;
if ((y <= -2.1e-67) || !(y <= 6.2e-9)) {
tmp = t * (1.0 - (x / y));
} else {
tmp = t / (z / 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 ((y <= (-2.1d-67)) .or. (.not. (y <= 6.2d-9))) then
tmp = t * (1.0d0 - (x / y))
else
tmp = t / (z / x)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((y <= -2.1e-67) || !(y <= 6.2e-9)) {
tmp = t * (1.0 - (x / y));
} else {
tmp = t / (z / x);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (y <= -2.1e-67) or not (y <= 6.2e-9): tmp = t * (1.0 - (x / y)) else: tmp = t / (z / x) return tmp
function code(x, y, z, t) tmp = 0.0 if ((y <= -2.1e-67) || !(y <= 6.2e-9)) tmp = Float64(t * Float64(1.0 - Float64(x / y))); else tmp = Float64(t / Float64(z / x)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((y <= -2.1e-67) || ~((y <= 6.2e-9))) tmp = t * (1.0 - (x / y)); else tmp = t / (z / x); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[y, -2.1e-67], N[Not[LessEqual[y, 6.2e-9]], $MachinePrecision]], N[(t * N[(1.0 - N[(x / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t / N[(z / x), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -2.1 \cdot 10^{-67} \lor \neg \left(y \leq 6.2 \cdot 10^{-9}\right):\\
\;\;\;\;t \cdot \left(1 - \frac{x}{y}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{t}{\frac{z}{x}}\\
\end{array}
\end{array}
if y < -2.1000000000000002e-67 or 6.2000000000000001e-9 < y Initial program 99.8%
associate-*l/75.8%
associate-*r/75.0%
Simplified75.0%
Taylor expanded in z around 0 54.8%
associate-*r/54.8%
*-commutative54.8%
neg-mul-154.8%
distribute-rgt-neg-in54.8%
Simplified54.8%
Taylor expanded in x around 0 68.6%
mul-1-neg68.6%
unsub-neg68.6%
associate-/l*75.3%
associate-/r/71.7%
Simplified71.7%
Taylor expanded in t around 0 75.2%
if -2.1000000000000002e-67 < y < 6.2000000000000001e-9Initial program 94.2%
associate-*l/94.5%
associate-*r/93.4%
Simplified93.4%
Taylor expanded in y around 0 72.8%
associate-/l*75.2%
Simplified75.2%
Final simplification75.2%
(FPCore (x y z t) :precision binary64 (if (or (<= y -1.25e-37) (not (<= y 1.4e+53))) (* t (- 1.0 (/ x y))) (* x (/ t (- z y)))))
double code(double x, double y, double z, double t) {
double tmp;
if ((y <= -1.25e-37) || !(y <= 1.4e+53)) {
tmp = t * (1.0 - (x / y));
} else {
tmp = x * (t / (z - y));
}
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 <= (-1.25d-37)) .or. (.not. (y <= 1.4d+53))) then
tmp = t * (1.0d0 - (x / y))
else
tmp = x * (t / (z - y))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((y <= -1.25e-37) || !(y <= 1.4e+53)) {
tmp = t * (1.0 - (x / y));
} else {
tmp = x * (t / (z - y));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (y <= -1.25e-37) or not (y <= 1.4e+53): tmp = t * (1.0 - (x / y)) else: tmp = x * (t / (z - y)) return tmp
function code(x, y, z, t) tmp = 0.0 if ((y <= -1.25e-37) || !(y <= 1.4e+53)) tmp = Float64(t * Float64(1.0 - Float64(x / y))); else tmp = Float64(x * Float64(t / Float64(z - y))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((y <= -1.25e-37) || ~((y <= 1.4e+53))) tmp = t * (1.0 - (x / y)); else tmp = x * (t / (z - y)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[y, -1.25e-37], N[Not[LessEqual[y, 1.4e+53]], $MachinePrecision]], N[(t * N[(1.0 - N[(x / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x * N[(t / N[(z - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.25 \cdot 10^{-37} \lor \neg \left(y \leq 1.4 \cdot 10^{+53}\right):\\
\;\;\;\;t \cdot \left(1 - \frac{x}{y}\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot \frac{t}{z - y}\\
\end{array}
\end{array}
if y < -1.2499999999999999e-37 or 1.4e53 < y Initial program 99.8%
associate-*l/73.1%
associate-*r/71.5%
Simplified71.5%
Taylor expanded in z around 0 55.0%
associate-*r/55.0%
*-commutative55.0%
neg-mul-155.0%
distribute-rgt-neg-in55.0%
Simplified55.0%
Taylor expanded in x around 0 71.2%
mul-1-neg71.2%
unsub-neg71.2%
associate-/l*79.0%
associate-/r/74.8%
Simplified74.8%
Taylor expanded in t around 0 79.0%
if -1.2499999999999999e-37 < y < 1.4e53Initial program 95.2%
associate-*l/94.0%
associate-*r/93.8%
Simplified93.8%
Taylor expanded in x around inf 78.4%
associate-*l/77.9%
*-commutative77.9%
Simplified77.9%
Final simplification78.5%
(FPCore (x y z t) :precision binary64 (if (<= y -1.3e+47) t (if (<= y 1.36e+53) (* t (/ x z)) t)))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -1.3e+47) {
tmp = t;
} else if (y <= 1.36e+53) {
tmp = t * (x / z);
} else {
tmp = t;
}
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 <= (-1.3d+47)) then
tmp = t
else if (y <= 1.36d+53) then
tmp = t * (x / z)
else
tmp = t
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (y <= -1.3e+47) {
tmp = t;
} else if (y <= 1.36e+53) {
tmp = t * (x / z);
} else {
tmp = t;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= -1.3e+47: tmp = t elif y <= 1.36e+53: tmp = t * (x / z) else: tmp = t return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= -1.3e+47) tmp = t; elseif (y <= 1.36e+53) tmp = Float64(t * Float64(x / z)); else tmp = t; end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (y <= -1.3e+47) tmp = t; elseif (y <= 1.36e+53) tmp = t * (x / z); else tmp = t; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, -1.3e+47], t, If[LessEqual[y, 1.36e+53], N[(t * N[(x / z), $MachinePrecision]), $MachinePrecision], t]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.3 \cdot 10^{+47}:\\
\;\;\;\;t\\
\mathbf{elif}\;y \leq 1.36 \cdot 10^{+53}:\\
\;\;\;\;t \cdot \frac{x}{z}\\
\mathbf{else}:\\
\;\;\;\;t\\
\end{array}
\end{array}
if y < -1.30000000000000002e47 or 1.36e53 < y Initial program 99.9%
associate-*l/70.3%
associate-*r/67.7%
Simplified67.7%
Taylor expanded in y around inf 68.5%
if -1.30000000000000002e47 < y < 1.36e53Initial program 95.7%
Taylor expanded in y around 0 64.8%
Final simplification66.5%
(FPCore (x y z t) :precision binary64 (* t (/ (- x y) (- z y))))
double code(double x, double y, double z, double t) {
return t * ((x - y) / (z - y));
}
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 = t * ((x - y) / (z - y))
end function
public static double code(double x, double y, double z, double t) {
return t * ((x - y) / (z - y));
}
def code(x, y, z, t): return t * ((x - y) / (z - y))
function code(x, y, z, t) return Float64(t * Float64(Float64(x - y) / Float64(z - y))) end
function tmp = code(x, y, z, t) tmp = t * ((x - y) / (z - y)); end
code[x_, y_, z_, t_] := N[(t * N[(N[(x - y), $MachinePrecision] / N[(z - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
t \cdot \frac{x - y}{z - y}
\end{array}
Initial program 97.6%
Final simplification97.6%
(FPCore (x y z t) :precision binary64 t)
double code(double x, double y, double z, double t) {
return t;
}
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 = t
end function
public static double code(double x, double y, double z, double t) {
return t;
}
def code(x, y, z, t): return t
function code(x, y, z, t) return t end
function tmp = code(x, y, z, t) tmp = t; end
code[x_, y_, z_, t_] := t
\begin{array}{l}
\\
t
\end{array}
Initial program 97.6%
associate-*l/83.0%
associate-*r/82.1%
Simplified82.1%
Taylor expanded in y around inf 38.1%
Final simplification38.1%
(FPCore (x y z t) :precision binary64 (/ t (/ (- z y) (- x y))))
double code(double x, double y, double z, double t) {
return t / ((z - y) / (x - y));
}
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 = t / ((z - y) / (x - y))
end function
public static double code(double x, double y, double z, double t) {
return t / ((z - y) / (x - y));
}
def code(x, y, z, t): return t / ((z - y) / (x - y))
function code(x, y, z, t) return Float64(t / Float64(Float64(z - y) / Float64(x - y))) end
function tmp = code(x, y, z, t) tmp = t / ((z - y) / (x - y)); end
code[x_, y_, z_, t_] := N[(t / N[(N[(z - y), $MachinePrecision] / N[(x - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{t}{\frac{z - y}{x - y}}
\end{array}
herbie shell --seed 2023173
(FPCore (x y z t)
:name "Numeric.Signal.Multichannel:$cput from hsignal-0.2.7.1"
:precision binary64
:herbie-target
(/ t (/ (- z y) (- x y)))
(* (/ (- x y) (- z y)) t))