
(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 11 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 (* (/ (- 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}
Initial program 98.3%
Final simplification98.3%
(FPCore (x y z t)
:precision binary64
(if (<= y -4e+127)
t
(if (or (<= y -2.65e+103) (and (not (<= y -3.7e+66)) (<= y 1.35e+106)))
(* t (/ x (- z y)))
t)))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -4e+127) {
tmp = t;
} else if ((y <= -2.65e+103) || (!(y <= -3.7e+66) && (y <= 1.35e+106))) {
tmp = t * (x / (z - y));
} 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 <= (-4d+127)) then
tmp = t
else if ((y <= (-2.65d+103)) .or. (.not. (y <= (-3.7d+66))) .and. (y <= 1.35d+106)) then
tmp = t * (x / (z - y))
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 <= -4e+127) {
tmp = t;
} else if ((y <= -2.65e+103) || (!(y <= -3.7e+66) && (y <= 1.35e+106))) {
tmp = t * (x / (z - y));
} else {
tmp = t;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= -4e+127: tmp = t elif (y <= -2.65e+103) or (not (y <= -3.7e+66) and (y <= 1.35e+106)): tmp = t * (x / (z - y)) else: tmp = t return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= -4e+127) tmp = t; elseif ((y <= -2.65e+103) || (!(y <= -3.7e+66) && (y <= 1.35e+106))) tmp = Float64(t * Float64(x / Float64(z - y))); else tmp = t; end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (y <= -4e+127) tmp = t; elseif ((y <= -2.65e+103) || (~((y <= -3.7e+66)) && (y <= 1.35e+106))) tmp = t * (x / (z - y)); else tmp = t; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, -4e+127], t, If[Or[LessEqual[y, -2.65e+103], And[N[Not[LessEqual[y, -3.7e+66]], $MachinePrecision], LessEqual[y, 1.35e+106]]], N[(t * N[(x / N[(z - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -4 \cdot 10^{+127}:\\
\;\;\;\;t\\
\mathbf{elif}\;y \leq -2.65 \cdot 10^{+103} \lor \neg \left(y \leq -3.7 \cdot 10^{+66}\right) \land y \leq 1.35 \cdot 10^{+106}:\\
\;\;\;\;t \cdot \frac{x}{z - y}\\
\mathbf{else}:\\
\;\;\;\;t\\
\end{array}
\end{array}
if y < -3.99999999999999982e127 or -2.64999999999999985e103 < y < -3.7e66 or 1.35000000000000003e106 < y Initial program 99.9%
*-commutative99.9%
associate-*r/73.8%
associate-/l*99.9%
associate-/r/63.8%
Simplified63.8%
Taylor expanded in y around inf 78.8%
if -3.99999999999999982e127 < y < -2.64999999999999985e103 or -3.7e66 < y < 1.35000000000000003e106Initial program 97.6%
Taylor expanded in x around inf 71.1%
Final simplification73.5%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* t (/ y (- y z)))))
(if (<= x -4.4e+47)
(* t (/ x (- z y)))
(if (<= x 3.4e-20)
t_1
(if (<= x 1.1e+33)
(/ (* x t) (- z y))
(if (<= x 8.6e+67) t_1 (/ t (/ (- z y) x))))))))
double code(double x, double y, double z, double t) {
double t_1 = t * (y / (y - z));
double tmp;
if (x <= -4.4e+47) {
tmp = t * (x / (z - y));
} else if (x <= 3.4e-20) {
tmp = t_1;
} else if (x <= 1.1e+33) {
tmp = (x * t) / (z - y);
} else if (x <= 8.6e+67) {
tmp = t_1;
} else {
tmp = t / ((z - y) / 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) :: t_1
real(8) :: tmp
t_1 = t * (y / (y - z))
if (x <= (-4.4d+47)) then
tmp = t * (x / (z - y))
else if (x <= 3.4d-20) then
tmp = t_1
else if (x <= 1.1d+33) then
tmp = (x * t) / (z - y)
else if (x <= 8.6d+67) then
tmp = t_1
else
tmp = t / ((z - y) / x)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = t * (y / (y - z));
double tmp;
if (x <= -4.4e+47) {
tmp = t * (x / (z - y));
} else if (x <= 3.4e-20) {
tmp = t_1;
} else if (x <= 1.1e+33) {
tmp = (x * t) / (z - y);
} else if (x <= 8.6e+67) {
tmp = t_1;
} else {
tmp = t / ((z - y) / x);
}
return tmp;
}
def code(x, y, z, t): t_1 = t * (y / (y - z)) tmp = 0 if x <= -4.4e+47: tmp = t * (x / (z - y)) elif x <= 3.4e-20: tmp = t_1 elif x <= 1.1e+33: tmp = (x * t) / (z - y) elif x <= 8.6e+67: tmp = t_1 else: tmp = t / ((z - y) / x) return tmp
function code(x, y, z, t) t_1 = Float64(t * Float64(y / Float64(y - z))) tmp = 0.0 if (x <= -4.4e+47) tmp = Float64(t * Float64(x / Float64(z - y))); elseif (x <= 3.4e-20) tmp = t_1; elseif (x <= 1.1e+33) tmp = Float64(Float64(x * t) / Float64(z - y)); elseif (x <= 8.6e+67) tmp = t_1; else tmp = Float64(t / Float64(Float64(z - y) / x)); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = t * (y / (y - z)); tmp = 0.0; if (x <= -4.4e+47) tmp = t * (x / (z - y)); elseif (x <= 3.4e-20) tmp = t_1; elseif (x <= 1.1e+33) tmp = (x * t) / (z - y); elseif (x <= 8.6e+67) tmp = t_1; else tmp = t / ((z - y) / x); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(t * N[(y / N[(y - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -4.4e+47], N[(t * N[(x / N[(z - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 3.4e-20], t$95$1, If[LessEqual[x, 1.1e+33], N[(N[(x * t), $MachinePrecision] / N[(z - y), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 8.6e+67], t$95$1, N[(t / N[(N[(z - y), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := t \cdot \frac{y}{y - z}\\
\mathbf{if}\;x \leq -4.4 \cdot 10^{+47}:\\
\;\;\;\;t \cdot \frac{x}{z - y}\\
\mathbf{elif}\;x \leq 3.4 \cdot 10^{-20}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \leq 1.1 \cdot 10^{+33}:\\
\;\;\;\;\frac{x \cdot t}{z - y}\\
\mathbf{elif}\;x \leq 8.6 \cdot 10^{+67}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;\frac{t}{\frac{z - y}{x}}\\
\end{array}
\end{array}
if x < -4.3999999999999999e47Initial program 96.7%
Taylor expanded in x around inf 80.2%
if -4.3999999999999999e47 < x < 3.3999999999999997e-20 or 1.09999999999999997e33 < x < 8.6000000000000002e67Initial program 99.1%
Taylor expanded in x around 0 82.9%
neg-mul-182.9%
distribute-neg-frac82.9%
Simplified82.9%
frac-2neg82.9%
div-inv82.7%
remove-double-neg82.7%
sub-neg82.7%
distribute-neg-in82.7%
remove-double-neg82.7%
Applied egg-rr82.7%
associate-*r/82.9%
*-rgt-identity82.9%
+-commutative82.9%
unsub-neg82.9%
Simplified82.9%
if 3.3999999999999997e-20 < x < 1.09999999999999997e33Initial program 99.3%
*-commutative99.3%
associate-*r/93.4%
associate-/l*93.3%
associate-/r/93.6%
Simplified93.6%
Taylor expanded in x around inf 74.7%
if 8.6000000000000002e67 < x Initial program 97.7%
*-commutative97.7%
associate-*r/80.1%
associate-/l*97.8%
associate-/r/90.4%
Simplified90.4%
*-commutative90.4%
clear-num89.9%
div-inv90.0%
div-inv90.0%
associate-/r*97.7%
Applied egg-rr97.7%
Taylor expanded in x around inf 68.4%
associate-/l*80.3%
Simplified80.3%
Final simplification81.3%
(FPCore (x y z t)
:precision binary64
(if (<= y -8.2e+126)
t
(if (<= y -2.6e+101)
(/ (* x (- t)) y)
(if (<= y -1.4e+48) t (if (<= y 2.2e+46) (* t (/ x z)) t)))))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -8.2e+126) {
tmp = t;
} else if (y <= -2.6e+101) {
tmp = (x * -t) / y;
} else if (y <= -1.4e+48) {
tmp = t;
} else if (y <= 2.2e+46) {
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 <= (-8.2d+126)) then
tmp = t
else if (y <= (-2.6d+101)) then
tmp = (x * -t) / y
else if (y <= (-1.4d+48)) then
tmp = t
else if (y <= 2.2d+46) 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 <= -8.2e+126) {
tmp = t;
} else if (y <= -2.6e+101) {
tmp = (x * -t) / y;
} else if (y <= -1.4e+48) {
tmp = t;
} else if (y <= 2.2e+46) {
tmp = t * (x / z);
} else {
tmp = t;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= -8.2e+126: tmp = t elif y <= -2.6e+101: tmp = (x * -t) / y elif y <= -1.4e+48: tmp = t elif y <= 2.2e+46: tmp = t * (x / z) else: tmp = t return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= -8.2e+126) tmp = t; elseif (y <= -2.6e+101) tmp = Float64(Float64(x * Float64(-t)) / y); elseif (y <= -1.4e+48) tmp = t; elseif (y <= 2.2e+46) 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 <= -8.2e+126) tmp = t; elseif (y <= -2.6e+101) tmp = (x * -t) / y; elseif (y <= -1.4e+48) tmp = t; elseif (y <= 2.2e+46) tmp = t * (x / z); else tmp = t; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, -8.2e+126], t, If[LessEqual[y, -2.6e+101], N[(N[(x * (-t)), $MachinePrecision] / y), $MachinePrecision], If[LessEqual[y, -1.4e+48], t, If[LessEqual[y, 2.2e+46], N[(t * N[(x / z), $MachinePrecision]), $MachinePrecision], t]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -8.2 \cdot 10^{+126}:\\
\;\;\;\;t\\
\mathbf{elif}\;y \leq -2.6 \cdot 10^{+101}:\\
\;\;\;\;\frac{x \cdot \left(-t\right)}{y}\\
\mathbf{elif}\;y \leq -1.4 \cdot 10^{+48}:\\
\;\;\;\;t\\
\mathbf{elif}\;y \leq 2.2 \cdot 10^{+46}:\\
\;\;\;\;t \cdot \frac{x}{z}\\
\mathbf{else}:\\
\;\;\;\;t\\
\end{array}
\end{array}
if y < -8.2000000000000001e126 or -2.6e101 < y < -1.40000000000000006e48 or 2.2e46 < y Initial program 99.9%
*-commutative99.9%
associate-*r/76.9%
associate-/l*99.9%
associate-/r/68.6%
Simplified68.6%
Taylor expanded in y around inf 70.9%
if -8.2000000000000001e126 < y < -2.6e101Initial program 99.8%
*-commutative99.8%
associate-*r/86.0%
associate-/l*99.8%
associate-/r/99.6%
Simplified99.6%
*-commutative99.6%
clear-num99.6%
div-inv99.6%
div-inv99.6%
associate-/r*99.6%
Applied egg-rr99.6%
Taylor expanded in x around inf 72.2%
associate-/l*72.5%
Simplified72.5%
Taylor expanded in z around 0 72.1%
mul-1-neg72.1%
Simplified72.1%
if -1.40000000000000006e48 < y < 2.2e46Initial program 97.2%
Taylor expanded in y around 0 61.3%
Final simplification65.3%
(FPCore (x y z t)
:precision binary64
(if (<= y -8e+126)
t
(if (<= y -3.2e+104)
(/ (- t) (/ y x))
(if (<= y -1.95e+48) t (if (<= y 1.7e+43) (* t (/ x z)) t)))))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -8e+126) {
tmp = t;
} else if (y <= -3.2e+104) {
tmp = -t / (y / x);
} else if (y <= -1.95e+48) {
tmp = t;
} else if (y <= 1.7e+43) {
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 <= (-8d+126)) then
tmp = t
else if (y <= (-3.2d+104)) then
tmp = -t / (y / x)
else if (y <= (-1.95d+48)) then
tmp = t
else if (y <= 1.7d+43) 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 <= -8e+126) {
tmp = t;
} else if (y <= -3.2e+104) {
tmp = -t / (y / x);
} else if (y <= -1.95e+48) {
tmp = t;
} else if (y <= 1.7e+43) {
tmp = t * (x / z);
} else {
tmp = t;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= -8e+126: tmp = t elif y <= -3.2e+104: tmp = -t / (y / x) elif y <= -1.95e+48: tmp = t elif y <= 1.7e+43: tmp = t * (x / z) else: tmp = t return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= -8e+126) tmp = t; elseif (y <= -3.2e+104) tmp = Float64(Float64(-t) / Float64(y / x)); elseif (y <= -1.95e+48) tmp = t; elseif (y <= 1.7e+43) 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 <= -8e+126) tmp = t; elseif (y <= -3.2e+104) tmp = -t / (y / x); elseif (y <= -1.95e+48) tmp = t; elseif (y <= 1.7e+43) tmp = t * (x / z); else tmp = t; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, -8e+126], t, If[LessEqual[y, -3.2e+104], N[((-t) / N[(y / x), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, -1.95e+48], t, If[LessEqual[y, 1.7e+43], N[(t * N[(x / z), $MachinePrecision]), $MachinePrecision], t]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -8 \cdot 10^{+126}:\\
\;\;\;\;t\\
\mathbf{elif}\;y \leq -3.2 \cdot 10^{+104}:\\
\;\;\;\;\frac{-t}{\frac{y}{x}}\\
\mathbf{elif}\;y \leq -1.95 \cdot 10^{+48}:\\
\;\;\;\;t\\
\mathbf{elif}\;y \leq 1.7 \cdot 10^{+43}:\\
\;\;\;\;t \cdot \frac{x}{z}\\
\mathbf{else}:\\
\;\;\;\;t\\
\end{array}
\end{array}
if y < -7.9999999999999994e126 or -3.2e104 < y < -1.95e48 or 1.70000000000000006e43 < y Initial program 99.9%
*-commutative99.9%
associate-*r/76.9%
associate-/l*99.9%
associate-/r/68.6%
Simplified68.6%
Taylor expanded in y around inf 70.9%
if -7.9999999999999994e126 < y < -3.2e104Initial program 99.8%
*-commutative99.8%
associate-*r/86.0%
associate-/l*99.8%
associate-/r/99.6%
Simplified99.6%
*-commutative99.6%
clear-num99.6%
div-inv99.6%
div-inv99.6%
associate-/r*99.6%
Applied egg-rr99.6%
Taylor expanded in x around inf 72.2%
associate-/l*72.5%
Simplified72.5%
Taylor expanded in z around 0 72.1%
mul-1-neg72.1%
associate-/l*72.3%
distribute-neg-frac72.3%
Simplified72.3%
if -1.95e48 < y < 1.70000000000000006e43Initial program 97.2%
Taylor expanded in y around 0 61.3%
Final simplification65.3%
(FPCore (x y z t) :precision binary64 (if (<= y -7.2e+165) (/ (- t) (+ (/ z y) -1.0)) (if (<= y 2.9e+133) (* (- x y) (/ t (- z y))) (/ (- t) (/ y (- x y))))))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -7.2e+165) {
tmp = -t / ((z / y) + -1.0);
} else if (y <= 2.9e+133) {
tmp = (x - y) * (t / (z - y));
} else {
tmp = -t / (y / (x - 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 <= (-7.2d+165)) then
tmp = -t / ((z / y) + (-1.0d0))
else if (y <= 2.9d+133) then
tmp = (x - y) * (t / (z - y))
else
tmp = -t / (y / (x - y))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (y <= -7.2e+165) {
tmp = -t / ((z / y) + -1.0);
} else if (y <= 2.9e+133) {
tmp = (x - y) * (t / (z - y));
} else {
tmp = -t / (y / (x - y));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= -7.2e+165: tmp = -t / ((z / y) + -1.0) elif y <= 2.9e+133: tmp = (x - y) * (t / (z - y)) else: tmp = -t / (y / (x - y)) return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= -7.2e+165) tmp = Float64(Float64(-t) / Float64(Float64(z / y) + -1.0)); elseif (y <= 2.9e+133) tmp = Float64(Float64(x - y) * Float64(t / Float64(z - y))); else tmp = Float64(Float64(-t) / Float64(y / Float64(x - y))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (y <= -7.2e+165) tmp = -t / ((z / y) + -1.0); elseif (y <= 2.9e+133) tmp = (x - y) * (t / (z - y)); else tmp = -t / (y / (x - y)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, -7.2e+165], N[((-t) / N[(N[(z / y), $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 2.9e+133], N[(N[(x - y), $MachinePrecision] * N[(t / N[(z - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[((-t) / N[(y / N[(x - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -7.2 \cdot 10^{+165}:\\
\;\;\;\;\frac{-t}{\frac{z}{y} + -1}\\
\mathbf{elif}\;y \leq 2.9 \cdot 10^{+133}:\\
\;\;\;\;\left(x - y\right) \cdot \frac{t}{z - y}\\
\mathbf{else}:\\
\;\;\;\;\frac{-t}{\frac{y}{x - y}}\\
\end{array}
\end{array}
if y < -7.1999999999999996e165Initial program 99.9%
*-commutative99.9%
associate-*r/73.3%
associate-/l*100.0%
associate-/r/58.8%
Simplified58.8%
Taylor expanded in x around 0 69.8%
mul-1-neg69.8%
associate-/l*93.5%
distribute-neg-frac93.5%
div-sub93.5%
*-inverses93.5%
Simplified93.5%
if -7.1999999999999996e165 < y < 2.9000000000000001e133Initial program 97.8%
*-commutative97.8%
associate-*r/91.0%
associate-/l*97.3%
associate-/r/91.9%
Simplified91.9%
if 2.9000000000000001e133 < y Initial program 100.0%
*-commutative100.0%
associate-*r/69.2%
associate-/l*99.9%
associate-/r/60.4%
Simplified60.4%
Taylor expanded in z around 0 65.3%
mul-1-neg65.3%
associate-/l*95.6%
distribute-neg-frac95.6%
Simplified95.6%
Final simplification92.5%
(FPCore (x y z t) :precision binary64 (if (or (<= x -7.1e+47) (not (<= x 3.9e-20))) (* t (/ x (- z y))) (* t (/ y (- y z)))))
double code(double x, double y, double z, double t) {
double tmp;
if ((x <= -7.1e+47) || !(x <= 3.9e-20)) {
tmp = t * (x / (z - y));
} else {
tmp = t * (y / (y - 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 ((x <= (-7.1d+47)) .or. (.not. (x <= 3.9d-20))) then
tmp = t * (x / (z - y))
else
tmp = t * (y / (y - z))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((x <= -7.1e+47) || !(x <= 3.9e-20)) {
tmp = t * (x / (z - y));
} else {
tmp = t * (y / (y - z));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (x <= -7.1e+47) or not (x <= 3.9e-20): tmp = t * (x / (z - y)) else: tmp = t * (y / (y - z)) return tmp
function code(x, y, z, t) tmp = 0.0 if ((x <= -7.1e+47) || !(x <= 3.9e-20)) tmp = Float64(t * Float64(x / Float64(z - y))); else tmp = Float64(t * Float64(y / Float64(y - z))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((x <= -7.1e+47) || ~((x <= 3.9e-20))) tmp = t * (x / (z - y)); else tmp = t * (y / (y - z)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[x, -7.1e+47], N[Not[LessEqual[x, 3.9e-20]], $MachinePrecision]], N[(t * N[(x / N[(z - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t * N[(y / N[(y - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -7.1 \cdot 10^{+47} \lor \neg \left(x \leq 3.9 \cdot 10^{-20}\right):\\
\;\;\;\;t \cdot \frac{x}{z - y}\\
\mathbf{else}:\\
\;\;\;\;t \cdot \frac{y}{y - z}\\
\end{array}
\end{array}
if x < -7.1000000000000002e47 or 3.90000000000000007e-20 < x Initial program 97.6%
Taylor expanded in x around inf 76.2%
if -7.1000000000000002e47 < x < 3.90000000000000007e-20Initial program 99.1%
Taylor expanded in x around 0 83.3%
neg-mul-183.3%
distribute-neg-frac83.3%
Simplified83.3%
frac-2neg83.3%
div-inv83.1%
remove-double-neg83.1%
sub-neg83.1%
distribute-neg-in83.1%
remove-double-neg83.1%
Applied egg-rr83.1%
associate-*r/83.3%
*-rgt-identity83.3%
+-commutative83.3%
unsub-neg83.3%
Simplified83.3%
Final simplification79.7%
(FPCore (x y z t) :precision binary64 (if (<= y -1.1e-111) t (if (<= y 4.2e-141) (* t (/ y z)) t)))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -1.1e-111) {
tmp = t;
} else if (y <= 4.2e-141) {
tmp = t * (y / 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.1d-111)) then
tmp = t
else if (y <= 4.2d-141) then
tmp = t * (y / 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.1e-111) {
tmp = t;
} else if (y <= 4.2e-141) {
tmp = t * (y / z);
} else {
tmp = t;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= -1.1e-111: tmp = t elif y <= 4.2e-141: tmp = t * (y / z) else: tmp = t return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= -1.1e-111) tmp = t; elseif (y <= 4.2e-141) tmp = Float64(t * Float64(y / z)); else tmp = t; end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (y <= -1.1e-111) tmp = t; elseif (y <= 4.2e-141) tmp = t * (y / z); else tmp = t; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, -1.1e-111], t, If[LessEqual[y, 4.2e-141], N[(t * N[(y / z), $MachinePrecision]), $MachinePrecision], t]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.1 \cdot 10^{-111}:\\
\;\;\;\;t\\
\mathbf{elif}\;y \leq 4.2 \cdot 10^{-141}:\\
\;\;\;\;t \cdot \frac{y}{z}\\
\mathbf{else}:\\
\;\;\;\;t\\
\end{array}
\end{array}
if y < -1.1e-111 or 4.1999999999999999e-141 < y Initial program 99.3%
*-commutative99.3%
associate-*r/83.6%
associate-/l*98.8%
associate-/r/80.1%
Simplified80.1%
Taylor expanded in y around inf 48.7%
if -1.1e-111 < y < 4.1999999999999999e-141Initial program 96.0%
Taylor expanded in x around 0 26.0%
neg-mul-126.0%
distribute-neg-frac26.0%
Simplified26.0%
Taylor expanded in y around 0 24.9%
mul-1-neg24.9%
distribute-neg-frac24.9%
Simplified24.9%
add024.9%
*-commutative24.9%
add-sqr-sqrt10.8%
sqrt-unprod21.2%
sqr-neg21.2%
sqrt-unprod10.8%
add-sqr-sqrt21.3%
Applied egg-rr21.3%
add021.3%
Simplified21.3%
Final simplification40.7%
(FPCore (x y z t) :precision binary64 (if (<= y -6.9e+47) t (if (<= y 8.5e+43) (* x (/ t z)) t)))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -6.9e+47) {
tmp = t;
} else if (y <= 8.5e+43) {
tmp = x * (t / 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 <= (-6.9d+47)) then
tmp = t
else if (y <= 8.5d+43) then
tmp = x * (t / 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 <= -6.9e+47) {
tmp = t;
} else if (y <= 8.5e+43) {
tmp = x * (t / z);
} else {
tmp = t;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= -6.9e+47: tmp = t elif y <= 8.5e+43: tmp = x * (t / z) else: tmp = t return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= -6.9e+47) tmp = t; elseif (y <= 8.5e+43) tmp = Float64(x * Float64(t / z)); else tmp = t; end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (y <= -6.9e+47) tmp = t; elseif (y <= 8.5e+43) tmp = x * (t / z); else tmp = t; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, -6.9e+47], t, If[LessEqual[y, 8.5e+43], N[(x * N[(t / z), $MachinePrecision]), $MachinePrecision], t]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -6.9 \cdot 10^{+47}:\\
\;\;\;\;t\\
\mathbf{elif}\;y \leq 8.5 \cdot 10^{+43}:\\
\;\;\;\;x \cdot \frac{t}{z}\\
\mathbf{else}:\\
\;\;\;\;t\\
\end{array}
\end{array}
if y < -6.9000000000000004e47 or 8.5e43 < y Initial program 99.9%
*-commutative99.9%
associate-*r/77.5%
associate-/l*99.9%
associate-/r/70.6%
Simplified70.6%
Taylor expanded in y around inf 66.5%
if -6.9000000000000004e47 < y < 8.5e43Initial program 97.2%
*-commutative97.2%
associate-*r/92.3%
associate-/l*96.6%
associate-/r/93.3%
Simplified93.3%
Taylor expanded in y around 0 58.3%
associate-/l*60.8%
associate-/r/60.6%
Applied egg-rr60.6%
Final simplification63.0%
(FPCore (x y z t) :precision binary64 (if (<= y -1.25e+47) t (if (<= y 4.5e+48) (* t (/ x z)) t)))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -1.25e+47) {
tmp = t;
} else if (y <= 4.5e+48) {
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.25d+47)) then
tmp = t
else if (y <= 4.5d+48) 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.25e+47) {
tmp = t;
} else if (y <= 4.5e+48) {
tmp = t * (x / z);
} else {
tmp = t;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= -1.25e+47: tmp = t elif y <= 4.5e+48: tmp = t * (x / z) else: tmp = t return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= -1.25e+47) tmp = t; elseif (y <= 4.5e+48) 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.25e+47) tmp = t; elseif (y <= 4.5e+48) tmp = t * (x / z); else tmp = t; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, -1.25e+47], t, If[LessEqual[y, 4.5e+48], N[(t * N[(x / z), $MachinePrecision]), $MachinePrecision], t]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.25 \cdot 10^{+47}:\\
\;\;\;\;t\\
\mathbf{elif}\;y \leq 4.5 \cdot 10^{+48}:\\
\;\;\;\;t \cdot \frac{x}{z}\\
\mathbf{else}:\\
\;\;\;\;t\\
\end{array}
\end{array}
if y < -1.25000000000000005e47 or 4.49999999999999995e48 < y Initial program 99.9%
*-commutative99.9%
associate-*r/77.5%
associate-/l*99.9%
associate-/r/70.6%
Simplified70.6%
Taylor expanded in y around inf 66.5%
if -1.25000000000000005e47 < y < 4.49999999999999995e48Initial program 97.2%
Taylor expanded in y around 0 61.3%
Final simplification63.5%
(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 98.3%
*-commutative98.3%
associate-*r/86.2%
associate-/l*98.0%
associate-/r/83.9%
Simplified83.9%
Taylor expanded in y around inf 36.3%
Final simplification36.3%
(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 2024034
(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))