
(FPCore (x y z t a) :precision binary64 (+ x (* (- y z) (/ (- t x) (- a z)))))
double code(double x, double y, double z, double t, double a) {
return x + ((y - z) * ((t - x) / (a - z)));
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
code = x + ((y - z) * ((t - x) / (a - z)))
end function
public static double code(double x, double y, double z, double t, double a) {
return x + ((y - z) * ((t - x) / (a - z)));
}
def code(x, y, z, t, a): return x + ((y - z) * ((t - x) / (a - z)))
function code(x, y, z, t, a) return Float64(x + Float64(Float64(y - z) * Float64(Float64(t - x) / Float64(a - z)))) end
function tmp = code(x, y, z, t, a) tmp = x + ((y - z) * ((t - x) / (a - z))); end
code[x_, y_, z_, t_, a_] := N[(x + N[(N[(y - z), $MachinePrecision] * N[(N[(t - x), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \left(y - z\right) \cdot \frac{t - x}{a - z}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 13 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t a) :precision binary64 (+ x (* (- y z) (/ (- t x) (- a z)))))
double code(double x, double y, double z, double t, double a) {
return x + ((y - z) * ((t - x) / (a - z)));
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
code = x + ((y - z) * ((t - x) / (a - z)))
end function
public static double code(double x, double y, double z, double t, double a) {
return x + ((y - z) * ((t - x) / (a - z)));
}
def code(x, y, z, t, a): return x + ((y - z) * ((t - x) / (a - z)))
function code(x, y, z, t, a) return Float64(x + Float64(Float64(y - z) * Float64(Float64(t - x) / Float64(a - z)))) end
function tmp = code(x, y, z, t, a) tmp = x + ((y - z) * ((t - x) / (a - z))); end
code[x_, y_, z_, t_, a_] := N[(x + N[(N[(y - z), $MachinePrecision] * N[(N[(t - x), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \left(y - z\right) \cdot \frac{t - x}{a - z}
\end{array}
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (+ x (* (- y z) (/ (- t x) (- a z))))))
(if (or (<= t_1 -2e-249) (not (<= t_1 5e-242)))
t_1
(+ t (* (/ (- t x) z) (- a y))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = x + ((y - z) * ((t - x) / (a - z)));
double tmp;
if ((t_1 <= -2e-249) || !(t_1 <= 5e-242)) {
tmp = t_1;
} else {
tmp = t + (((t - x) / z) * (a - y));
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: t_1
real(8) :: tmp
t_1 = x + ((y - z) * ((t - x) / (a - z)))
if ((t_1 <= (-2d-249)) .or. (.not. (t_1 <= 5d-242))) then
tmp = t_1
else
tmp = t + (((t - x) / z) * (a - y))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double t_1 = x + ((y - z) * ((t - x) / (a - z)));
double tmp;
if ((t_1 <= -2e-249) || !(t_1 <= 5e-242)) {
tmp = t_1;
} else {
tmp = t + (((t - x) / z) * (a - y));
}
return tmp;
}
def code(x, y, z, t, a): t_1 = x + ((y - z) * ((t - x) / (a - z))) tmp = 0 if (t_1 <= -2e-249) or not (t_1 <= 5e-242): tmp = t_1 else: tmp = t + (((t - x) / z) * (a - y)) return tmp
function code(x, y, z, t, a) t_1 = Float64(x + Float64(Float64(y - z) * Float64(Float64(t - x) / Float64(a - z)))) tmp = 0.0 if ((t_1 <= -2e-249) || !(t_1 <= 5e-242)) tmp = t_1; else tmp = Float64(t + Float64(Float64(Float64(t - x) / z) * Float64(a - y))); end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = x + ((y - z) * ((t - x) / (a - z))); tmp = 0.0; if ((t_1 <= -2e-249) || ~((t_1 <= 5e-242))) tmp = t_1; else tmp = t + (((t - x) / z) * (a - y)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(x + N[(N[(y - z), $MachinePrecision] * N[(N[(t - x), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[Or[LessEqual[t$95$1, -2e-249], N[Not[LessEqual[t$95$1, 5e-242]], $MachinePrecision]], t$95$1, N[(t + N[(N[(N[(t - x), $MachinePrecision] / z), $MachinePrecision] * N[(a - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x + \left(y - z\right) \cdot \frac{t - x}{a - z}\\
\mathbf{if}\;t\_1 \leq -2 \cdot 10^{-249} \lor \neg \left(t\_1 \leq 5 \cdot 10^{-242}\right):\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;t + \frac{t - x}{z} \cdot \left(a - y\right)\\
\end{array}
\end{array}
if (+.f64 x (*.f64 (-.f64 y z) (/.f64 (-.f64 t x) (-.f64 a z)))) < -2.00000000000000011e-249 or 4.9999999999999998e-242 < (+.f64 x (*.f64 (-.f64 y z) (/.f64 (-.f64 t x) (-.f64 a z)))) Initial program 93.1%
if -2.00000000000000011e-249 < (+.f64 x (*.f64 (-.f64 y z) (/.f64 (-.f64 t x) (-.f64 a z)))) < 4.9999999999999998e-242Initial program 3.5%
+-commutative3.5%
fma-define4.0%
Simplified4.0%
Taylor expanded in z around inf 76.0%
associate--l+76.0%
distribute-lft-out--76.0%
div-sub76.0%
mul-1-neg76.0%
unsub-neg76.0%
div-sub76.0%
associate-/l*82.7%
associate-/l*99.7%
distribute-rgt-out--99.7%
Simplified99.7%
Final simplification93.8%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (* y (/ (- t x) a))))
(if (<= a -8.5e+156)
x
(if (<= a -4.6e-129)
t_1
(if (<= a 1.38e-261)
t
(if (<= a 5.7e-154) (* x (/ y z)) (if (<= a 1e+122) t_1 x)))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = y * ((t - x) / a);
double tmp;
if (a <= -8.5e+156) {
tmp = x;
} else if (a <= -4.6e-129) {
tmp = t_1;
} else if (a <= 1.38e-261) {
tmp = t;
} else if (a <= 5.7e-154) {
tmp = x * (y / z);
} else if (a <= 1e+122) {
tmp = t_1;
} else {
tmp = x;
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: t_1
real(8) :: tmp
t_1 = y * ((t - x) / a)
if (a <= (-8.5d+156)) then
tmp = x
else if (a <= (-4.6d-129)) then
tmp = t_1
else if (a <= 1.38d-261) then
tmp = t
else if (a <= 5.7d-154) then
tmp = x * (y / z)
else if (a <= 1d+122) then
tmp = t_1
else
tmp = x
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double t_1 = y * ((t - x) / a);
double tmp;
if (a <= -8.5e+156) {
tmp = x;
} else if (a <= -4.6e-129) {
tmp = t_1;
} else if (a <= 1.38e-261) {
tmp = t;
} else if (a <= 5.7e-154) {
tmp = x * (y / z);
} else if (a <= 1e+122) {
tmp = t_1;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = y * ((t - x) / a) tmp = 0 if a <= -8.5e+156: tmp = x elif a <= -4.6e-129: tmp = t_1 elif a <= 1.38e-261: tmp = t elif a <= 5.7e-154: tmp = x * (y / z) elif a <= 1e+122: tmp = t_1 else: tmp = x return tmp
function code(x, y, z, t, a) t_1 = Float64(y * Float64(Float64(t - x) / a)) tmp = 0.0 if (a <= -8.5e+156) tmp = x; elseif (a <= -4.6e-129) tmp = t_1; elseif (a <= 1.38e-261) tmp = t; elseif (a <= 5.7e-154) tmp = Float64(x * Float64(y / z)); elseif (a <= 1e+122) tmp = t_1; else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = y * ((t - x) / a); tmp = 0.0; if (a <= -8.5e+156) tmp = x; elseif (a <= -4.6e-129) tmp = t_1; elseif (a <= 1.38e-261) tmp = t; elseif (a <= 5.7e-154) tmp = x * (y / z); elseif (a <= 1e+122) tmp = t_1; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(y * N[(N[(t - x), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[a, -8.5e+156], x, If[LessEqual[a, -4.6e-129], t$95$1, If[LessEqual[a, 1.38e-261], t, If[LessEqual[a, 5.7e-154], N[(x * N[(y / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 1e+122], t$95$1, x]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := y \cdot \frac{t - x}{a}\\
\mathbf{if}\;a \leq -8.5 \cdot 10^{+156}:\\
\;\;\;\;x\\
\mathbf{elif}\;a \leq -4.6 \cdot 10^{-129}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;a \leq 1.38 \cdot 10^{-261}:\\
\;\;\;\;t\\
\mathbf{elif}\;a \leq 5.7 \cdot 10^{-154}:\\
\;\;\;\;x \cdot \frac{y}{z}\\
\mathbf{elif}\;a \leq 10^{+122}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if a < -8.49999999999999948e156 or 1.00000000000000001e122 < a Initial program 89.0%
+-commutative89.0%
fma-define89.2%
Simplified89.2%
Taylor expanded in a around inf 59.2%
if -8.49999999999999948e156 < a < -4.5999999999999999e-129 or 5.6999999999999998e-154 < a < 1.00000000000000001e122Initial program 84.9%
Taylor expanded in z around 0 56.0%
Taylor expanded in y around inf 46.9%
div-sub46.9%
Simplified46.9%
if -4.5999999999999999e-129 < a < 1.38e-261Initial program 73.7%
clear-num73.8%
un-div-inv74.8%
Applied egg-rr74.8%
Taylor expanded in z around inf 44.1%
if 1.38e-261 < a < 5.6999999999999998e-154Initial program 77.0%
+-commutative77.0%
fma-define77.5%
Simplified77.5%
Taylor expanded in t around 0 40.5%
mul-1-neg40.5%
*-rgt-identity40.5%
associate-/l*40.5%
distribute-rgt-neg-in40.5%
mul-1-neg40.5%
distribute-lft-in40.5%
mul-1-neg40.5%
unsub-neg40.5%
Simplified40.5%
Taylor expanded in a around 0 49.6%
(FPCore (x y z t a)
:precision binary64
(if (<= a -1.8e-36)
x
(if (<= a 7.2e-262)
t
(if (<= a 7.5e-24) (* x (/ y z)) (if (<= a 2.2e+121) (* y (/ t a)) x)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= -1.8e-36) {
tmp = x;
} else if (a <= 7.2e-262) {
tmp = t;
} else if (a <= 7.5e-24) {
tmp = x * (y / z);
} else if (a <= 2.2e+121) {
tmp = y * (t / a);
} else {
tmp = x;
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (a <= (-1.8d-36)) then
tmp = x
else if (a <= 7.2d-262) then
tmp = t
else if (a <= 7.5d-24) then
tmp = x * (y / z)
else if (a <= 2.2d+121) then
tmp = y * (t / a)
else
tmp = x
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= -1.8e-36) {
tmp = x;
} else if (a <= 7.2e-262) {
tmp = t;
} else if (a <= 7.5e-24) {
tmp = x * (y / z);
} else if (a <= 2.2e+121) {
tmp = y * (t / a);
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if a <= -1.8e-36: tmp = x elif a <= 7.2e-262: tmp = t elif a <= 7.5e-24: tmp = x * (y / z) elif a <= 2.2e+121: tmp = y * (t / a) else: tmp = x return tmp
function code(x, y, z, t, a) tmp = 0.0 if (a <= -1.8e-36) tmp = x; elseif (a <= 7.2e-262) tmp = t; elseif (a <= 7.5e-24) tmp = Float64(x * Float64(y / z)); elseif (a <= 2.2e+121) tmp = Float64(y * Float64(t / a)); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (a <= -1.8e-36) tmp = x; elseif (a <= 7.2e-262) tmp = t; elseif (a <= 7.5e-24) tmp = x * (y / z); elseif (a <= 2.2e+121) tmp = y * (t / a); else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[a, -1.8e-36], x, If[LessEqual[a, 7.2e-262], t, If[LessEqual[a, 7.5e-24], N[(x * N[(y / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 2.2e+121], N[(y * N[(t / a), $MachinePrecision]), $MachinePrecision], x]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -1.8 \cdot 10^{-36}:\\
\;\;\;\;x\\
\mathbf{elif}\;a \leq 7.2 \cdot 10^{-262}:\\
\;\;\;\;t\\
\mathbf{elif}\;a \leq 7.5 \cdot 10^{-24}:\\
\;\;\;\;x \cdot \frac{y}{z}\\
\mathbf{elif}\;a \leq 2.2 \cdot 10^{+121}:\\
\;\;\;\;y \cdot \frac{t}{a}\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if a < -1.80000000000000016e-36 or 2.20000000000000001e121 < a Initial program 88.0%
+-commutative88.0%
fma-define88.1%
Simplified88.1%
Taylor expanded in a around inf 49.2%
if -1.80000000000000016e-36 < a < 7.1999999999999995e-262Initial program 71.7%
clear-num71.6%
un-div-inv73.9%
Applied egg-rr73.9%
Taylor expanded in z around inf 38.1%
if 7.1999999999999995e-262 < a < 7.50000000000000007e-24Initial program 80.4%
+-commutative80.4%
fma-define80.6%
Simplified80.6%
Taylor expanded in t around 0 46.4%
mul-1-neg46.4%
*-rgt-identity46.4%
associate-/l*46.5%
distribute-rgt-neg-in46.5%
mul-1-neg46.5%
distribute-lft-in46.6%
mul-1-neg46.6%
unsub-neg46.6%
Simplified46.6%
Taylor expanded in a around 0 44.0%
if 7.50000000000000007e-24 < a < 2.20000000000000001e121Initial program 95.8%
Taylor expanded in z around 0 64.9%
Taylor expanded in y around inf 58.4%
div-sub58.4%
Simplified58.4%
Taylor expanded in t around inf 47.2%
(FPCore (x y z t a)
:precision binary64
(if (<= a -7.5e-36)
x
(if (<= a 9.5e-260)
t
(if (<= a 8.4e-54) (* x (/ y z)) (if (<= a 3.8e+67) t x)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= -7.5e-36) {
tmp = x;
} else if (a <= 9.5e-260) {
tmp = t;
} else if (a <= 8.4e-54) {
tmp = x * (y / z);
} else if (a <= 3.8e+67) {
tmp = t;
} else {
tmp = x;
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (a <= (-7.5d-36)) then
tmp = x
else if (a <= 9.5d-260) then
tmp = t
else if (a <= 8.4d-54) then
tmp = x * (y / z)
else if (a <= 3.8d+67) then
tmp = t
else
tmp = x
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= -7.5e-36) {
tmp = x;
} else if (a <= 9.5e-260) {
tmp = t;
} else if (a <= 8.4e-54) {
tmp = x * (y / z);
} else if (a <= 3.8e+67) {
tmp = t;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if a <= -7.5e-36: tmp = x elif a <= 9.5e-260: tmp = t elif a <= 8.4e-54: tmp = x * (y / z) elif a <= 3.8e+67: tmp = t else: tmp = x return tmp
function code(x, y, z, t, a) tmp = 0.0 if (a <= -7.5e-36) tmp = x; elseif (a <= 9.5e-260) tmp = t; elseif (a <= 8.4e-54) tmp = Float64(x * Float64(y / z)); elseif (a <= 3.8e+67) tmp = t; else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (a <= -7.5e-36) tmp = x; elseif (a <= 9.5e-260) tmp = t; elseif (a <= 8.4e-54) tmp = x * (y / z); elseif (a <= 3.8e+67) tmp = t; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[a, -7.5e-36], x, If[LessEqual[a, 9.5e-260], t, If[LessEqual[a, 8.4e-54], N[(x * N[(y / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 3.8e+67], t, x]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -7.5 \cdot 10^{-36}:\\
\;\;\;\;x\\
\mathbf{elif}\;a \leq 9.5 \cdot 10^{-260}:\\
\;\;\;\;t\\
\mathbf{elif}\;a \leq 8.4 \cdot 10^{-54}:\\
\;\;\;\;x \cdot \frac{y}{z}\\
\mathbf{elif}\;a \leq 3.8 \cdot 10^{+67}:\\
\;\;\;\;t\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if a < -7.49999999999999972e-36 or 3.8000000000000002e67 < a Initial program 89.1%
+-commutative89.1%
fma-define89.2%
Simplified89.2%
Taylor expanded in a around inf 47.5%
if -7.49999999999999972e-36 < a < 9.5000000000000001e-260 or 8.4e-54 < a < 3.8000000000000002e67Initial program 76.2%
clear-num76.2%
un-div-inv77.8%
Applied egg-rr77.8%
Taylor expanded in z around inf 37.2%
if 9.5000000000000001e-260 < a < 8.4e-54Initial program 82.2%
+-commutative82.2%
fma-define82.4%
Simplified82.4%
Taylor expanded in t around 0 46.8%
mul-1-neg46.8%
*-rgt-identity46.8%
associate-/l*46.9%
distribute-rgt-neg-in46.9%
mul-1-neg46.9%
distribute-lft-in47.0%
mul-1-neg47.0%
unsub-neg47.0%
Simplified47.0%
Taylor expanded in a around 0 48.1%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -85000000000.0) (not (<= z 5.8e+124))) (+ t (* (/ (- t x) z) (- a y))) (+ x (/ y (/ (- a z) (- t x))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -85000000000.0) || !(z <= 5.8e+124)) {
tmp = t + (((t - x) / z) * (a - y));
} else {
tmp = x + (y / ((a - z) / (t - x)));
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if ((z <= (-85000000000.0d0)) .or. (.not. (z <= 5.8d+124))) then
tmp = t + (((t - x) / z) * (a - y))
else
tmp = x + (y / ((a - z) / (t - x)))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -85000000000.0) || !(z <= 5.8e+124)) {
tmp = t + (((t - x) / z) * (a - y));
} else {
tmp = x + (y / ((a - z) / (t - x)));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -85000000000.0) or not (z <= 5.8e+124): tmp = t + (((t - x) / z) * (a - y)) else: tmp = x + (y / ((a - z) / (t - x))) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -85000000000.0) || !(z <= 5.8e+124)) tmp = Float64(t + Float64(Float64(Float64(t - x) / z) * Float64(a - y))); else tmp = Float64(x + Float64(y / Float64(Float64(a - z) / Float64(t - x)))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((z <= -85000000000.0) || ~((z <= 5.8e+124))) tmp = t + (((t - x) / z) * (a - y)); else tmp = x + (y / ((a - z) / (t - x))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -85000000000.0], N[Not[LessEqual[z, 5.8e+124]], $MachinePrecision]], N[(t + N[(N[(N[(t - x), $MachinePrecision] / z), $MachinePrecision] * N[(a - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(y / N[(N[(a - z), $MachinePrecision] / N[(t - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -85000000000 \lor \neg \left(z \leq 5.8 \cdot 10^{+124}\right):\\
\;\;\;\;t + \frac{t - x}{z} \cdot \left(a - y\right)\\
\mathbf{else}:\\
\;\;\;\;x + \frac{y}{\frac{a - z}{t - x}}\\
\end{array}
\end{array}
if z < -8.5e10 or 5.80000000000000043e124 < z Initial program 64.1%
+-commutative64.1%
fma-define64.1%
Simplified64.1%
Taylor expanded in z around inf 59.8%
associate--l+59.8%
distribute-lft-out--59.8%
div-sub59.8%
mul-1-neg59.8%
unsub-neg59.8%
div-sub59.8%
associate-/l*69.2%
associate-/l*76.2%
distribute-rgt-out--76.2%
Simplified76.2%
if -8.5e10 < z < 5.80000000000000043e124Initial program 94.0%
clear-num93.5%
un-div-inv94.4%
Applied egg-rr94.4%
Taylor expanded in y around inf 85.2%
Final simplification82.0%
(FPCore (x y z t a) :precision binary64 (if (or (<= y -4.8e+157) (not (<= y 19000000000.0))) (+ x (/ y (/ (- a z) (- t x)))) (+ x (* t (/ (- y z) (- a z))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((y <= -4.8e+157) || !(y <= 19000000000.0)) {
tmp = x + (y / ((a - z) / (t - x)));
} else {
tmp = x + (t * ((y - z) / (a - z)));
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if ((y <= (-4.8d+157)) .or. (.not. (y <= 19000000000.0d0))) then
tmp = x + (y / ((a - z) / (t - x)))
else
tmp = x + (t * ((y - z) / (a - z)))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((y <= -4.8e+157) || !(y <= 19000000000.0)) {
tmp = x + (y / ((a - z) / (t - x)));
} else {
tmp = x + (t * ((y - z) / (a - z)));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (y <= -4.8e+157) or not (y <= 19000000000.0): tmp = x + (y / ((a - z) / (t - x))) else: tmp = x + (t * ((y - z) / (a - z))) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((y <= -4.8e+157) || !(y <= 19000000000.0)) tmp = Float64(x + Float64(y / Float64(Float64(a - z) / Float64(t - x)))); else tmp = Float64(x + Float64(t * Float64(Float64(y - z) / Float64(a - z)))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((y <= -4.8e+157) || ~((y <= 19000000000.0))) tmp = x + (y / ((a - z) / (t - x))); else tmp = x + (t * ((y - z) / (a - z))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[y, -4.8e+157], N[Not[LessEqual[y, 19000000000.0]], $MachinePrecision]], N[(x + N[(y / N[(N[(a - z), $MachinePrecision] / N[(t - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(t * N[(N[(y - z), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -4.8 \cdot 10^{+157} \lor \neg \left(y \leq 19000000000\right):\\
\;\;\;\;x + \frac{y}{\frac{a - z}{t - x}}\\
\mathbf{else}:\\
\;\;\;\;x + t \cdot \frac{y - z}{a - z}\\
\end{array}
\end{array}
if y < -4.7999999999999999e157 or 1.9e10 < y Initial program 90.0%
clear-num89.5%
un-div-inv89.4%
Applied egg-rr89.4%
Taylor expanded in y around inf 84.6%
if -4.7999999999999999e157 < y < 1.9e10Initial program 78.6%
Taylor expanded in t around inf 62.6%
associate-/l*71.6%
Simplified71.6%
Final simplification76.9%
(FPCore (x y z t a) :precision binary64 (if (or (<= t -3.9e-157) (not (<= t 2.95e-77))) (+ x (* t (/ (- y z) (- a z)))) (* x (+ (/ (- y z) (- z a)) 1.0))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -3.9e-157) || !(t <= 2.95e-77)) {
tmp = x + (t * ((y - z) / (a - z)));
} else {
tmp = x * (((y - z) / (z - a)) + 1.0);
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if ((t <= (-3.9d-157)) .or. (.not. (t <= 2.95d-77))) then
tmp = x + (t * ((y - z) / (a - z)))
else
tmp = x * (((y - z) / (z - a)) + 1.0d0)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -3.9e-157) || !(t <= 2.95e-77)) {
tmp = x + (t * ((y - z) / (a - z)));
} else {
tmp = x * (((y - z) / (z - a)) + 1.0);
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (t <= -3.9e-157) or not (t <= 2.95e-77): tmp = x + (t * ((y - z) / (a - z))) else: tmp = x * (((y - z) / (z - a)) + 1.0) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((t <= -3.9e-157) || !(t <= 2.95e-77)) tmp = Float64(x + Float64(t * Float64(Float64(y - z) / Float64(a - z)))); else tmp = Float64(x * Float64(Float64(Float64(y - z) / Float64(z - a)) + 1.0)); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((t <= -3.9e-157) || ~((t <= 2.95e-77))) tmp = x + (t * ((y - z) / (a - z))); else tmp = x * (((y - z) / (z - a)) + 1.0); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[t, -3.9e-157], N[Not[LessEqual[t, 2.95e-77]], $MachinePrecision]], N[(x + N[(t * N[(N[(y - z), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x * N[(N[(N[(y - z), $MachinePrecision] / N[(z - a), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -3.9 \cdot 10^{-157} \lor \neg \left(t \leq 2.95 \cdot 10^{-77}\right):\\
\;\;\;\;x + t \cdot \frac{y - z}{a - z}\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(\frac{y - z}{z - a} + 1\right)\\
\end{array}
\end{array}
if t < -3.89999999999999999e-157 or 2.94999999999999982e-77 < t Initial program 90.2%
Taylor expanded in t around inf 66.5%
associate-/l*78.2%
Simplified78.2%
if -3.89999999999999999e-157 < t < 2.94999999999999982e-77Initial program 67.4%
+-commutative67.4%
fma-define67.6%
Simplified67.6%
Taylor expanded in t around 0 63.1%
mul-1-neg63.1%
*-rgt-identity63.1%
associate-/l*68.8%
distribute-rgt-neg-in68.8%
mul-1-neg68.8%
distribute-lft-in68.7%
mul-1-neg68.7%
unsub-neg68.7%
Simplified68.7%
Final simplification75.3%
(FPCore (x y z t a) :precision binary64 (if (or (<= a -4.7e-36) (not (<= a 4.1e+67))) (+ x (* y (/ (- t x) a))) (* t (/ (- y z) (- a z)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((a <= -4.7e-36) || !(a <= 4.1e+67)) {
tmp = x + (y * ((t - x) / a));
} else {
tmp = t * ((y - z) / (a - z));
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if ((a <= (-4.7d-36)) .or. (.not. (a <= 4.1d+67))) then
tmp = x + (y * ((t - x) / a))
else
tmp = t * ((y - z) / (a - z))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((a <= -4.7e-36) || !(a <= 4.1e+67)) {
tmp = x + (y * ((t - x) / a));
} else {
tmp = t * ((y - z) / (a - z));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (a <= -4.7e-36) or not (a <= 4.1e+67): tmp = x + (y * ((t - x) / a)) else: tmp = t * ((y - z) / (a - z)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((a <= -4.7e-36) || !(a <= 4.1e+67)) tmp = Float64(x + Float64(y * Float64(Float64(t - x) / a))); else tmp = Float64(t * Float64(Float64(y - z) / Float64(a - z))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((a <= -4.7e-36) || ~((a <= 4.1e+67))) tmp = x + (y * ((t - x) / a)); else tmp = t * ((y - z) / (a - z)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[a, -4.7e-36], N[Not[LessEqual[a, 4.1e+67]], $MachinePrecision]], N[(x + N[(y * N[(N[(t - x), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t * N[(N[(y - z), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -4.7 \cdot 10^{-36} \lor \neg \left(a \leq 4.1 \cdot 10^{+67}\right):\\
\;\;\;\;x + y \cdot \frac{t - x}{a}\\
\mathbf{else}:\\
\;\;\;\;t \cdot \frac{y - z}{a - z}\\
\end{array}
\end{array}
if a < -4.7000000000000003e-36 or 4.09999999999999979e67 < a Initial program 89.1%
Taylor expanded in z around 0 68.2%
associate-/l*76.0%
Simplified76.0%
if -4.7000000000000003e-36 < a < 4.09999999999999979e67Initial program 78.0%
clear-num78.1%
un-div-inv79.1%
Applied egg-rr79.1%
Taylor expanded in t around inf 66.0%
+-commutative66.0%
mul-1-neg66.0%
unsub-neg66.0%
+-commutative66.0%
associate-/l*70.2%
Simplified70.2%
Taylor expanded in t around inf 61.9%
div-sub61.9%
Simplified61.9%
Final simplification68.6%
(FPCore (x y z t a) :precision binary64 (if (or (<= x -7.2e-19) (not (<= x 7.8e+45))) (- x (* x (/ y a))) (* t (/ (- y z) (- a z)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((x <= -7.2e-19) || !(x <= 7.8e+45)) {
tmp = x - (x * (y / a));
} else {
tmp = t * ((y - z) / (a - z));
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if ((x <= (-7.2d-19)) .or. (.not. (x <= 7.8d+45))) then
tmp = x - (x * (y / a))
else
tmp = t * ((y - z) / (a - z))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((x <= -7.2e-19) || !(x <= 7.8e+45)) {
tmp = x - (x * (y / a));
} else {
tmp = t * ((y - z) / (a - z));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (x <= -7.2e-19) or not (x <= 7.8e+45): tmp = x - (x * (y / a)) else: tmp = t * ((y - z) / (a - z)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((x <= -7.2e-19) || !(x <= 7.8e+45)) tmp = Float64(x - Float64(x * Float64(y / a))); else tmp = Float64(t * Float64(Float64(y - z) / Float64(a - z))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((x <= -7.2e-19) || ~((x <= 7.8e+45))) tmp = x - (x * (y / a)); else tmp = t * ((y - z) / (a - z)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[x, -7.2e-19], N[Not[LessEqual[x, 7.8e+45]], $MachinePrecision]], N[(x - N[(x * N[(y / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t * N[(N[(y - z), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -7.2 \cdot 10^{-19} \lor \neg \left(x \leq 7.8 \cdot 10^{+45}\right):\\
\;\;\;\;x - x \cdot \frac{y}{a}\\
\mathbf{else}:\\
\;\;\;\;t \cdot \frac{y - z}{a - z}\\
\end{array}
\end{array}
if x < -7.2000000000000002e-19 or 7.7999999999999999e45 < x Initial program 81.7%
Taylor expanded in t around 0 55.5%
mul-1-neg55.5%
associate-/l*65.8%
distribute-rgt-neg-in65.8%
mul-1-neg65.8%
mul-1-neg65.8%
distribute-frac-neg265.8%
Simplified65.8%
Taylor expanded in z around 0 53.2%
mul-1-neg53.2%
unsub-neg53.2%
associate-/l*58.9%
Simplified58.9%
if -7.2000000000000002e-19 < x < 7.7999999999999999e45Initial program 84.9%
clear-num83.0%
un-div-inv83.5%
Applied egg-rr83.5%
Taylor expanded in t around inf 87.7%
+-commutative87.7%
mul-1-neg87.7%
unsub-neg87.7%
+-commutative87.7%
associate-/l*81.7%
Simplified81.7%
Taylor expanded in t around inf 70.8%
div-sub70.8%
Simplified70.8%
Final simplification64.8%
(FPCore (x y z t a) :precision binary64 (if (<= z -4.4e+52) t (if (<= z 1.25e+129) (+ x (* t (/ y a))) t)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -4.4e+52) {
tmp = t;
} else if (z <= 1.25e+129) {
tmp = x + (t * (y / a));
} else {
tmp = t;
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (z <= (-4.4d+52)) then
tmp = t
else if (z <= 1.25d+129) then
tmp = x + (t * (y / a))
else
tmp = t
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -4.4e+52) {
tmp = t;
} else if (z <= 1.25e+129) {
tmp = x + (t * (y / a));
} else {
tmp = t;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -4.4e+52: tmp = t elif z <= 1.25e+129: tmp = x + (t * (y / a)) else: tmp = t return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -4.4e+52) tmp = t; elseif (z <= 1.25e+129) tmp = Float64(x + Float64(t * Float64(y / a))); else tmp = t; end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (z <= -4.4e+52) tmp = t; elseif (z <= 1.25e+129) tmp = x + (t * (y / a)); else tmp = t; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -4.4e+52], t, If[LessEqual[z, 1.25e+129], N[(x + N[(t * N[(y / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -4.4 \cdot 10^{+52}:\\
\;\;\;\;t\\
\mathbf{elif}\;z \leq 1.25 \cdot 10^{+129}:\\
\;\;\;\;x + t \cdot \frac{y}{a}\\
\mathbf{else}:\\
\;\;\;\;t\\
\end{array}
\end{array}
if z < -4.4e52 or 1.2500000000000001e129 < z Initial program 63.5%
clear-num61.9%
un-div-inv61.7%
Applied egg-rr61.7%
Taylor expanded in z around inf 46.0%
if -4.4e52 < z < 1.2500000000000001e129Initial program 92.6%
Taylor expanded in z around 0 68.4%
Taylor expanded in t around inf 55.5%
associate-/l*59.0%
Simplified59.0%
(FPCore (x y z t a) :precision binary64 (if (<= a -1.1e-35) x (if (<= a 3.05e+69) t x)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= -1.1e-35) {
tmp = x;
} else if (a <= 3.05e+69) {
tmp = t;
} else {
tmp = x;
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (a <= (-1.1d-35)) then
tmp = x
else if (a <= 3.05d+69) then
tmp = t
else
tmp = x
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= -1.1e-35) {
tmp = x;
} else if (a <= 3.05e+69) {
tmp = t;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if a <= -1.1e-35: tmp = x elif a <= 3.05e+69: tmp = t else: tmp = x return tmp
function code(x, y, z, t, a) tmp = 0.0 if (a <= -1.1e-35) tmp = x; elseif (a <= 3.05e+69) tmp = t; else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (a <= -1.1e-35) tmp = x; elseif (a <= 3.05e+69) tmp = t; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[a, -1.1e-35], x, If[LessEqual[a, 3.05e+69], t, x]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -1.1 \cdot 10^{-35}:\\
\;\;\;\;x\\
\mathbf{elif}\;a \leq 3.05 \cdot 10^{+69}:\\
\;\;\;\;t\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if a < -1.09999999999999997e-35 or 3.05e69 < a Initial program 89.1%
+-commutative89.1%
fma-define89.2%
Simplified89.2%
Taylor expanded in a around inf 47.5%
if -1.09999999999999997e-35 < a < 3.05e69Initial program 78.0%
clear-num78.1%
un-div-inv79.1%
Applied egg-rr79.1%
Taylor expanded in z around inf 29.6%
(FPCore (x y z t a) :precision binary64 t)
double code(double x, double y, double z, double t, double a) {
return t;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
code = t
end function
public static double code(double x, double y, double z, double t, double a) {
return t;
}
def code(x, y, z, t, a): return t
function code(x, y, z, t, a) return t end
function tmp = code(x, y, z, t, a) tmp = t; end
code[x_, y_, z_, t_, a_] := t
\begin{array}{l}
\\
t
\end{array}
Initial program 83.3%
clear-num82.4%
un-div-inv82.9%
Applied egg-rr82.9%
Taylor expanded in z around inf 19.9%
(FPCore (x y z t a) :precision binary64 0.0)
double code(double x, double y, double z, double t, double a) {
return 0.0;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
code = 0.0d0
end function
public static double code(double x, double y, double z, double t, double a) {
return 0.0;
}
def code(x, y, z, t, a): return 0.0
function code(x, y, z, t, a) return 0.0 end
function tmp = code(x, y, z, t, a) tmp = 0.0; end
code[x_, y_, z_, t_, a_] := 0.0
\begin{array}{l}
\\
0
\end{array}
Initial program 83.3%
Taylor expanded in t around 0 42.4%
mul-1-neg42.4%
associate-/l*46.8%
distribute-rgt-neg-in46.8%
mul-1-neg46.8%
mul-1-neg46.8%
distribute-frac-neg246.8%
Simplified46.8%
Taylor expanded in z around inf 2.7%
distribute-rgt1-in2.7%
metadata-eval2.7%
Simplified2.7%
Taylor expanded in x around 0 2.7%
herbie shell --seed 2024170
(FPCore (x y z t a)
:name "Numeric.Signal:interpolate from hsignal-0.2.7.1"
:precision binary64
(+ x (* (- y z) (/ (- t x) (- a z)))))