
(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 11 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 (/ (- 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(y / Float64(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[(y / N[(N[(t - a), $MachinePrecision] / N[(t - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \frac{y}{\frac{t - a}{t - z}}
\end{array}
Initial program 84.4%
associate-/l*97.7%
Simplified97.7%
clear-num97.6%
un-div-inv98.0%
Applied egg-rr98.0%
Final simplification98.0%
(FPCore (x y z t a)
:precision binary64
(if (<= t -1.1e+201)
(+ x y)
(if (<= t -4.2e+119)
(- x (/ y (/ (- t a) z)))
(if (<= t -5.5e+86)
(+ x y)
(if (<= t -1.25e+43)
(- x (* y (/ (- t z) a)))
(if (<= t 5.3e+134) (- x (* z (/ y (- t a)))) (+ x y)))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -1.1e+201) {
tmp = x + y;
} else if (t <= -4.2e+119) {
tmp = x - (y / ((t - a) / z));
} else if (t <= -5.5e+86) {
tmp = x + y;
} else if (t <= -1.25e+43) {
tmp = x - (y * ((t - z) / a));
} else if (t <= 5.3e+134) {
tmp = x - (z * (y / (t - 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 <= (-1.1d+201)) then
tmp = x + y
else if (t <= (-4.2d+119)) then
tmp = x - (y / ((t - a) / z))
else if (t <= (-5.5d+86)) then
tmp = x + y
else if (t <= (-1.25d+43)) then
tmp = x - (y * ((t - z) / a))
else if (t <= 5.3d+134) then
tmp = x - (z * (y / (t - 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 <= -1.1e+201) {
tmp = x + y;
} else if (t <= -4.2e+119) {
tmp = x - (y / ((t - a) / z));
} else if (t <= -5.5e+86) {
tmp = x + y;
} else if (t <= -1.25e+43) {
tmp = x - (y * ((t - z) / a));
} else if (t <= 5.3e+134) {
tmp = x - (z * (y / (t - a)));
} else {
tmp = x + y;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if t <= -1.1e+201: tmp = x + y elif t <= -4.2e+119: tmp = x - (y / ((t - a) / z)) elif t <= -5.5e+86: tmp = x + y elif t <= -1.25e+43: tmp = x - (y * ((t - z) / a)) elif t <= 5.3e+134: tmp = x - (z * (y / (t - a))) else: tmp = x + y return tmp
function code(x, y, z, t, a) tmp = 0.0 if (t <= -1.1e+201) tmp = Float64(x + y); elseif (t <= -4.2e+119) tmp = Float64(x - Float64(y / Float64(Float64(t - a) / z))); elseif (t <= -5.5e+86) tmp = Float64(x + y); elseif (t <= -1.25e+43) tmp = Float64(x - Float64(y * Float64(Float64(t - z) / a))); elseif (t <= 5.3e+134) tmp = Float64(x - Float64(z * Float64(y / Float64(t - a)))); else tmp = Float64(x + y); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (t <= -1.1e+201) tmp = x + y; elseif (t <= -4.2e+119) tmp = x - (y / ((t - a) / z)); elseif (t <= -5.5e+86) tmp = x + y; elseif (t <= -1.25e+43) tmp = x - (y * ((t - z) / a)); elseif (t <= 5.3e+134) tmp = x - (z * (y / (t - a))); else tmp = x + y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, -1.1e+201], N[(x + y), $MachinePrecision], If[LessEqual[t, -4.2e+119], N[(x - N[(y / N[(N[(t - a), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, -5.5e+86], N[(x + y), $MachinePrecision], If[LessEqual[t, -1.25e+43], N[(x - N[(y * N[(N[(t - z), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 5.3e+134], N[(x - N[(z * N[(y / N[(t - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + y), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.1 \cdot 10^{+201}:\\
\;\;\;\;x + y\\
\mathbf{elif}\;t \leq -4.2 \cdot 10^{+119}:\\
\;\;\;\;x - \frac{y}{\frac{t - a}{z}}\\
\mathbf{elif}\;t \leq -5.5 \cdot 10^{+86}:\\
\;\;\;\;x + y\\
\mathbf{elif}\;t \leq -1.25 \cdot 10^{+43}:\\
\;\;\;\;x - y \cdot \frac{t - z}{a}\\
\mathbf{elif}\;t \leq 5.3 \cdot 10^{+134}:\\
\;\;\;\;x - z \cdot \frac{y}{t - a}\\
\mathbf{else}:\\
\;\;\;\;x + y\\
\end{array}
\end{array}
if t < -1.1e201 or -4.19999999999999966e119 < t < -5.5000000000000002e86 or 5.3000000000000002e134 < t Initial program 67.2%
associate-/l*100.0%
Simplified100.0%
Taylor expanded in t around inf 86.6%
+-commutative86.6%
Simplified86.6%
if -1.1e201 < t < -4.19999999999999966e119Initial program 72.8%
associate-/l*99.9%
Simplified99.9%
clear-num99.9%
un-div-inv99.9%
Applied egg-rr99.9%
Taylor expanded in z around inf 73.8%
if -5.5000000000000002e86 < t < -1.2500000000000001e43Initial program 91.7%
associate-/l*99.9%
Simplified99.9%
Taylor expanded in a around inf 67.7%
+-commutative67.7%
associate-/l*75.7%
Simplified75.7%
if -1.2500000000000001e43 < t < 5.3000000000000002e134Initial program 93.6%
associate-/l*96.1%
Simplified96.1%
Taylor expanded in z around inf 86.0%
*-commutative86.0%
associate-/l*90.3%
Applied egg-rr90.3%
Final simplification87.2%
(FPCore (x y z t a)
:precision binary64
(if (<= t -7.8e+179)
(+ x y)
(if (<= t -1.22e+120)
(- x (/ z (/ t y)))
(if (or (<= t -8e+86) (not (<= t 6.2e-127)))
(+ x y)
(+ x (* z (/ y a)))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -7.8e+179) {
tmp = x + y;
} else if (t <= -1.22e+120) {
tmp = x - (z / (t / y));
} else if ((t <= -8e+86) || !(t <= 6.2e-127)) {
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 <= (-7.8d+179)) then
tmp = x + y
else if (t <= (-1.22d+120)) then
tmp = x - (z / (t / y))
else if ((t <= (-8d+86)) .or. (.not. (t <= 6.2d-127))) 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 <= -7.8e+179) {
tmp = x + y;
} else if (t <= -1.22e+120) {
tmp = x - (z / (t / y));
} else if ((t <= -8e+86) || !(t <= 6.2e-127)) {
tmp = x + y;
} else {
tmp = x + (z * (y / a));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if t <= -7.8e+179: tmp = x + y elif t <= -1.22e+120: tmp = x - (z / (t / y)) elif (t <= -8e+86) or not (t <= 6.2e-127): tmp = x + y else: tmp = x + (z * (y / a)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (t <= -7.8e+179) tmp = Float64(x + y); elseif (t <= -1.22e+120) tmp = Float64(x - Float64(z / Float64(t / y))); elseif ((t <= -8e+86) || !(t <= 6.2e-127)) 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 <= -7.8e+179) tmp = x + y; elseif (t <= -1.22e+120) tmp = x - (z / (t / y)); elseif ((t <= -8e+86) || ~((t <= 6.2e-127))) tmp = x + y; else tmp = x + (z * (y / a)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, -7.8e+179], N[(x + y), $MachinePrecision], If[LessEqual[t, -1.22e+120], N[(x - N[(z / N[(t / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[t, -8e+86], N[Not[LessEqual[t, 6.2e-127]], $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 -7.8 \cdot 10^{+179}:\\
\;\;\;\;x + y\\
\mathbf{elif}\;t \leq -1.22 \cdot 10^{+120}:\\
\;\;\;\;x - \frac{z}{\frac{t}{y}}\\
\mathbf{elif}\;t \leq -8 \cdot 10^{+86} \lor \neg \left(t \leq 6.2 \cdot 10^{-127}\right):\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;x + z \cdot \frac{y}{a}\\
\end{array}
\end{array}
if t < -7.79999999999999947e179 or -1.22e120 < t < -8.0000000000000001e86 or 6.2e-127 < t Initial program 74.5%
associate-/l*99.1%
Simplified99.1%
Taylor expanded in t around inf 76.1%
+-commutative76.1%
Simplified76.1%
if -7.79999999999999947e179 < t < -1.22e120Initial program 70.9%
associate-/l*100.0%
Simplified100.0%
Taylor expanded in z around inf 71.1%
*-commutative71.1%
associate-/l*79.6%
Applied egg-rr79.6%
Taylor expanded in a around 0 79.6%
associate-*r/79.6%
neg-mul-179.6%
Simplified79.6%
distribute-frac-neg79.6%
distribute-rgt-neg-out79.6%
div-inv79.6%
add-sqr-sqrt48.6%
sqrt-unprod63.4%
sqr-neg63.4%
sqrt-unprod23.5%
add-sqr-sqrt55.1%
div-inv55.1%
clear-num55.1%
un-div-inv55.1%
add-sqr-sqrt23.5%
sqrt-unprod63.4%
sqr-neg63.4%
sqrt-unprod48.6%
add-sqr-sqrt79.6%
Applied egg-rr79.6%
if -8.0000000000000001e86 < t < 6.2e-127Initial program 95.9%
associate-/l*96.0%
Simplified96.0%
Taylor expanded in t around 0 77.4%
*-commutative77.4%
associate-/l*79.7%
Applied egg-rr79.7%
Final simplification78.0%
(FPCore (x y z t a)
:precision binary64
(if (<= t -7e+179)
(+ x y)
(if (<= t -7.2e+119)
(- x (* y (/ z t)))
(if (or (<= t -6.6e+86) (not (<= t 6.2e-127)))
(+ x y)
(+ x (* z (/ y a)))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -7e+179) {
tmp = x + y;
} else if (t <= -7.2e+119) {
tmp = x - (y * (z / t));
} else if ((t <= -6.6e+86) || !(t <= 6.2e-127)) {
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 <= (-7d+179)) then
tmp = x + y
else if (t <= (-7.2d+119)) then
tmp = x - (y * (z / t))
else if ((t <= (-6.6d+86)) .or. (.not. (t <= 6.2d-127))) 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 <= -7e+179) {
tmp = x + y;
} else if (t <= -7.2e+119) {
tmp = x - (y * (z / t));
} else if ((t <= -6.6e+86) || !(t <= 6.2e-127)) {
tmp = x + y;
} else {
tmp = x + (z * (y / a));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if t <= -7e+179: tmp = x + y elif t <= -7.2e+119: tmp = x - (y * (z / t)) elif (t <= -6.6e+86) or not (t <= 6.2e-127): tmp = x + y else: tmp = x + (z * (y / a)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (t <= -7e+179) tmp = Float64(x + y); elseif (t <= -7.2e+119) tmp = Float64(x - Float64(y * Float64(z / t))); elseif ((t <= -6.6e+86) || !(t <= 6.2e-127)) 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 <= -7e+179) tmp = x + y; elseif (t <= -7.2e+119) tmp = x - (y * (z / t)); elseif ((t <= -6.6e+86) || ~((t <= 6.2e-127))) tmp = x + y; else tmp = x + (z * (y / a)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, -7e+179], N[(x + y), $MachinePrecision], If[LessEqual[t, -7.2e+119], N[(x - N[(y * N[(z / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[t, -6.6e+86], N[Not[LessEqual[t, 6.2e-127]], $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 -7 \cdot 10^{+179}:\\
\;\;\;\;x + y\\
\mathbf{elif}\;t \leq -7.2 \cdot 10^{+119}:\\
\;\;\;\;x - y \cdot \frac{z}{t}\\
\mathbf{elif}\;t \leq -6.6 \cdot 10^{+86} \lor \neg \left(t \leq 6.2 \cdot 10^{-127}\right):\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;x + z \cdot \frac{y}{a}\\
\end{array}
\end{array}
if t < -7.0000000000000003e179 or -7.20000000000000003e119 < t < -6.5999999999999998e86 or 6.2e-127 < t Initial program 74.5%
associate-/l*99.1%
Simplified99.1%
Taylor expanded in t around inf 76.1%
+-commutative76.1%
Simplified76.1%
if -7.0000000000000003e179 < t < -7.20000000000000003e119Initial program 70.9%
associate-/l*100.0%
Simplified100.0%
Taylor expanded in z around inf 71.1%
Taylor expanded in a around 0 71.1%
mul-1-neg71.1%
associate-/l*79.6%
distribute-rgt-neg-in79.6%
distribute-neg-frac279.6%
Simplified79.6%
if -6.5999999999999998e86 < t < 6.2e-127Initial program 95.9%
associate-/l*96.0%
Simplified96.0%
Taylor expanded in t around 0 77.4%
*-commutative77.4%
associate-/l*79.7%
Applied egg-rr79.7%
Final simplification78.0%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (/ y (- t a))) (t_2 (- x (* y (+ (/ z t) -1.0)))))
(if (<= t -7.5e+146)
t_2
(if (<= t -2.35e+55)
(+ x (* t t_1))
(if (<= t 4.2e+135) (- x (* z t_1)) t_2)))))
double code(double x, double y, double z, double t, double a) {
double t_1 = y / (t - a);
double t_2 = x - (y * ((z / t) + -1.0));
double tmp;
if (t <= -7.5e+146) {
tmp = t_2;
} else if (t <= -2.35e+55) {
tmp = x + (t * t_1);
} else if (t <= 4.2e+135) {
tmp = x - (z * t_1);
} else {
tmp = t_2;
}
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 = y / (t - a)
t_2 = x - (y * ((z / t) + (-1.0d0)))
if (t <= (-7.5d+146)) then
tmp = t_2
else if (t <= (-2.35d+55)) then
tmp = x + (t * t_1)
else if (t <= 4.2d+135) then
tmp = x - (z * t_1)
else
tmp = t_2
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 t_2 = x - (y * ((z / t) + -1.0));
double tmp;
if (t <= -7.5e+146) {
tmp = t_2;
} else if (t <= -2.35e+55) {
tmp = x + (t * t_1);
} else if (t <= 4.2e+135) {
tmp = x - (z * t_1);
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = y / (t - a) t_2 = x - (y * ((z / t) + -1.0)) tmp = 0 if t <= -7.5e+146: tmp = t_2 elif t <= -2.35e+55: tmp = x + (t * t_1) elif t <= 4.2e+135: tmp = x - (z * t_1) else: tmp = t_2 return tmp
function code(x, y, z, t, a) t_1 = Float64(y / Float64(t - a)) t_2 = Float64(x - Float64(y * Float64(Float64(z / t) + -1.0))) tmp = 0.0 if (t <= -7.5e+146) tmp = t_2; elseif (t <= -2.35e+55) tmp = Float64(x + Float64(t * t_1)); elseif (t <= 4.2e+135) tmp = Float64(x - Float64(z * t_1)); else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = y / (t - a); t_2 = x - (y * ((z / t) + -1.0)); tmp = 0.0; if (t <= -7.5e+146) tmp = t_2; elseif (t <= -2.35e+55) tmp = x + (t * t_1); elseif (t <= 4.2e+135) tmp = x - (z * t_1); else tmp = t_2; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(y / N[(t - a), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(x - N[(y * N[(N[(z / t), $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -7.5e+146], t$95$2, If[LessEqual[t, -2.35e+55], N[(x + N[(t * t$95$1), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 4.2e+135], N[(x - N[(z * t$95$1), $MachinePrecision]), $MachinePrecision], t$95$2]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{y}{t - a}\\
t_2 := x - y \cdot \left(\frac{z}{t} + -1\right)\\
\mathbf{if}\;t \leq -7.5 \cdot 10^{+146}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;t \leq -2.35 \cdot 10^{+55}:\\
\;\;\;\;x + t \cdot t\_1\\
\mathbf{elif}\;t \leq 4.2 \cdot 10^{+135}:\\
\;\;\;\;x - z \cdot t\_1\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if t < -7.49999999999999983e146 or 4.20000000000000019e135 < t Initial program 64.9%
associate-/l*99.9%
Simplified99.9%
Taylor expanded in a around 0 63.5%
mul-1-neg63.5%
unsub-neg63.5%
associate-/l*93.9%
div-sub93.9%
sub-neg93.9%
*-inverses93.9%
metadata-eval93.9%
Simplified93.9%
if -7.49999999999999983e146 < t < -2.35e55Initial program 90.8%
associate-/l*99.9%
Simplified99.9%
Taylor expanded in z around 0 86.2%
mul-1-neg86.2%
unsub-neg86.2%
associate-/l*95.4%
Simplified95.4%
if -2.35e55 < t < 4.20000000000000019e135Initial program 93.3%
associate-/l*96.3%
Simplified96.3%
Taylor expanded in z around inf 85.3%
*-commutative85.3%
associate-/l*89.4%
Applied egg-rr89.4%
Final simplification91.3%
(FPCore (x y z t a) :precision binary64 (if (or (<= t -1.35e+201) (not (<= t 3.8e+133))) (+ x y) (- x (* z (/ y (- t a))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -1.35e+201) || !(t <= 3.8e+133)) {
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 <= (-1.35d+201)) .or. (.not. (t <= 3.8d+133))) 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 <= -1.35e+201) || !(t <= 3.8e+133)) {
tmp = x + y;
} else {
tmp = x - (z * (y / (t - a)));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (t <= -1.35e+201) or not (t <= 3.8e+133): tmp = x + y else: tmp = x - (z * (y / (t - a))) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((t <= -1.35e+201) || !(t <= 3.8e+133)) 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 <= -1.35e+201) || ~((t <= 3.8e+133))) 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, -1.35e+201], N[Not[LessEqual[t, 3.8e+133]], $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 -1.35 \cdot 10^{+201} \lor \neg \left(t \leq 3.8 \cdot 10^{+133}\right):\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;x - z \cdot \frac{y}{t - a}\\
\end{array}
\end{array}
if t < -1.35e201 or 3.8000000000000002e133 < t Initial program 63.4%
associate-/l*100.0%
Simplified100.0%
Taylor expanded in t around inf 87.6%
+-commutative87.6%
Simplified87.6%
if -1.35e201 < t < 3.8000000000000002e133Initial program 91.1%
associate-/l*96.9%
Simplified96.9%
Taylor expanded in z around inf 79.8%
*-commutative79.8%
associate-/l*84.6%
Applied egg-rr84.6%
Final simplification85.3%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (/ y (- t a))))
(if (or (<= t -2.06e+55) (not (<= t 5.1e+119)))
(+ x (* t t_1))
(- x (* z t_1)))))
double code(double x, double y, double z, double t, double a) {
double t_1 = y / (t - a);
double tmp;
if ((t <= -2.06e+55) || !(t <= 5.1e+119)) {
tmp = x + (t * t_1);
} else {
tmp = x - (z * 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 <= (-2.06d+55)) .or. (.not. (t <= 5.1d+119))) then
tmp = x + (t * t_1)
else
tmp = x - (z * 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 <= -2.06e+55) || !(t <= 5.1e+119)) {
tmp = x + (t * t_1);
} else {
tmp = x - (z * t_1);
}
return tmp;
}
def code(x, y, z, t, a): t_1 = y / (t - a) tmp = 0 if (t <= -2.06e+55) or not (t <= 5.1e+119): tmp = x + (t * t_1) else: tmp = x - (z * t_1) return tmp
function code(x, y, z, t, a) t_1 = Float64(y / Float64(t - a)) tmp = 0.0 if ((t <= -2.06e+55) || !(t <= 5.1e+119)) tmp = Float64(x + Float64(t * t_1)); else tmp = Float64(x - Float64(z * 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 <= -2.06e+55) || ~((t <= 5.1e+119))) tmp = x + (t * t_1); else tmp = x - (z * 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[Or[LessEqual[t, -2.06e+55], N[Not[LessEqual[t, 5.1e+119]], $MachinePrecision]], N[(x + N[(t * t$95$1), $MachinePrecision]), $MachinePrecision], N[(x - N[(z * t$95$1), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{y}{t - a}\\
\mathbf{if}\;t \leq -2.06 \cdot 10^{+55} \lor \neg \left(t \leq 5.1 \cdot 10^{+119}\right):\\
\;\;\;\;x + t \cdot t\_1\\
\mathbf{else}:\\
\;\;\;\;x - z \cdot t\_1\\
\end{array}
\end{array}
if t < -2.06e55 or 5.09999999999999984e119 < t Initial program 71.2%
associate-/l*99.9%
Simplified99.9%
Taylor expanded in z around 0 66.3%
mul-1-neg66.3%
unsub-neg66.3%
associate-/l*85.3%
Simplified85.3%
if -2.06e55 < t < 5.09999999999999984e119Initial program 93.1%
associate-/l*96.2%
Simplified96.2%
Taylor expanded in z around inf 85.6%
*-commutative85.6%
associate-/l*89.8%
Applied egg-rr89.8%
Final simplification88.0%
(FPCore (x y z t a) :precision binary64 (if (or (<= t -6.2e+86) (not (<= t 6.2e-127))) (+ x y) (+ x (* z (/ y a)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -6.2e+86) || !(t <= 6.2e-127)) {
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 <= (-6.2d+86)) .or. (.not. (t <= 6.2d-127))) 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 <= -6.2e+86) || !(t <= 6.2e-127)) {
tmp = x + y;
} else {
tmp = x + (z * (y / a));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (t <= -6.2e+86) or not (t <= 6.2e-127): tmp = x + y else: tmp = x + (z * (y / a)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((t <= -6.2e+86) || !(t <= 6.2e-127)) 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 <= -6.2e+86) || ~((t <= 6.2e-127))) tmp = x + y; else tmp = x + (z * (y / a)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[t, -6.2e+86], N[Not[LessEqual[t, 6.2e-127]], $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 -6.2 \cdot 10^{+86} \lor \neg \left(t \leq 6.2 \cdot 10^{-127}\right):\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;x + z \cdot \frac{y}{a}\\
\end{array}
\end{array}
if t < -6.2000000000000004e86 or 6.2e-127 < t Initial program 74.1%
associate-/l*99.2%
Simplified99.2%
Taylor expanded in t around inf 72.9%
+-commutative72.9%
Simplified72.9%
if -6.2000000000000004e86 < t < 6.2e-127Initial program 95.9%
associate-/l*96.0%
Simplified96.0%
Taylor expanded in t around 0 77.4%
*-commutative77.4%
associate-/l*79.7%
Applied egg-rr79.7%
Final simplification76.1%
(FPCore (x y z t a) :precision binary64 (if (<= a -4.1e+183) x (if (<= a 1.35e+134) (+ x y) x)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= -4.1e+183) {
tmp = x;
} else if (a <= 1.35e+134) {
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 <= (-4.1d+183)) then
tmp = x
else if (a <= 1.35d+134) 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 <= -4.1e+183) {
tmp = x;
} else if (a <= 1.35e+134) {
tmp = x + y;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if a <= -4.1e+183: tmp = x elif a <= 1.35e+134: tmp = x + y else: tmp = x return tmp
function code(x, y, z, t, a) tmp = 0.0 if (a <= -4.1e+183) tmp = x; elseif (a <= 1.35e+134) 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 <= -4.1e+183) tmp = x; elseif (a <= 1.35e+134) tmp = x + y; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[a, -4.1e+183], x, If[LessEqual[a, 1.35e+134], N[(x + y), $MachinePrecision], x]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -4.1 \cdot 10^{+183}:\\
\;\;\;\;x\\
\mathbf{elif}\;a \leq 1.35 \cdot 10^{+134}:\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if a < -4.10000000000000015e183 or 1.35e134 < a Initial program 82.0%
associate-/l*99.9%
Simplified99.9%
Taylor expanded in x around inf 70.1%
if -4.10000000000000015e183 < a < 1.35e134Initial program 85.4%
associate-/l*96.8%
Simplified96.8%
Taylor expanded in t around inf 63.4%
+-commutative63.4%
Simplified63.4%
Final simplification65.4%
(FPCore (x y z t a) :precision binary64 (- x (* y (/ (- t z) (- a t)))))
double code(double x, double y, double z, double t, double a) {
return x - (y * ((t - z) / (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 * ((t - z) / (a - t)))
end function
public static double code(double x, double y, double z, double t, double a) {
return x - (y * ((t - z) / (a - t)));
}
def code(x, y, z, t, a): return x - (y * ((t - z) / (a - t)))
function code(x, y, z, t, a) return Float64(x - Float64(y * Float64(Float64(t - z) / Float64(a - t)))) end
function tmp = code(x, y, z, t, a) tmp = x - (y * ((t - z) / (a - t))); end
code[x_, y_, z_, t_, a_] := N[(x - N[(y * N[(N[(t - z), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x - y \cdot \frac{t - z}{a - t}
\end{array}
Initial program 84.4%
associate-/l*97.7%
Simplified97.7%
Final simplification97.7%
(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 84.4%
associate-/l*97.7%
Simplified97.7%
Taylor expanded in x around inf 49.4%
Final simplification49.4%
(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 2024079
(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))))