
(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 (- t a)) (- t z))))
double code(double x, double y, double z, double t, double a) {
return x + ((y / (t - a)) * (t - 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 / (t - a)) * (t - z))
end function
public static double code(double x, double y, double z, double t, double a) {
return x + ((y / (t - a)) * (t - z));
}
def code(x, y, z, t, a): return x + ((y / (t - a)) * (t - z))
function code(x, y, z, t, a) return Float64(x + Float64(Float64(y / Float64(t - a)) * Float64(t - z))) end
function tmp = code(x, y, z, t, a) tmp = x + ((y / (t - a)) * (t - z)); end
code[x_, y_, z_, t_, a_] := N[(x + N[(N[(y / N[(t - a), $MachinePrecision]), $MachinePrecision] * N[(t - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \frac{y}{t - a} \cdot \left(t - z\right)
\end{array}
Initial program 97.6%
associate-*r/84.6%
Simplified84.6%
*-commutative84.6%
associate-/l*98.3%
Applied egg-rr98.3%
Final simplification98.3%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (+ x (* z (/ y a)))) (t_2 (- x (* y (/ z t)))))
(if (<= t -6.5e+186)
(+ x y)
(if (<= t -2.4e+42)
t_2
(if (<= t -8.5e-15)
t_1
(if (<= t -9.8e-68)
t_2
(if (or (<= t -7.5e-83) (not (<= t 0.85))) (+ x y) t_1)))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = x + (z * (y / a));
double t_2 = x - (y * (z / t));
double tmp;
if (t <= -6.5e+186) {
tmp = x + y;
} else if (t <= -2.4e+42) {
tmp = t_2;
} else if (t <= -8.5e-15) {
tmp = t_1;
} else if (t <= -9.8e-68) {
tmp = t_2;
} else if ((t <= -7.5e-83) || !(t <= 0.85)) {
tmp = x + y;
} 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) :: t_2
real(8) :: tmp
t_1 = x + (z * (y / a))
t_2 = x - (y * (z / t))
if (t <= (-6.5d+186)) then
tmp = x + y
else if (t <= (-2.4d+42)) then
tmp = t_2
else if (t <= (-8.5d-15)) then
tmp = t_1
else if (t <= (-9.8d-68)) then
tmp = t_2
else if ((t <= (-7.5d-83)) .or. (.not. (t <= 0.85d0))) then
tmp = 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 a) {
double t_1 = x + (z * (y / a));
double t_2 = x - (y * (z / t));
double tmp;
if (t <= -6.5e+186) {
tmp = x + y;
} else if (t <= -2.4e+42) {
tmp = t_2;
} else if (t <= -8.5e-15) {
tmp = t_1;
} else if (t <= -9.8e-68) {
tmp = t_2;
} else if ((t <= -7.5e-83) || !(t <= 0.85)) {
tmp = x + y;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = x + (z * (y / a)) t_2 = x - (y * (z / t)) tmp = 0 if t <= -6.5e+186: tmp = x + y elif t <= -2.4e+42: tmp = t_2 elif t <= -8.5e-15: tmp = t_1 elif t <= -9.8e-68: tmp = t_2 elif (t <= -7.5e-83) or not (t <= 0.85): tmp = x + y else: tmp = t_1 return tmp
function code(x, y, z, t, a) t_1 = Float64(x + Float64(z * Float64(y / a))) t_2 = Float64(x - Float64(y * Float64(z / t))) tmp = 0.0 if (t <= -6.5e+186) tmp = Float64(x + y); elseif (t <= -2.4e+42) tmp = t_2; elseif (t <= -8.5e-15) tmp = t_1; elseif (t <= -9.8e-68) tmp = t_2; elseif ((t <= -7.5e-83) || !(t <= 0.85)) tmp = Float64(x + y); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = x + (z * (y / a)); t_2 = x - (y * (z / t)); tmp = 0.0; if (t <= -6.5e+186) tmp = x + y; elseif (t <= -2.4e+42) tmp = t_2; elseif (t <= -8.5e-15) tmp = t_1; elseif (t <= -9.8e-68) tmp = t_2; elseif ((t <= -7.5e-83) || ~((t <= 0.85))) tmp = x + y; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(x + N[(z * N[(y / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(x - N[(y * N[(z / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -6.5e+186], N[(x + y), $MachinePrecision], If[LessEqual[t, -2.4e+42], t$95$2, If[LessEqual[t, -8.5e-15], t$95$1, If[LessEqual[t, -9.8e-68], t$95$2, If[Or[LessEqual[t, -7.5e-83], N[Not[LessEqual[t, 0.85]], $MachinePrecision]], N[(x + y), $MachinePrecision], t$95$1]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x + z \cdot \frac{y}{a}\\
t_2 := x - y \cdot \frac{z}{t}\\
\mathbf{if}\;t \leq -6.5 \cdot 10^{+186}:\\
\;\;\;\;x + y\\
\mathbf{elif}\;t \leq -2.4 \cdot 10^{+42}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;t \leq -8.5 \cdot 10^{-15}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq -9.8 \cdot 10^{-68}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;t \leq -7.5 \cdot 10^{-83} \lor \neg \left(t \leq 0.85\right):\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t < -6.4999999999999997e186 or -9.79999999999999954e-68 < t < -7.4999999999999997e-83 or 0.849999999999999978 < t Initial program 100.0%
Taylor expanded in t around inf 79.4%
+-commutative79.4%
Simplified79.4%
if -6.4999999999999997e186 < t < -2.3999999999999999e42 or -8.50000000000000007e-15 < t < -9.79999999999999954e-68Initial program 99.9%
Taylor expanded in z around inf 81.0%
Taylor expanded in a around 0 76.9%
mul-1-neg76.9%
unsub-neg76.9%
associate-*r/79.9%
Simplified79.9%
if -2.3999999999999999e42 < t < -8.50000000000000007e-15 or -7.4999999999999997e-83 < t < 0.849999999999999978Initial program 95.6%
associate-*r/94.5%
Simplified94.5%
*-commutative94.5%
associate-/l*99.2%
Applied egg-rr99.2%
Taylor expanded in t around 0 79.4%
*-commutative79.4%
associate-/l*83.5%
Simplified83.5%
Final simplification81.6%
(FPCore (x y z t a)
:precision binary64
(if (<= t -6.5e+186)
(+ x y)
(if (<= t -2.2e+20)
(- x (* y (/ z t)))
(if (<= t -0.055)
(/ (* t y) (- t a))
(if (or (<= t -3.8e-21) (and (not (<= t -7.5e-83)) (<= t 2150.0)))
(+ x (* z (/ y a)))
(+ x y))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -6.5e+186) {
tmp = x + y;
} else if (t <= -2.2e+20) {
tmp = x - (y * (z / t));
} else if (t <= -0.055) {
tmp = (t * y) / (t - a);
} else if ((t <= -3.8e-21) || (!(t <= -7.5e-83) && (t <= 2150.0))) {
tmp = x + (z * (y / a));
} else {
tmp = x + 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) :: tmp
if (t <= (-6.5d+186)) then
tmp = x + y
else if (t <= (-2.2d+20)) then
tmp = x - (y * (z / t))
else if (t <= (-0.055d0)) then
tmp = (t * y) / (t - a)
else if ((t <= (-3.8d-21)) .or. (.not. (t <= (-7.5d-83))) .and. (t <= 2150.0d0)) then
tmp = x + (z * (y / a))
else
tmp = x + y
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -6.5e+186) {
tmp = x + y;
} else if (t <= -2.2e+20) {
tmp = x - (y * (z / t));
} else if (t <= -0.055) {
tmp = (t * y) / (t - a);
} else if ((t <= -3.8e-21) || (!(t <= -7.5e-83) && (t <= 2150.0))) {
tmp = x + (z * (y / a));
} else {
tmp = x + y;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if t <= -6.5e+186: tmp = x + y elif t <= -2.2e+20: tmp = x - (y * (z / t)) elif t <= -0.055: tmp = (t * y) / (t - a) elif (t <= -3.8e-21) or (not (t <= -7.5e-83) and (t <= 2150.0)): tmp = x + (z * (y / a)) else: tmp = x + y return tmp
function code(x, y, z, t, a) tmp = 0.0 if (t <= -6.5e+186) tmp = Float64(x + y); elseif (t <= -2.2e+20) tmp = Float64(x - Float64(y * Float64(z / t))); elseif (t <= -0.055) tmp = Float64(Float64(t * y) / Float64(t - a)); elseif ((t <= -3.8e-21) || (!(t <= -7.5e-83) && (t <= 2150.0))) tmp = Float64(x + Float64(z * Float64(y / a))); else tmp = Float64(x + y); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (t <= -6.5e+186) tmp = x + y; elseif (t <= -2.2e+20) tmp = x - (y * (z / t)); elseif (t <= -0.055) tmp = (t * y) / (t - a); elseif ((t <= -3.8e-21) || (~((t <= -7.5e-83)) && (t <= 2150.0))) tmp = x + (z * (y / a)); else tmp = x + y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, -6.5e+186], N[(x + y), $MachinePrecision], If[LessEqual[t, -2.2e+20], N[(x - N[(y * N[(z / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, -0.055], N[(N[(t * y), $MachinePrecision] / N[(t - a), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[t, -3.8e-21], And[N[Not[LessEqual[t, -7.5e-83]], $MachinePrecision], LessEqual[t, 2150.0]]], N[(x + N[(z * N[(y / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + y), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -6.5 \cdot 10^{+186}:\\
\;\;\;\;x + y\\
\mathbf{elif}\;t \leq -2.2 \cdot 10^{+20}:\\
\;\;\;\;x - y \cdot \frac{z}{t}\\
\mathbf{elif}\;t \leq -0.055:\\
\;\;\;\;\frac{t \cdot y}{t - a}\\
\mathbf{elif}\;t \leq -3.8 \cdot 10^{-21} \lor \neg \left(t \leq -7.5 \cdot 10^{-83}\right) \land t \leq 2150:\\
\;\;\;\;x + z \cdot \frac{y}{a}\\
\mathbf{else}:\\
\;\;\;\;x + y\\
\end{array}
\end{array}
if t < -6.4999999999999997e186 or -3.7999999999999998e-21 < t < -7.4999999999999997e-83 or 2150 < t Initial program 99.9%
Taylor expanded in t around inf 77.9%
+-commutative77.9%
Simplified77.9%
if -6.4999999999999997e186 < t < -2.2e20Initial program 99.9%
Taylor expanded in z around inf 83.6%
Taylor expanded in a around 0 80.3%
mul-1-neg80.3%
unsub-neg80.3%
associate-*r/83.9%
Simplified83.9%
if -2.2e20 < t < -0.0550000000000000003Initial program 100.0%
associate-*r/100.0%
Simplified100.0%
*-commutative100.0%
associate-/l*99.6%
Applied egg-rr99.6%
Taylor expanded in z around 0 76.4%
mul-1-neg76.4%
unsub-neg76.4%
associate-/l*76.0%
Simplified76.0%
Taylor expanded in x around 0 76.4%
associate-*r/76.4%
*-commutative76.4%
neg-mul-176.4%
distribute-rgt-neg-in76.4%
Simplified76.4%
if -0.0550000000000000003 < t < -3.7999999999999998e-21 or -7.4999999999999997e-83 < t < 2150Initial program 95.4%
associate-*r/94.3%
Simplified94.3%
*-commutative94.3%
associate-/l*99.2%
Applied egg-rr99.2%
Taylor expanded in t around 0 80.1%
*-commutative80.1%
associate-/l*84.3%
Simplified84.3%
Final simplification81.8%
(FPCore (x y z t a) :precision binary64 (if (or (<= t -4.2e+187) (not (<= t 2.4e+129))) (+ x y) (- x (* y (/ z (- t a))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -4.2e+187) || !(t <= 2.4e+129)) {
tmp = x + y;
} else {
tmp = x - (y * (z / (t - 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 <= (-4.2d+187)) .or. (.not. (t <= 2.4d+129))) then
tmp = x + y
else
tmp = x - (y * (z / (t - 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 <= -4.2e+187) || !(t <= 2.4e+129)) {
tmp = x + y;
} else {
tmp = x - (y * (z / (t - a)));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (t <= -4.2e+187) or not (t <= 2.4e+129): tmp = x + y else: tmp = x - (y * (z / (t - a))) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((t <= -4.2e+187) || !(t <= 2.4e+129)) tmp = Float64(x + y); else tmp = Float64(x - Float64(y * Float64(z / Float64(t - a)))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((t <= -4.2e+187) || ~((t <= 2.4e+129))) tmp = x + y; else tmp = x - (y * (z / (t - a))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[t, -4.2e+187], N[Not[LessEqual[t, 2.4e+129]], $MachinePrecision]], N[(x + y), $MachinePrecision], N[(x - N[(y * N[(z / N[(t - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -4.2 \cdot 10^{+187} \lor \neg \left(t \leq 2.4 \cdot 10^{+129}\right):\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;x - y \cdot \frac{z}{t - a}\\
\end{array}
\end{array}
if t < -4.2e187 or 2.3999999999999999e129 < t Initial program 100.0%
Taylor expanded in t around inf 83.6%
+-commutative83.6%
Simplified83.6%
if -4.2e187 < t < 2.3999999999999999e129Initial program 96.8%
Taylor expanded in z around inf 86.2%
associate-/l*87.5%
Simplified87.5%
Final simplification86.5%
(FPCore (x y z t a) :precision binary64 (if (or (<= t -2.5e+187) (not (<= t 1.4e+129))) (+ x y) (- x (* z (/ y (- t a))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -2.5e+187) || !(t <= 1.4e+129)) {
tmp = x + y;
} else {
tmp = x - (z * (y / (t - 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+187)) .or. (.not. (t <= 1.4d+129))) then
tmp = x + y
else
tmp = x - (z * (y / (t - 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+187) || !(t <= 1.4e+129)) {
tmp = x + y;
} else {
tmp = x - (z * (y / (t - a)));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (t <= -2.5e+187) or not (t <= 1.4e+129): tmp = x + y else: tmp = x - (z * (y / (t - a))) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((t <= -2.5e+187) || !(t <= 1.4e+129)) tmp = Float64(x + y); else tmp = Float64(x - Float64(z * Float64(y / Float64(t - a)))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((t <= -2.5e+187) || ~((t <= 1.4e+129))) tmp = x + y; else tmp = x - (z * (y / (t - a))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[t, -2.5e+187], N[Not[LessEqual[t, 1.4e+129]], $MachinePrecision]], N[(x + y), $MachinePrecision], N[(x - N[(z * N[(y / N[(t - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -2.5 \cdot 10^{+187} \lor \neg \left(t \leq 1.4 \cdot 10^{+129}\right):\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;x - z \cdot \frac{y}{t - a}\\
\end{array}
\end{array}
if t < -2.5000000000000001e187 or 1.39999999999999987e129 < t Initial program 100.0%
Taylor expanded in t around inf 83.6%
+-commutative83.6%
Simplified83.6%
if -2.5000000000000001e187 < t < 1.39999999999999987e129Initial program 96.8%
Taylor expanded in z around inf 86.2%
div-inv86.2%
*-commutative86.2%
associate-*l*88.6%
*-commutative88.6%
associate-*l/88.7%
*-un-lft-identity88.7%
Applied egg-rr88.7%
Final simplification87.3%
(FPCore (x y z t a) :precision binary64 (if (or (<= t -2.5e+111) (not (<= t 3.3e+123))) (+ x (/ y (- 1.0 (/ a t)))) (- x (* z (/ y (- t a))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -2.5e+111) || !(t <= 3.3e+123)) {
tmp = x + (y / (1.0 - (a / t)));
} else {
tmp = x - (z * (y / (t - 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+111)) .or. (.not. (t <= 3.3d+123))) then
tmp = x + (y / (1.0d0 - (a / t)))
else
tmp = x - (z * (y / (t - 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+111) || !(t <= 3.3e+123)) {
tmp = x + (y / (1.0 - (a / t)));
} else {
tmp = x - (z * (y / (t - a)));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (t <= -2.5e+111) or not (t <= 3.3e+123): tmp = x + (y / (1.0 - (a / t))) else: tmp = x - (z * (y / (t - a))) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((t <= -2.5e+111) || !(t <= 3.3e+123)) tmp = Float64(x + Float64(y / Float64(1.0 - Float64(a / t)))); else tmp = Float64(x - Float64(z * Float64(y / Float64(t - a)))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((t <= -2.5e+111) || ~((t <= 3.3e+123))) tmp = x + (y / (1.0 - (a / t))); else tmp = x - (z * (y / (t - a))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[t, -2.5e+111], N[Not[LessEqual[t, 3.3e+123]], $MachinePrecision]], N[(x + N[(y / N[(1.0 - N[(a / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x - N[(z * N[(y / N[(t - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -2.5 \cdot 10^{+111} \lor \neg \left(t \leq 3.3 \cdot 10^{+123}\right):\\
\;\;\;\;x + \frac{y}{1 - \frac{a}{t}}\\
\mathbf{else}:\\
\;\;\;\;x - z \cdot \frac{y}{t - a}\\
\end{array}
\end{array}
if t < -2.4999999999999998e111 or 3.30000000000000003e123 < t Initial program 100.0%
clear-num99.9%
un-div-inv99.9%
Applied egg-rr99.9%
div-sub99.9%
Applied egg-rr99.9%
Taylor expanded in z around 0 90.9%
+-commutative90.9%
mul-1-neg90.9%
unsub-neg90.9%
Simplified90.9%
if -2.4999999999999998e111 < t < 3.30000000000000003e123Initial program 96.6%
Taylor expanded in z around inf 86.9%
div-inv86.8%
*-commutative86.8%
associate-*l*89.4%
*-commutative89.4%
associate-*l/89.5%
*-un-lft-identity89.5%
Applied egg-rr89.5%
Final simplification89.9%
(FPCore (x y z t a) :precision binary64 (if (or (<= t -0.0074) (not (<= t 1.45e+76))) (+ x (* y (- 1.0 (/ z t)))) (+ x (* z (/ y (- a t))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -0.0074) || !(t <= 1.45e+76)) {
tmp = x + (y * (1.0 - (z / t)));
} else {
tmp = x + (z * (y / (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 <= (-0.0074d0)) .or. (.not. (t <= 1.45d+76))) then
tmp = x + (y * (1.0d0 - (z / t)))
else
tmp = x + (z * (y / (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 <= -0.0074) || !(t <= 1.45e+76)) {
tmp = x + (y * (1.0 - (z / t)));
} else {
tmp = x + (z * (y / (a - t)));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (t <= -0.0074) or not (t <= 1.45e+76): tmp = x + (y * (1.0 - (z / t))) else: tmp = x + (z * (y / (a - t))) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((t <= -0.0074) || !(t <= 1.45e+76)) tmp = Float64(x + Float64(y * Float64(1.0 - Float64(z / t)))); else tmp = Float64(x + Float64(z * Float64(y / Float64(a - t)))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((t <= -0.0074) || ~((t <= 1.45e+76))) tmp = x + (y * (1.0 - (z / t))); else tmp = x + (z * (y / (a - t))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[t, -0.0074], N[Not[LessEqual[t, 1.45e+76]], $MachinePrecision]], N[(x + N[(y * N[(1.0 - N[(z / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(z * N[(y / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -0.0074 \lor \neg \left(t \leq 1.45 \cdot 10^{+76}\right):\\
\;\;\;\;x + y \cdot \left(1 - \frac{z}{t}\right)\\
\mathbf{else}:\\
\;\;\;\;x + z \cdot \frac{y}{a - t}\\
\end{array}
\end{array}
if t < -0.0074000000000000003 or 1.4500000000000001e76 < t Initial program 100.0%
Taylor expanded in a around 0 65.3%
mul-1-neg65.3%
unsub-neg65.3%
associate-/l*90.5%
div-sub90.5%
sub-neg90.5%
*-inverses90.5%
metadata-eval90.5%
Simplified90.5%
if -0.0074000000000000003 < t < 1.4500000000000001e76Initial program 95.9%
Taylor expanded in z around inf 88.1%
div-inv88.1%
*-commutative88.1%
associate-*l*92.4%
*-commutative92.4%
associate-*l/92.5%
*-un-lft-identity92.5%
Applied egg-rr92.5%
Final simplification91.6%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (/ y (- t a))))
(if (<= t -3.2e+109)
(+ x (/ y (- 1.0 (/ a t))))
(if (<= t 3.1e+125) (- x (* z t_1)) (+ x (* t t_1))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = y / (t - a);
double tmp;
if (t <= -3.2e+109) {
tmp = x + (y / (1.0 - (a / t)));
} else if (t <= 3.1e+125) {
tmp = x - (z * t_1);
} else {
tmp = x + (t * 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 = y / (t - a)
if (t <= (-3.2d+109)) then
tmp = x + (y / (1.0d0 - (a / t)))
else if (t <= 3.1d+125) then
tmp = x - (z * t_1)
else
tmp = x + (t * 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 = y / (t - a);
double tmp;
if (t <= -3.2e+109) {
tmp = x + (y / (1.0 - (a / t)));
} else if (t <= 3.1e+125) {
tmp = x - (z * t_1);
} else {
tmp = x + (t * t_1);
}
return tmp;
}
def code(x, y, z, t, a): t_1 = y / (t - a) tmp = 0 if t <= -3.2e+109: tmp = x + (y / (1.0 - (a / t))) elif t <= 3.1e+125: tmp = x - (z * t_1) else: tmp = x + (t * t_1) return tmp
function code(x, y, z, t, a) t_1 = Float64(y / Float64(t - a)) tmp = 0.0 if (t <= -3.2e+109) tmp = Float64(x + Float64(y / Float64(1.0 - Float64(a / t)))); elseif (t <= 3.1e+125) tmp = Float64(x - Float64(z * t_1)); else tmp = Float64(x + Float64(t * t_1)); end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = y / (t - a); tmp = 0.0; if (t <= -3.2e+109) tmp = x + (y / (1.0 - (a / t))); elseif (t <= 3.1e+125) tmp = x - (z * t_1); else tmp = x + (t * t_1); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(y / N[(t - a), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -3.2e+109], N[(x + N[(y / N[(1.0 - N[(a / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 3.1e+125], N[(x - N[(z * t$95$1), $MachinePrecision]), $MachinePrecision], N[(x + N[(t * t$95$1), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{y}{t - a}\\
\mathbf{if}\;t \leq -3.2 \cdot 10^{+109}:\\
\;\;\;\;x + \frac{y}{1 - \frac{a}{t}}\\
\mathbf{elif}\;t \leq 3.1 \cdot 10^{+125}:\\
\;\;\;\;x - z \cdot t\_1\\
\mathbf{else}:\\
\;\;\;\;x + t \cdot t\_1\\
\end{array}
\end{array}
if t < -3.2000000000000001e109Initial program 100.0%
clear-num100.0%
un-div-inv100.0%
Applied egg-rr100.0%
div-sub100.0%
Applied egg-rr100.0%
Taylor expanded in z around 0 92.1%
+-commutative92.1%
mul-1-neg92.1%
unsub-neg92.1%
Simplified92.1%
if -3.2000000000000001e109 < t < 3.1e125Initial program 96.6%
Taylor expanded in z around inf 86.9%
div-inv86.8%
*-commutative86.8%
associate-*l*89.4%
*-commutative89.4%
associate-*l/89.5%
*-un-lft-identity89.5%
Applied egg-rr89.5%
if 3.1e125 < t Initial program 100.0%
associate-*r/62.0%
Simplified62.0%
*-commutative62.0%
associate-/l*99.9%
Applied egg-rr99.9%
Taylor expanded in z around 0 56.5%
mul-1-neg56.5%
unsub-neg56.5%
associate-/l*89.9%
Simplified89.9%
Final simplification89.9%
(FPCore (x y z t a) :precision binary64 (if (or (<= t -0.0033) (not (<= t 1850.0))) (+ x y) (+ x (* z (/ y a)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -0.0033) || !(t <= 1850.0)) {
tmp = x + y;
} else {
tmp = x + (z * (y / 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 <= (-0.0033d0)) .or. (.not. (t <= 1850.0d0))) then
tmp = x + y
else
tmp = x + (z * (y / 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 <= -0.0033) || !(t <= 1850.0)) {
tmp = x + y;
} else {
tmp = x + (z * (y / a));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (t <= -0.0033) or not (t <= 1850.0): tmp = x + y else: tmp = x + (z * (y / a)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((t <= -0.0033) || !(t <= 1850.0)) tmp = Float64(x + y); else tmp = Float64(x + Float64(z * Float64(y / a))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((t <= -0.0033) || ~((t <= 1850.0))) tmp = x + y; else tmp = x + (z * (y / a)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[t, -0.0033], N[Not[LessEqual[t, 1850.0]], $MachinePrecision]], N[(x + y), $MachinePrecision], N[(x + N[(z * N[(y / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -0.0033 \lor \neg \left(t \leq 1850\right):\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;x + z \cdot \frac{y}{a}\\
\end{array}
\end{array}
if t < -0.0033 or 1850 < t Initial program 100.0%
Taylor expanded in t around inf 73.7%
+-commutative73.7%
Simplified73.7%
if -0.0033 < t < 1850Initial program 95.8%
associate-*r/94.7%
Simplified94.7%
*-commutative94.7%
associate-/l*99.2%
Applied egg-rr99.2%
Taylor expanded in t around 0 77.5%
*-commutative77.5%
associate-/l*81.4%
Simplified81.4%
Final simplification78.0%
(FPCore (x y z t a) :precision binary64 (if (or (<= t -1.45e-84) (not (<= t 2.1e+112))) (+ x y) x))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -1.45e-84) || !(t <= 2.1e+112)) {
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 ((t <= (-1.45d-84)) .or. (.not. (t <= 2.1d+112))) 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 ((t <= -1.45e-84) || !(t <= 2.1e+112)) {
tmp = x + y;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (t <= -1.45e-84) or not (t <= 2.1e+112): tmp = x + y else: tmp = x return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((t <= -1.45e-84) || !(t <= 2.1e+112)) tmp = Float64(x + y); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((t <= -1.45e-84) || ~((t <= 2.1e+112))) tmp = x + y; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[t, -1.45e-84], N[Not[LessEqual[t, 2.1e+112]], $MachinePrecision]], N[(x + y), $MachinePrecision], x]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.45 \cdot 10^{-84} \lor \neg \left(t \leq 2.1 \cdot 10^{+112}\right):\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if t < -1.4500000000000001e-84 or 2.0999999999999999e112 < t Initial program 99.9%
Taylor expanded in t around inf 73.5%
+-commutative73.5%
Simplified73.5%
if -1.4500000000000001e-84 < t < 2.0999999999999999e112Initial program 95.6%
Taylor expanded in x around inf 52.1%
Final simplification62.1%
(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 97.6%
Final simplification97.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 97.6%
Taylor expanded in x around inf 49.7%
Final simplification49.7%
(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 2024096
(FPCore (x y z t a)
:name "Graphics.Rendering.Plot.Render.Plot.Axis:renderAxisLine from plot-0.2.3.4, B"
:precision binary64
:alt
(if (< y -8.508084860551241e-17) (+ x (* y (/ (- z t) (- a t)))) (if (< y 2.894426862792089e-49) (+ x (* (* y (- z t)) (/ 1.0 (- a t)))) (+ x (* y (/ (- z t) (- a t))))))
(+ x (* y (/ (- z t) (- a t)))))