
(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(Float64(y * 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[(N[(y * N[(z - t), $MachinePrecision]), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \frac{y \cdot \left(z - t\right)}{a - t}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 10 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(Float64(y * 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[(N[(y * N[(z - t), $MachinePrecision]), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \frac{y \cdot \left(z - t\right)}{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 83.4%
associate-/l*99.6%
Simplified99.6%
clear-num99.5%
un-div-inv99.7%
Applied egg-rr99.7%
Final simplification99.7%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (+ x (* t (/ y (- t a))))))
(if (<= t -1.15e+58)
t_1
(if (<= t -6e-79)
(- x (/ y (/ t z)))
(if (<= t -1.38e-111)
(+ x y)
(if (<= t 9.5e+57) (+ x (* y (/ z a))) t_1))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = x + (t * (y / (t - a)));
double tmp;
if (t <= -1.15e+58) {
tmp = t_1;
} else if (t <= -6e-79) {
tmp = x - (y / (t / z));
} else if (t <= -1.38e-111) {
tmp = x + y;
} else if (t <= 9.5e+57) {
tmp = x + (y * (z / a));
} 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 + (t * (y / (t - a)))
if (t <= (-1.15d+58)) then
tmp = t_1
else if (t <= (-6d-79)) then
tmp = x - (y / (t / z))
else if (t <= (-1.38d-111)) then
tmp = x + y
else if (t <= 9.5d+57) then
tmp = x + (y * (z / a))
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 + (t * (y / (t - a)));
double tmp;
if (t <= -1.15e+58) {
tmp = t_1;
} else if (t <= -6e-79) {
tmp = x - (y / (t / z));
} else if (t <= -1.38e-111) {
tmp = x + y;
} else if (t <= 9.5e+57) {
tmp = x + (y * (z / a));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = x + (t * (y / (t - a))) tmp = 0 if t <= -1.15e+58: tmp = t_1 elif t <= -6e-79: tmp = x - (y / (t / z)) elif t <= -1.38e-111: tmp = x + y elif t <= 9.5e+57: tmp = x + (y * (z / a)) else: tmp = t_1 return tmp
function code(x, y, z, t, a) t_1 = Float64(x + Float64(t * Float64(y / Float64(t - a)))) tmp = 0.0 if (t <= -1.15e+58) tmp = t_1; elseif (t <= -6e-79) tmp = Float64(x - Float64(y / Float64(t / z))); elseif (t <= -1.38e-111) tmp = Float64(x + y); elseif (t <= 9.5e+57) tmp = Float64(x + Float64(y * Float64(z / a))); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = x + (t * (y / (t - a))); tmp = 0.0; if (t <= -1.15e+58) tmp = t_1; elseif (t <= -6e-79) tmp = x - (y / (t / z)); elseif (t <= -1.38e-111) tmp = x + y; elseif (t <= 9.5e+57) tmp = x + (y * (z / a)); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(x + N[(t * N[(y / N[(t - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -1.15e+58], t$95$1, If[LessEqual[t, -6e-79], N[(x - N[(y / N[(t / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, -1.38e-111], N[(x + y), $MachinePrecision], If[LessEqual[t, 9.5e+57], N[(x + N[(y * N[(z / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x + t \cdot \frac{y}{t - a}\\
\mathbf{if}\;t \leq -1.15 \cdot 10^{+58}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq -6 \cdot 10^{-79}:\\
\;\;\;\;x - \frac{y}{\frac{t}{z}}\\
\mathbf{elif}\;t \leq -1.38 \cdot 10^{-111}:\\
\;\;\;\;x + y\\
\mathbf{elif}\;t \leq 9.5 \cdot 10^{+57}:\\
\;\;\;\;x + y \cdot \frac{z}{a}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t < -1.15000000000000001e58 or 9.4999999999999997e57 < t Initial program 72.1%
associate-/l*100.0%
Simplified100.0%
Taylor expanded in z around 0 68.0%
associate-*r/68.0%
mul-1-neg68.0%
distribute-lft-neg-out68.0%
*-commutative68.0%
associate-/l*91.3%
distribute-neg-frac91.3%
distribute-neg-frac291.3%
neg-sub091.3%
associate--r-91.3%
neg-sub091.3%
Simplified91.3%
Taylor expanded in y around 0 68.0%
associate-/l*86.5%
Simplified86.5%
if -1.15000000000000001e58 < t < -5.99999999999999999e-79Initial program 100.0%
associate-/l*99.9%
Simplified99.9%
clear-num99.9%
un-div-inv99.9%
Applied egg-rr99.9%
Taylor expanded in z around inf 94.6%
Taylor expanded in a around 0 78.3%
neg-mul-178.3%
distribute-neg-frac278.3%
Simplified78.3%
if -5.99999999999999999e-79 < t < -1.38000000000000004e-111Initial program 100.0%
associate-/l*100.0%
Simplified100.0%
Taylor expanded in t around inf 100.0%
if -1.38000000000000004e-111 < t < 9.4999999999999997e57Initial program 92.4%
associate-/l*99.1%
Simplified99.1%
Taylor expanded in t around 0 79.6%
associate-/l*84.9%
Simplified84.9%
Final simplification85.4%
(FPCore (x y z t a)
:precision binary64
(if (<= t -2.15e+60)
(+ x (* t (/ y t)))
(if (<= t -4e-79)
(- x (/ y (/ t z)))
(if (or (<= t -4.2e-110) (not (<= t 3.165e+60)))
(+ x y)
(+ x (* y (/ z a)))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -2.15e+60) {
tmp = x + (t * (y / t));
} else if (t <= -4e-79) {
tmp = x - (y / (t / z));
} else if ((t <= -4.2e-110) || !(t <= 3.165e+60)) {
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.15d+60)) then
tmp = x + (t * (y / t))
else if (t <= (-4d-79)) then
tmp = x - (y / (t / z))
else if ((t <= (-4.2d-110)) .or. (.not. (t <= 3.165d+60))) 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.15e+60) {
tmp = x + (t * (y / t));
} else if (t <= -4e-79) {
tmp = x - (y / (t / z));
} else if ((t <= -4.2e-110) || !(t <= 3.165e+60)) {
tmp = x + y;
} else {
tmp = x + (y * (z / a));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if t <= -2.15e+60: tmp = x + (t * (y / t)) elif t <= -4e-79: tmp = x - (y / (t / z)) elif (t <= -4.2e-110) or not (t <= 3.165e+60): tmp = x + y else: tmp = x + (y * (z / a)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (t <= -2.15e+60) tmp = Float64(x + Float64(t * Float64(y / t))); elseif (t <= -4e-79) tmp = Float64(x - Float64(y / Float64(t / z))); elseif ((t <= -4.2e-110) || !(t <= 3.165e+60)) 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.15e+60) tmp = x + (t * (y / t)); elseif (t <= -4e-79) tmp = x - (y / (t / z)); elseif ((t <= -4.2e-110) || ~((t <= 3.165e+60))) tmp = x + y; else tmp = x + (y * (z / a)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, -2.15e+60], N[(x + N[(t * N[(y / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, -4e-79], N[(x - N[(y / N[(t / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[t, -4.2e-110], N[Not[LessEqual[t, 3.165e+60]], $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.15 \cdot 10^{+60}:\\
\;\;\;\;x + t \cdot \frac{y}{t}\\
\mathbf{elif}\;t \leq -4 \cdot 10^{-79}:\\
\;\;\;\;x - \frac{y}{\frac{t}{z}}\\
\mathbf{elif}\;t \leq -4.2 \cdot 10^{-110} \lor \neg \left(t \leq 3.165 \cdot 10^{+60}\right):\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot \frac{z}{a}\\
\end{array}
\end{array}
if t < -2.14999999999999986e60Initial program 68.6%
associate-/l*100.0%
Simplified100.0%
Taylor expanded in z around 0 65.2%
associate-*r/65.2%
mul-1-neg65.2%
distribute-lft-neg-out65.2%
*-commutative65.2%
associate-/l*90.2%
distribute-neg-frac90.2%
distribute-neg-frac290.2%
neg-sub090.2%
associate--r-90.2%
neg-sub090.2%
Simplified90.2%
Taylor expanded in y around 0 65.2%
associate-/l*83.9%
Simplified83.9%
Taylor expanded in t around inf 78.9%
if -2.14999999999999986e60 < t < -4e-79Initial program 100.0%
associate-/l*99.9%
Simplified99.9%
clear-num99.8%
un-div-inv99.8%
Applied egg-rr99.8%
Taylor expanded in z around inf 89.6%
Taylor expanded in a around 0 74.3%
neg-mul-174.3%
distribute-neg-frac274.3%
Simplified74.3%
if -4e-79 < t < -4.20000000000000004e-110 or 3.165e60 < t Initial program 75.8%
associate-/l*100.0%
Simplified100.0%
Taylor expanded in t around inf 83.3%
if -4.20000000000000004e-110 < t < 3.165e60Initial program 92.5%
associate-/l*99.1%
Simplified99.1%
Taylor expanded in t around 0 79.9%
associate-/l*85.1%
Simplified85.1%
Final simplification82.4%
(FPCore (x y z t a) :precision binary64 (if (or (<= t -3.5e+57) (not (<= t 5.9e+82))) (+ x (* t (/ y (- t a)))) (+ x (* y (/ z (- a t))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -3.5e+57) || !(t <= 5.9e+82)) {
tmp = x + (t * (y / (t - a)));
} 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 <= (-3.5d+57)) .or. (.not. (t <= 5.9d+82))) then
tmp = x + (t * (y / (t - a)))
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 <= -3.5e+57) || !(t <= 5.9e+82)) {
tmp = x + (t * (y / (t - a)));
} else {
tmp = x + (y * (z / (a - t)));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (t <= -3.5e+57) or not (t <= 5.9e+82): tmp = x + (t * (y / (t - a))) else: tmp = x + (y * (z / (a - t))) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((t <= -3.5e+57) || !(t <= 5.9e+82)) tmp = Float64(x + Float64(t * Float64(y / Float64(t - a)))); 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 <= -3.5e+57) || ~((t <= 5.9e+82))) tmp = x + (t * (y / (t - a))); else tmp = x + (y * (z / (a - t))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[t, -3.5e+57], N[Not[LessEqual[t, 5.9e+82]], $MachinePrecision]], N[(x + N[(t * N[(y / N[(t - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(y * N[(z / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -3.5 \cdot 10^{+57} \lor \neg \left(t \leq 5.9 \cdot 10^{+82}\right):\\
\;\;\;\;x + t \cdot \frac{y}{t - a}\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot \frac{z}{a - t}\\
\end{array}
\end{array}
if t < -3.4999999999999997e57 or 5.8999999999999997e82 < t Initial program 70.7%
associate-/l*100.0%
Simplified100.0%
Taylor expanded in z around 0 67.2%
associate-*r/67.2%
mul-1-neg67.2%
distribute-lft-neg-out67.2%
*-commutative67.2%
associate-/l*91.5%
distribute-neg-frac91.5%
distribute-neg-frac291.5%
neg-sub091.5%
associate--r-91.5%
neg-sub091.5%
Simplified91.5%
Taylor expanded in y around 0 67.2%
associate-/l*86.3%
Simplified86.3%
if -3.4999999999999997e57 < t < 5.8999999999999997e82Initial program 93.3%
associate-/l*99.3%
Simplified99.3%
Taylor expanded in z around inf 88.8%
associate-/l*94.0%
Simplified94.0%
Final simplification90.6%
(FPCore (x y z t a) :precision binary64 (if (or (<= t -5.2e+57) (not (<= t 3.1e+97))) (+ x (* t (/ y (- t a)))) (+ x (/ y (/ (- a t) z)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -5.2e+57) || !(t <= 3.1e+97)) {
tmp = x + (t * (y / (t - a)));
} 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 <= (-5.2d+57)) .or. (.not. (t <= 3.1d+97))) then
tmp = x + (t * (y / (t - a)))
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 <= -5.2e+57) || !(t <= 3.1e+97)) {
tmp = x + (t * (y / (t - a)));
} else {
tmp = x + (y / ((a - t) / z));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (t <= -5.2e+57) or not (t <= 3.1e+97): tmp = x + (t * (y / (t - a))) else: tmp = x + (y / ((a - t) / z)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((t <= -5.2e+57) || !(t <= 3.1e+97)) tmp = Float64(x + Float64(t * Float64(y / Float64(t - a)))); 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 <= -5.2e+57) || ~((t <= 3.1e+97))) tmp = x + (t * (y / (t - a))); else tmp = x + (y / ((a - t) / z)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[t, -5.2e+57], N[Not[LessEqual[t, 3.1e+97]], $MachinePrecision]], N[(x + N[(t * N[(y / N[(t - a), $MachinePrecision]), $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 -5.2 \cdot 10^{+57} \lor \neg \left(t \leq 3.1 \cdot 10^{+97}\right):\\
\;\;\;\;x + t \cdot \frac{y}{t - a}\\
\mathbf{else}:\\
\;\;\;\;x + \frac{y}{\frac{a - t}{z}}\\
\end{array}
\end{array}
if t < -5.2e57 or 3.09999999999999981e97 < t Initial program 70.7%
associate-/l*100.0%
Simplified100.0%
Taylor expanded in z around 0 67.2%
associate-*r/67.2%
mul-1-neg67.2%
distribute-lft-neg-out67.2%
*-commutative67.2%
associate-/l*91.5%
distribute-neg-frac91.5%
distribute-neg-frac291.5%
neg-sub091.5%
associate--r-91.5%
neg-sub091.5%
Simplified91.5%
Taylor expanded in y around 0 67.2%
associate-/l*86.3%
Simplified86.3%
if -5.2e57 < t < 3.09999999999999981e97Initial program 93.3%
associate-/l*99.3%
Simplified99.3%
clear-num99.2%
un-div-inv99.6%
Applied egg-rr99.6%
Taylor expanded in z around inf 94.4%
Final simplification90.8%
(FPCore (x y z t a) :precision binary64 (if (or (<= t -9e+57) (not (<= t 1.1e+82))) (+ x (* y (/ t (- t a)))) (+ x (/ y (/ (- a t) z)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -9e+57) || !(t <= 1.1e+82)) {
tmp = x + (y * (t / (t - a)));
} 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 <= (-9d+57)) .or. (.not. (t <= 1.1d+82))) then
tmp = x + (y * (t / (t - a)))
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 <= -9e+57) || !(t <= 1.1e+82)) {
tmp = x + (y * (t / (t - a)));
} else {
tmp = x + (y / ((a - t) / z));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (t <= -9e+57) or not (t <= 1.1e+82): tmp = x + (y * (t / (t - a))) else: tmp = x + (y / ((a - t) / z)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((t <= -9e+57) || !(t <= 1.1e+82)) tmp = Float64(x + Float64(y * Float64(t / Float64(t - a)))); 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 <= -9e+57) || ~((t <= 1.1e+82))) tmp = x + (y * (t / (t - a))); else tmp = x + (y / ((a - t) / z)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[t, -9e+57], N[Not[LessEqual[t, 1.1e+82]], $MachinePrecision]], N[(x + N[(y * N[(t / N[(t - a), $MachinePrecision]), $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 -9 \cdot 10^{+57} \lor \neg \left(t \leq 1.1 \cdot 10^{+82}\right):\\
\;\;\;\;x + y \cdot \frac{t}{t - a}\\
\mathbf{else}:\\
\;\;\;\;x + \frac{y}{\frac{a - t}{z}}\\
\end{array}
\end{array}
if t < -8.99999999999999991e57 or 1.1000000000000001e82 < t Initial program 70.7%
associate-/l*100.0%
Simplified100.0%
Taylor expanded in z around 0 67.2%
associate-*r/67.2%
mul-1-neg67.2%
distribute-lft-neg-out67.2%
*-commutative67.2%
associate-/l*91.5%
distribute-neg-frac91.5%
distribute-neg-frac291.5%
neg-sub091.5%
associate--r-91.5%
neg-sub091.5%
Simplified91.5%
if -8.99999999999999991e57 < t < 1.1000000000000001e82Initial program 93.3%
associate-/l*99.3%
Simplified99.3%
clear-num99.2%
un-div-inv99.6%
Applied egg-rr99.6%
Taylor expanded in z around inf 94.4%
Final simplification93.1%
(FPCore (x y z t a) :precision binary64 (if (<= t -4.2e-110) (+ x (* t (/ y t))) (if (<= t 3.165e+60) (+ x (* y (/ z a))) (+ x y))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -4.2e-110) {
tmp = x + (t * (y / t));
} else if (t <= 3.165e+60) {
tmp = x + (y * (z / 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 <= (-4.2d-110)) then
tmp = x + (t * (y / t))
else if (t <= 3.165d+60) then
tmp = x + (y * (z / 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 <= -4.2e-110) {
tmp = x + (t * (y / t));
} else if (t <= 3.165e+60) {
tmp = x + (y * (z / a));
} else {
tmp = x + y;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if t <= -4.2e-110: tmp = x + (t * (y / t)) elif t <= 3.165e+60: tmp = x + (y * (z / a)) else: tmp = x + y return tmp
function code(x, y, z, t, a) tmp = 0.0 if (t <= -4.2e-110) tmp = Float64(x + Float64(t * Float64(y / t))); elseif (t <= 3.165e+60) tmp = Float64(x + Float64(y * Float64(z / a))); else tmp = Float64(x + y); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (t <= -4.2e-110) tmp = x + (t * (y / t)); elseif (t <= 3.165e+60) tmp = x + (y * (z / a)); else tmp = x + y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, -4.2e-110], N[(x + N[(t * N[(y / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 3.165e+60], N[(x + N[(y * N[(z / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + y), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -4.2 \cdot 10^{-110}:\\
\;\;\;\;x + t \cdot \frac{y}{t}\\
\mathbf{elif}\;t \leq 3.165 \cdot 10^{+60}:\\
\;\;\;\;x + y \cdot \frac{z}{a}\\
\mathbf{else}:\\
\;\;\;\;x + y\\
\end{array}
\end{array}
if t < -4.20000000000000004e-110Initial program 77.3%
associate-/l*100.0%
Simplified100.0%
Taylor expanded in z around 0 65.4%
associate-*r/65.4%
mul-1-neg65.4%
distribute-lft-neg-out65.4%
*-commutative65.4%
associate-/l*83.4%
distribute-neg-frac83.4%
distribute-neg-frac283.4%
neg-sub083.4%
associate--r-83.4%
neg-sub083.4%
Simplified83.4%
Taylor expanded in y around 0 65.4%
associate-/l*78.9%
Simplified78.9%
Taylor expanded in t around inf 73.0%
if -4.20000000000000004e-110 < t < 3.165e60Initial program 92.5%
associate-/l*99.1%
Simplified99.1%
Taylor expanded in t around 0 79.9%
associate-/l*85.1%
Simplified85.1%
if 3.165e60 < t Initial program 74.1%
associate-/l*100.0%
Simplified100.0%
Taylor expanded in t around inf 82.2%
Final simplification80.5%
(FPCore (x y z t a) :precision binary64 (if (<= a -1.35e+147) x (if (<= a 8.2e-36) (+ x y) x)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= -1.35e+147) {
tmp = x;
} else if (a <= 8.2e-36) {
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.35d+147)) then
tmp = x
else if (a <= 8.2d-36) 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.35e+147) {
tmp = x;
} else if (a <= 8.2e-36) {
tmp = x + y;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if a <= -1.35e+147: tmp = x elif a <= 8.2e-36: tmp = x + y else: tmp = x return tmp
function code(x, y, z, t, a) tmp = 0.0 if (a <= -1.35e+147) tmp = x; elseif (a <= 8.2e-36) 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.35e+147) tmp = x; elseif (a <= 8.2e-36) tmp = x + y; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[a, -1.35e+147], x, If[LessEqual[a, 8.2e-36], N[(x + y), $MachinePrecision], x]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -1.35 \cdot 10^{+147}:\\
\;\;\;\;x\\
\mathbf{elif}\;a \leq 8.2 \cdot 10^{-36}:\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if a < -1.34999999999999999e147 or 8.20000000000000025e-36 < a Initial program 80.0%
associate-/l*100.0%
Simplified100.0%
Taylor expanded in t around 0 77.4%
Taylor expanded in x around inf 74.0%
if -1.34999999999999999e147 < a < 8.20000000000000025e-36Initial program 85.9%
associate-/l*99.3%
Simplified99.3%
Taylor expanded in t around inf 61.4%
Final simplification66.8%
(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 83.4%
associate-/l*99.6%
Simplified99.6%
Final simplification99.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 83.4%
associate-/l*99.6%
Simplified99.6%
Taylor expanded in t around 0 64.5%
Taylor expanded in x around inf 55.1%
Final simplification55.1%
(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}
herbie shell --seed 2024073
(FPCore (x y z t a)
:name "Graphics.Rendering.Plot.Render.Plot.Axis:renderAxisTicks from plot-0.2.3.4, B"
:precision binary64
:alt
(+ x (/ y (/ (- a t) (- z t))))
(+ x (/ (* y (- z t)) (- a t))))