
(FPCore (x y z t a) :precision binary64 (+ x (* y (/ (- z t) (- a t)))))
double code(double x, double y, double z, double t, double a) {
return x + (y * ((z - t) / (a - 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 = x + (y * ((z - t) / (a - t)))
end function
public static double code(double x, double y, double z, double t, double a) {
return x + (y * ((z - t) / (a - t)));
}
def code(x, y, z, t, a): return x + (y * ((z - t) / (a - t)))
function code(x, y, z, t, a) return Float64(x + Float64(y * Float64(Float64(z - t) / Float64(a - t)))) end
function tmp = code(x, y, z, t, a) tmp = x + (y * ((z - t) / (a - t))); end
code[x_, y_, z_, t_, a_] := N[(x + N[(y * N[(N[(z - t), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + y \cdot \frac{z - t}{a - t}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 12 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t a) :precision binary64 (+ x (* y (/ (- z t) (- a t)))))
double code(double x, double y, double z, double t, double a) {
return x + (y * ((z - t) / (a - 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 = x + (y * ((z - t) / (a - t)))
end function
public static double code(double x, double y, double z, double t, double a) {
return x + (y * ((z - t) / (a - t)));
}
def code(x, y, z, t, a): return x + (y * ((z - t) / (a - t)))
function code(x, y, z, t, a) return Float64(x + Float64(y * Float64(Float64(z - t) / Float64(a - t)))) end
function tmp = code(x, y, z, t, a) tmp = x + (y * ((z - t) / (a - t))); end
code[x_, y_, z_, t_, a_] := N[(x + N[(y * N[(N[(z - t), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + y \cdot \frac{z - t}{a - t}
\end{array}
(FPCore (x y z t a) :precision binary64 (+ x (/ y (/ (- a t) (- z t)))))
double code(double x, double y, double z, double t, double a) {
return x + (y / ((a - t) / (z - 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 = x + (y / ((a - t) / (z - t)))
end function
public static double code(double x, double y, double z, double t, double a) {
return x + (y / ((a - t) / (z - t)));
}
def code(x, y, z, t, a): return x + (y / ((a - t) / (z - t)))
function code(x, y, z, t, a) return Float64(x + Float64(y / Float64(Float64(a - t) / Float64(z - t)))) end
function tmp = code(x, y, z, t, a) tmp = x + (y / ((a - t) / (z - t))); end
code[x_, y_, z_, t_, a_] := N[(x + N[(y / N[(N[(a - t), $MachinePrecision] / N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \frac{y}{\frac{a - t}{z - t}}
\end{array}
Initial program 98.4%
clear-num98.4%
un-div-inv98.4%
Applied egg-rr98.4%
(FPCore (x y z t a) :precision binary64 (if (or (<= t -7.2e+68) (not (<= t 9.5e+83))) (+ x (/ y (/ (- t a) t))) (+ x (/ y (/ (- a t) z)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -7.2e+68) || !(t <= 9.5e+83)) {
tmp = x + (y / ((t - a) / t));
} else {
tmp = x + (y / ((a - t) / 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 ((t <= (-7.2d+68)) .or. (.not. (t <= 9.5d+83))) then
tmp = x + (y / ((t - a) / t))
else
tmp = x + (y / ((a - t) / z))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -7.2e+68) || !(t <= 9.5e+83)) {
tmp = x + (y / ((t - a) / t));
} else {
tmp = x + (y / ((a - t) / z));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (t <= -7.2e+68) or not (t <= 9.5e+83): tmp = x + (y / ((t - a) / t)) else: tmp = x + (y / ((a - t) / z)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((t <= -7.2e+68) || !(t <= 9.5e+83)) tmp = Float64(x + Float64(y / Float64(Float64(t - a) / t))); else tmp = Float64(x + Float64(y / Float64(Float64(a - t) / z))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((t <= -7.2e+68) || ~((t <= 9.5e+83))) tmp = x + (y / ((t - a) / t)); else tmp = x + (y / ((a - t) / z)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[t, -7.2e+68], N[Not[LessEqual[t, 9.5e+83]], $MachinePrecision]], N[(x + N[(y / N[(N[(t - a), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(y / N[(N[(a - t), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -7.2 \cdot 10^{+68} \lor \neg \left(t \leq 9.5 \cdot 10^{+83}\right):\\
\;\;\;\;x + \frac{y}{\frac{t - a}{t}}\\
\mathbf{else}:\\
\;\;\;\;x + \frac{y}{\frac{a - t}{z}}\\
\end{array}
\end{array}
if t < -7.1999999999999998e68 or 9.5000000000000002e83 < t Initial program 99.9%
clear-num99.9%
un-div-inv99.9%
Applied egg-rr99.9%
Taylor expanded in z around 0 88.2%
neg-mul-188.2%
Simplified88.2%
Taylor expanded in t around 0 88.2%
neg-mul-188.2%
unsub-neg88.2%
Simplified88.2%
if -7.1999999999999998e68 < t < 9.5000000000000002e83Initial program 97.6%
clear-num97.6%
un-div-inv97.6%
Applied egg-rr97.6%
Taylor expanded in z around inf 89.6%
Final simplification89.1%
(FPCore (x y z t a) :precision binary64 (if (or (<= t -3.7e+146) (not (<= t 2.5e+83))) (+ x y) (+ x (/ y (/ (- a t) z)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -3.7e+146) || !(t <= 2.5e+83)) {
tmp = x + y;
} else {
tmp = x + (y / ((a - t) / 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 ((t <= (-3.7d+146)) .or. (.not. (t <= 2.5d+83))) then
tmp = x + y
else
tmp = x + (y / ((a - t) / z))
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.7e+146) || !(t <= 2.5e+83)) {
tmp = x + y;
} else {
tmp = x + (y / ((a - t) / z));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (t <= -3.7e+146) or not (t <= 2.5e+83): tmp = x + y else: tmp = x + (y / ((a - t) / z)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((t <= -3.7e+146) || !(t <= 2.5e+83)) tmp = Float64(x + y); else tmp = Float64(x + Float64(y / Float64(Float64(a - t) / z))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((t <= -3.7e+146) || ~((t <= 2.5e+83))) tmp = x + y; else tmp = x + (y / ((a - t) / z)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[t, -3.7e+146], N[Not[LessEqual[t, 2.5e+83]], $MachinePrecision]], N[(x + y), $MachinePrecision], N[(x + N[(y / N[(N[(a - t), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -3.7 \cdot 10^{+146} \lor \neg \left(t \leq 2.5 \cdot 10^{+83}\right):\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;x + \frac{y}{\frac{a - t}{z}}\\
\end{array}
\end{array}
if t < -3.70000000000000004e146 or 2.50000000000000014e83 < t Initial program 99.9%
Taylor expanded in t around inf 84.0%
+-commutative84.0%
Simplified84.0%
if -3.70000000000000004e146 < t < 2.50000000000000014e83Initial program 97.8%
clear-num97.8%
un-div-inv97.8%
Applied egg-rr97.8%
Taylor expanded in z around inf 88.1%
Final simplification86.9%
(FPCore (x y z t a) :precision binary64 (if (or (<= t -2.6e+148) (not (<= t 1.55e+83))) (+ x y) (+ x (* y (/ z (- a t))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -2.6e+148) || !(t <= 1.55e+83)) {
tmp = x + y;
} else {
tmp = x + (y * (z / (a - 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 ((t <= (-2.6d+148)) .or. (.not. (t <= 1.55d+83))) then
tmp = x + y
else
tmp = x + (y * (z / (a - t)))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -2.6e+148) || !(t <= 1.55e+83)) {
tmp = x + y;
} else {
tmp = x + (y * (z / (a - t)));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (t <= -2.6e+148) or not (t <= 1.55e+83): tmp = x + y else: tmp = x + (y * (z / (a - t))) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((t <= -2.6e+148) || !(t <= 1.55e+83)) tmp = Float64(x + y); else tmp = Float64(x + Float64(y * Float64(z / Float64(a - t)))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((t <= -2.6e+148) || ~((t <= 1.55e+83))) tmp = x + y; else tmp = x + (y * (z / (a - t))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[t, -2.6e+148], N[Not[LessEqual[t, 1.55e+83]], $MachinePrecision]], N[(x + y), $MachinePrecision], N[(x + N[(y * N[(z / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -2.6 \cdot 10^{+148} \lor \neg \left(t \leq 1.55 \cdot 10^{+83}\right):\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot \frac{z}{a - t}\\
\end{array}
\end{array}
if t < -2.6e148 or 1.54999999999999996e83 < t Initial program 99.9%
Taylor expanded in t around inf 84.0%
+-commutative84.0%
Simplified84.0%
if -2.6e148 < t < 1.54999999999999996e83Initial program 97.8%
Taylor expanded in z around inf 87.1%
associate-/l*88.1%
Simplified88.1%
Final simplification86.9%
(FPCore (x y z t a) :precision binary64 (if (<= t -3.8e+78) (- x (* y (+ (/ z t) -1.0))) (if (<= t 2.4e+83) (+ x (/ y (/ (- a t) z))) (+ x (/ y (/ (- t a) t))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -3.8e+78) {
tmp = x - (y * ((z / t) + -1.0));
} else if (t <= 2.4e+83) {
tmp = x + (y / ((a - t) / z));
} else {
tmp = x + (y / ((t - a) / 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 (t <= (-3.8d+78)) then
tmp = x - (y * ((z / t) + (-1.0d0)))
else if (t <= 2.4d+83) then
tmp = x + (y / ((a - t) / z))
else
tmp = x + (y / ((t - a) / t))
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.8e+78) {
tmp = x - (y * ((z / t) + -1.0));
} else if (t <= 2.4e+83) {
tmp = x + (y / ((a - t) / z));
} else {
tmp = x + (y / ((t - a) / t));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if t <= -3.8e+78: tmp = x - (y * ((z / t) + -1.0)) elif t <= 2.4e+83: tmp = x + (y / ((a - t) / z)) else: tmp = x + (y / ((t - a) / t)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (t <= -3.8e+78) tmp = Float64(x - Float64(y * Float64(Float64(z / t) + -1.0))); elseif (t <= 2.4e+83) tmp = Float64(x + Float64(y / Float64(Float64(a - t) / z))); else tmp = Float64(x + Float64(y / Float64(Float64(t - a) / t))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (t <= -3.8e+78) tmp = x - (y * ((z / t) + -1.0)); elseif (t <= 2.4e+83) tmp = x + (y / ((a - t) / z)); else tmp = x + (y / ((t - a) / t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, -3.8e+78], N[(x - N[(y * N[(N[(z / t), $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 2.4e+83], N[(x + N[(y / N[(N[(a - t), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(y / N[(N[(t - a), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -3.8 \cdot 10^{+78}:\\
\;\;\;\;x - y \cdot \left(\frac{z}{t} + -1\right)\\
\mathbf{elif}\;t \leq 2.4 \cdot 10^{+83}:\\
\;\;\;\;x + \frac{y}{\frac{a - t}{z}}\\
\mathbf{else}:\\
\;\;\;\;x + \frac{y}{\frac{t - a}{t}}\\
\end{array}
\end{array}
if t < -3.7999999999999999e78Initial program 100.0%
Taylor expanded in a around 0 79.3%
mul-1-neg79.3%
unsub-neg79.3%
associate-/l*94.0%
div-sub94.0%
sub-neg94.0%
*-inverses94.0%
metadata-eval94.0%
Simplified94.0%
if -3.7999999999999999e78 < t < 2.39999999999999991e83Initial program 97.6%
clear-num97.6%
un-div-inv97.6%
Applied egg-rr97.6%
Taylor expanded in z around inf 89.1%
if 2.39999999999999991e83 < t Initial program 99.8%
clear-num99.8%
un-div-inv99.9%
Applied egg-rr99.9%
Taylor expanded in z around 0 86.6%
neg-mul-186.6%
Simplified86.6%
Taylor expanded in t around 0 86.6%
neg-mul-186.6%
unsub-neg86.6%
Simplified86.6%
(FPCore (x y z t a) :precision binary64 (if (or (<= t -2.5e-52) (not (<= t 1.36e+81))) (+ x y) (+ x (* y (/ z a)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -2.5e-52) || !(t <= 1.36e+81)) {
tmp = x + y;
} else {
tmp = x + (y * (z / a));
}
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 <= (-2.5d-52)) .or. (.not. (t <= 1.36d+81))) then
tmp = x + y
else
tmp = x + (y * (z / a))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -2.5e-52) || !(t <= 1.36e+81)) {
tmp = x + y;
} else {
tmp = x + (y * (z / a));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (t <= -2.5e-52) or not (t <= 1.36e+81): tmp = x + y else: tmp = x + (y * (z / a)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((t <= -2.5e-52) || !(t <= 1.36e+81)) tmp = Float64(x + y); else tmp = Float64(x + Float64(y * Float64(z / a))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((t <= -2.5e-52) || ~((t <= 1.36e+81))) tmp = x + y; else tmp = x + (y * (z / a)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[t, -2.5e-52], N[Not[LessEqual[t, 1.36e+81]], $MachinePrecision]], N[(x + y), $MachinePrecision], N[(x + N[(y * N[(z / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -2.5 \cdot 10^{-52} \lor \neg \left(t \leq 1.36 \cdot 10^{+81}\right):\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot \frac{z}{a}\\
\end{array}
\end{array}
if t < -2.5e-52 or 1.35999999999999997e81 < t Initial program 99.9%
Taylor expanded in t around inf 77.9%
+-commutative77.9%
Simplified77.9%
if -2.5e-52 < t < 1.35999999999999997e81Initial program 97.3%
Taylor expanded in t around 0 80.2%
+-commutative80.2%
associate-/l*82.1%
Simplified82.1%
Final simplification80.3%
(FPCore (x y z t a) :precision binary64 (if (or (<= t -3e-52) (not (<= t 1.06e+79))) (+ x y) (+ x (/ (* y z) a))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -3e-52) || !(t <= 1.06e+79)) {
tmp = x + y;
} else {
tmp = x + ((y * z) / a);
}
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 <= (-3d-52)) .or. (.not. (t <= 1.06d+79))) then
tmp = x + y
else
tmp = x + ((y * z) / a)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -3e-52) || !(t <= 1.06e+79)) {
tmp = x + y;
} else {
tmp = x + ((y * z) / a);
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (t <= -3e-52) or not (t <= 1.06e+79): tmp = x + y else: tmp = x + ((y * z) / a) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((t <= -3e-52) || !(t <= 1.06e+79)) tmp = Float64(x + y); else tmp = Float64(x + Float64(Float64(y * z) / a)); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((t <= -3e-52) || ~((t <= 1.06e+79))) tmp = x + y; else tmp = x + ((y * z) / a); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[t, -3e-52], N[Not[LessEqual[t, 1.06e+79]], $MachinePrecision]], N[(x + y), $MachinePrecision], N[(x + N[(N[(y * z), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -3 \cdot 10^{-52} \lor \neg \left(t \leq 1.06 \cdot 10^{+79}\right):\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;x + \frac{y \cdot z}{a}\\
\end{array}
\end{array}
if t < -3e-52 or 1.05999999999999992e79 < t Initial program 99.9%
Taylor expanded in t around inf 77.9%
+-commutative77.9%
Simplified77.9%
if -3e-52 < t < 1.05999999999999992e79Initial program 97.3%
Taylor expanded in t around 0 80.2%
Final simplification79.2%
(FPCore (x y z t a) :precision binary64 (if (<= a -1.02e+137) x (if (<= a 1.55e+180) (+ x y) x)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= -1.02e+137) {
tmp = x;
} else if (a <= 1.55e+180) {
tmp = x + y;
} 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.02d+137)) then
tmp = x
else if (a <= 1.55d+180) then
tmp = x + y
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.02e+137) {
tmp = x;
} else if (a <= 1.55e+180) {
tmp = x + y;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if a <= -1.02e+137: tmp = x elif a <= 1.55e+180: tmp = x + y else: tmp = x return tmp
function code(x, y, z, t, a) tmp = 0.0 if (a <= -1.02e+137) tmp = x; elseif (a <= 1.55e+180) tmp = Float64(x + y); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (a <= -1.02e+137) tmp = x; elseif (a <= 1.55e+180) tmp = x + y; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[a, -1.02e+137], x, If[LessEqual[a, 1.55e+180], N[(x + y), $MachinePrecision], x]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -1.02 \cdot 10^{+137}:\\
\;\;\;\;x\\
\mathbf{elif}\;a \leq 1.55 \cdot 10^{+180}:\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if a < -1.02000000000000004e137 or 1.54999999999999999e180 < a Initial program 99.9%
Taylor expanded in x around inf 70.0%
if -1.02000000000000004e137 < a < 1.54999999999999999e180Initial program 98.0%
Taylor expanded in t around inf 68.1%
+-commutative68.1%
Simplified68.1%
Final simplification68.5%
(FPCore (x y z t a) :precision binary64 (+ x (* y (/ (- z t) (- a t)))))
double code(double x, double y, double z, double t, double a) {
return x + (y * ((z - t) / (a - 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 = x + (y * ((z - t) / (a - t)))
end function
public static double code(double x, double y, double z, double t, double a) {
return x + (y * ((z - t) / (a - t)));
}
def code(x, y, z, t, a): return x + (y * ((z - t) / (a - t)))
function code(x, y, z, t, a) return Float64(x + Float64(y * Float64(Float64(z - t) / Float64(a - t)))) end
function tmp = code(x, y, z, t, a) tmp = x + (y * ((z - t) / (a - t))); end
code[x_, y_, z_, t_, a_] := N[(x + N[(y * N[(N[(z - t), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + y \cdot \frac{z - t}{a - t}
\end{array}
Initial program 98.4%
(FPCore (x y z t a) :precision binary64 (if (<= z 9.6e+131) (+ x y) (* y (/ z a))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= 9.6e+131) {
tmp = x + y;
} else {
tmp = y * (z / a);
}
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 <= 9.6d+131) then
tmp = x + y
else
tmp = y * (z / a)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= 9.6e+131) {
tmp = x + y;
} else {
tmp = y * (z / a);
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= 9.6e+131: tmp = x + y else: tmp = y * (z / a) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= 9.6e+131) tmp = Float64(x + y); else tmp = Float64(y * Float64(z / a)); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (z <= 9.6e+131) tmp = x + y; else tmp = y * (z / a); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, 9.6e+131], N[(x + y), $MachinePrecision], N[(y * N[(z / a), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq 9.6 \cdot 10^{+131}:\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;y \cdot \frac{z}{a}\\
\end{array}
\end{array}
if z < 9.5999999999999998e131Initial program 99.5%
Taylor expanded in t around inf 70.2%
+-commutative70.2%
Simplified70.2%
if 9.5999999999999998e131 < z Initial program 90.7%
Taylor expanded in t around 0 56.4%
Taylor expanded in x around 0 47.2%
associate-*r/51.3%
Simplified51.3%
Final simplification67.9%
(FPCore (x y z t a) :precision binary64 (if (<= y -1.65e+47) y x))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (y <= -1.65e+47) {
tmp = y;
} 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 (y <= (-1.65d+47)) then
tmp = y
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 (y <= -1.65e+47) {
tmp = y;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if y <= -1.65e+47: tmp = y else: tmp = x return tmp
function code(x, y, z, t, a) tmp = 0.0 if (y <= -1.65e+47) tmp = y; else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (y <= -1.65e+47) tmp = y; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[y, -1.65e+47], y, x]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.65 \cdot 10^{+47}:\\
\;\;\;\;y\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if y < -1.65e47Initial program 99.8%
Taylor expanded in t around inf 41.0%
+-commutative41.0%
Simplified41.0%
Taylor expanded in y around inf 30.6%
if -1.65e47 < y Initial program 98.1%
Taylor expanded in x around inf 61.6%
(FPCore (x y z t a) :precision binary64 x)
double code(double x, double y, double z, double t, double a) {
return x;
}
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
end function
public static double code(double x, double y, double z, double t, double a) {
return x;
}
def code(x, y, z, t, a): return x
function code(x, y, z, t, a) return x end
function tmp = code(x, y, z, t, a) tmp = x; end
code[x_, y_, z_, t_, a_] := x
\begin{array}{l}
\\
x
\end{array}
Initial program 98.4%
Taylor expanded in x around inf 51.9%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (+ x (* y (/ (- z t) (- a t))))))
(if (< y -8.508084860551241e-17)
t_1
(if (< y 2.894426862792089e-49)
(+ x (* (* y (- z t)) (/ 1.0 (- a t))))
t_1))))
double code(double x, double y, double z, double t, double a) {
double t_1 = x + (y * ((z - t) / (a - t)));
double tmp;
if (y < -8.508084860551241e-17) {
tmp = t_1;
} else if (y < 2.894426862792089e-49) {
tmp = x + ((y * (z - t)) * (1.0 / (a - t)));
} else {
tmp = t_1;
}
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) / (a - t)))
if (y < (-8.508084860551241d-17)) then
tmp = t_1
else if (y < 2.894426862792089d-49) then
tmp = x + ((y * (z - t)) * (1.0d0 / (a - t)))
else
tmp = t_1
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) / (a - t)));
double tmp;
if (y < -8.508084860551241e-17) {
tmp = t_1;
} else if (y < 2.894426862792089e-49) {
tmp = x + ((y * (z - t)) * (1.0 / (a - t)));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = x + (y * ((z - t) / (a - t))) tmp = 0 if y < -8.508084860551241e-17: tmp = t_1 elif y < 2.894426862792089e-49: tmp = x + ((y * (z - t)) * (1.0 / (a - t))) else: tmp = t_1 return tmp
function code(x, y, z, t, a) t_1 = Float64(x + Float64(y * Float64(Float64(z - t) / Float64(a - t)))) tmp = 0.0 if (y < -8.508084860551241e-17) tmp = t_1; elseif (y < 2.894426862792089e-49) tmp = Float64(x + Float64(Float64(y * Float64(z - t)) * Float64(1.0 / Float64(a - t)))); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = x + (y * ((z - t) / (a - t))); tmp = 0.0; if (y < -8.508084860551241e-17) tmp = t_1; elseif (y < 2.894426862792089e-49) tmp = x + ((y * (z - t)) * (1.0 / (a - t))); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(x + N[(y * N[(N[(z - t), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[Less[y, -8.508084860551241e-17], t$95$1, If[Less[y, 2.894426862792089e-49], N[(x + N[(N[(y * N[(z - t), $MachinePrecision]), $MachinePrecision] * N[(1.0 / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x + y \cdot \frac{z - t}{a - t}\\
\mathbf{if}\;y < -8.508084860551241 \cdot 10^{-17}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y < 2.894426862792089 \cdot 10^{-49}:\\
\;\;\;\;x + \left(y \cdot \left(z - t\right)\right) \cdot \frac{1}{a - t}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
herbie shell --seed 2024157
(FPCore (x y z t a)
:name "Graphics.Rendering.Plot.Render.Plot.Axis:renderAxisLine from plot-0.2.3.4, B"
:precision binary64
:alt
(! :herbie-platform default (if (< y -8508084860551241/100000000000000000000000000000000) (+ x (* y (/ (- z t) (- a t)))) (if (< y 2894426862792089/10000000000000000000000000000000000000000000000000000000000000000) (+ x (* (* y (- z t)) (/ 1 (- a t)))) (+ x (* y (/ (- z t) (- a t)))))))
(+ x (* y (/ (- z t) (- a t)))))