
(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 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(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 (/ (- 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.8%
Final simplification98.8%
(FPCore (x y z t a) :precision binary64 (if (or (<= t -6.5e+119) (not (<= t 8.2e+78))) (+ x y) (+ x (* y (/ z (- a t))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -6.5e+119) || !(t <= 8.2e+78)) {
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 <= (-6.5d+119)) .or. (.not. (t <= 8.2d+78))) 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 <= -6.5e+119) || !(t <= 8.2e+78)) {
tmp = x + y;
} else {
tmp = x + (y * (z / (a - t)));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (t <= -6.5e+119) or not (t <= 8.2e+78): tmp = x + y else: tmp = x + (y * (z / (a - t))) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((t <= -6.5e+119) || !(t <= 8.2e+78)) 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 <= -6.5e+119) || ~((t <= 8.2e+78))) 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, -6.5e+119], N[Not[LessEqual[t, 8.2e+78]], $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 -6.5 \cdot 10^{+119} \lor \neg \left(t \leq 8.2 \cdot 10^{+78}\right):\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot \frac{z}{a - t}\\
\end{array}
\end{array}
if t < -6.4999999999999997e119 or 8.1999999999999994e78 < t Initial program 99.9%
Taylor expanded in t around inf 87.7%
if -6.4999999999999997e119 < t < 8.1999999999999994e78Initial program 98.0%
Taylor expanded in z around inf 88.5%
Final simplification88.1%
(FPCore (x y z t a) :precision binary64 (if (<= t -1.2e+122) (+ x y) (if (<= t 3.1e+115) (+ x (* z (/ y (- a t)))) (+ x y))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -1.2e+122) {
tmp = x + y;
} else if (t <= 3.1e+115) {
tmp = x + (z * (y / (a - t)));
} 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.2d+122)) then
tmp = x + y
else if (t <= 3.1d+115) then
tmp = x + (z * (y / (a - t)))
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.2e+122) {
tmp = x + y;
} else if (t <= 3.1e+115) {
tmp = x + (z * (y / (a - t)));
} else {
tmp = x + y;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if t <= -1.2e+122: tmp = x + y elif t <= 3.1e+115: tmp = x + (z * (y / (a - t))) else: tmp = x + y return tmp
function code(x, y, z, t, a) tmp = 0.0 if (t <= -1.2e+122) tmp = Float64(x + y); elseif (t <= 3.1e+115) tmp = Float64(x + Float64(z * Float64(y / Float64(a - t)))); else tmp = Float64(x + y); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (t <= -1.2e+122) tmp = x + y; elseif (t <= 3.1e+115) tmp = x + (z * (y / (a - t))); else tmp = x + y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, -1.2e+122], N[(x + y), $MachinePrecision], If[LessEqual[t, 3.1e+115], N[(x + N[(z * N[(y / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + y), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.2 \cdot 10^{+122}:\\
\;\;\;\;x + y\\
\mathbf{elif}\;t \leq 3.1 \cdot 10^{+115}:\\
\;\;\;\;x + z \cdot \frac{y}{a - t}\\
\mathbf{else}:\\
\;\;\;\;x + y\\
\end{array}
\end{array}
if t < -1.2000000000000001e122 or 3.10000000000000005e115 < t Initial program 99.9%
Taylor expanded in t around inf 88.4%
if -1.2000000000000001e122 < t < 3.10000000000000005e115Initial program 98.1%
Taylor expanded in x around 0 92.9%
*-commutative92.9%
associate-/l*96.9%
Simplified96.9%
Taylor expanded in z around inf 83.4%
*-commutative83.4%
associate-*r/88.2%
Simplified88.2%
Final simplification88.3%
(FPCore (x y z t a) :precision binary64 (if (<= t -3.2e+123) (+ x y) (if (<= t 1.65e+14) (+ x (* z (/ y (- a t)))) (+ x (/ t (/ (- t a) y))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -3.2e+123) {
tmp = x + y;
} else if (t <= 1.65e+14) {
tmp = x + (z * (y / (a - t)));
} else {
tmp = x + (t / ((t - a) / y));
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (t <= (-3.2d+123)) then
tmp = x + y
else if (t <= 1.65d+14) then
tmp = x + (z * (y / (a - t)))
else
tmp = x + (t / ((t - a) / 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 <= -3.2e+123) {
tmp = x + y;
} else if (t <= 1.65e+14) {
tmp = x + (z * (y / (a - t)));
} else {
tmp = x + (t / ((t - a) / y));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if t <= -3.2e+123: tmp = x + y elif t <= 1.65e+14: tmp = x + (z * (y / (a - t))) else: tmp = x + (t / ((t - a) / y)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (t <= -3.2e+123) tmp = Float64(x + y); elseif (t <= 1.65e+14) tmp = Float64(x + Float64(z * Float64(y / Float64(a - t)))); else tmp = Float64(x + Float64(t / Float64(Float64(t - a) / y))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (t <= -3.2e+123) tmp = x + y; elseif (t <= 1.65e+14) tmp = x + (z * (y / (a - t))); else tmp = x + (t / ((t - a) / y)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, -3.2e+123], N[(x + y), $MachinePrecision], If[LessEqual[t, 1.65e+14], N[(x + N[(z * N[(y / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(t / N[(N[(t - a), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -3.2 \cdot 10^{+123}:\\
\;\;\;\;x + y\\
\mathbf{elif}\;t \leq 1.65 \cdot 10^{+14}:\\
\;\;\;\;x + z \cdot \frac{y}{a - t}\\
\mathbf{else}:\\
\;\;\;\;x + \frac{t}{\frac{t - a}{y}}\\
\end{array}
\end{array}
if t < -3.20000000000000005e123Initial program 99.9%
Taylor expanded in t around inf 87.0%
if -3.20000000000000005e123 < t < 1.65e14Initial program 97.8%
Taylor expanded in x around 0 93.2%
*-commutative93.2%
associate-/l*96.4%
Simplified96.4%
Taylor expanded in z around inf 84.7%
*-commutative84.7%
associate-*r/89.6%
Simplified89.6%
if 1.65e14 < t Initial program 99.9%
Taylor expanded in x around 0 57.8%
*-commutative57.8%
associate-/l*97.2%
Simplified97.2%
Taylor expanded in z around 0 54.8%
mul-1-neg54.8%
*-commutative54.8%
associate-*r/91.1%
distribute-lft-neg-in91.1%
Simplified91.1%
associate-*r/54.8%
frac-2neg54.8%
add-sqr-sqrt0.0%
sqrt-unprod23.8%
sqr-neg23.8%
sqrt-unprod36.3%
add-sqr-sqrt36.3%
distribute-lft-neg-out36.3%
add-sqr-sqrt0.0%
sqrt-unprod35.6%
sqr-neg35.6%
sqrt-unprod54.7%
add-sqr-sqrt54.8%
sub-neg54.8%
distribute-neg-in54.8%
add-sqr-sqrt0.0%
sqrt-unprod38.4%
sqr-neg38.4%
sqrt-unprod38.7%
add-sqr-sqrt38.7%
add-sqr-sqrt0.0%
sqrt-unprod45.4%
sqr-neg45.4%
sqrt-unprod54.7%
add-sqr-sqrt54.8%
Applied egg-rr54.8%
associate-/l*90.1%
+-commutative90.1%
unsub-neg90.1%
Simplified90.1%
Final simplification89.3%
(FPCore (x y z t a)
:precision binary64
(if (<= t -3.6e+59)
(+ x (* (/ y t) (- t z)))
(if (<= t 95000000000000.0)
(+ x (* z (/ y (- a t))))
(+ x (/ t (/ (- t a) y))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -3.6e+59) {
tmp = x + ((y / t) * (t - z));
} else if (t <= 95000000000000.0) {
tmp = x + (z * (y / (a - t)));
} else {
tmp = x + (t / ((t - a) / y));
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (t <= (-3.6d+59)) then
tmp = x + ((y / t) * (t - z))
else if (t <= 95000000000000.0d0) then
tmp = x + (z * (y / (a - t)))
else
tmp = x + (t / ((t - a) / 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 <= -3.6e+59) {
tmp = x + ((y / t) * (t - z));
} else if (t <= 95000000000000.0) {
tmp = x + (z * (y / (a - t)));
} else {
tmp = x + (t / ((t - a) / y));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if t <= -3.6e+59: tmp = x + ((y / t) * (t - z)) elif t <= 95000000000000.0: tmp = x + (z * (y / (a - t))) else: tmp = x + (t / ((t - a) / y)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (t <= -3.6e+59) tmp = Float64(x + Float64(Float64(y / t) * Float64(t - z))); elseif (t <= 95000000000000.0) tmp = Float64(x + Float64(z * Float64(y / Float64(a - t)))); else tmp = Float64(x + Float64(t / Float64(Float64(t - a) / y))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (t <= -3.6e+59) tmp = x + ((y / t) * (t - z)); elseif (t <= 95000000000000.0) tmp = x + (z * (y / (a - t))); else tmp = x + (t / ((t - a) / y)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, -3.6e+59], N[(x + N[(N[(y / t), $MachinePrecision] * N[(t - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 95000000000000.0], N[(x + N[(z * N[(y / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(t / N[(N[(t - a), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -3.6 \cdot 10^{+59}:\\
\;\;\;\;x + \frac{y}{t} \cdot \left(t - z\right)\\
\mathbf{elif}\;t \leq 95000000000000:\\
\;\;\;\;x + z \cdot \frac{y}{a - t}\\
\mathbf{else}:\\
\;\;\;\;x + \frac{t}{\frac{t - a}{y}}\\
\end{array}
\end{array}
if t < -3.5999999999999999e59Initial program 99.9%
Taylor expanded in a around 0 68.9%
+-commutative68.9%
mul-1-neg68.9%
unsub-neg68.9%
*-commutative68.9%
associate-/l*93.2%
associate-/r/86.5%
Simplified86.5%
if -3.5999999999999999e59 < t < 9.5e13Initial program 97.6%
Taylor expanded in x around 0 93.4%
*-commutative93.4%
associate-/l*96.1%
Simplified96.1%
Taylor expanded in z around inf 86.3%
*-commutative86.3%
associate-*r/90.8%
Simplified90.8%
if 9.5e13 < t Initial program 99.9%
Taylor expanded in x around 0 57.8%
*-commutative57.8%
associate-/l*97.2%
Simplified97.2%
Taylor expanded in z around 0 54.8%
mul-1-neg54.8%
*-commutative54.8%
associate-*r/91.1%
distribute-lft-neg-in91.1%
Simplified91.1%
associate-*r/54.8%
frac-2neg54.8%
add-sqr-sqrt0.0%
sqrt-unprod23.8%
sqr-neg23.8%
sqrt-unprod36.3%
add-sqr-sqrt36.3%
distribute-lft-neg-out36.3%
add-sqr-sqrt0.0%
sqrt-unprod35.6%
sqr-neg35.6%
sqrt-unprod54.7%
add-sqr-sqrt54.8%
sub-neg54.8%
distribute-neg-in54.8%
add-sqr-sqrt0.0%
sqrt-unprod38.4%
sqr-neg38.4%
sqrt-unprod38.7%
add-sqr-sqrt38.7%
add-sqr-sqrt0.0%
sqrt-unprod45.4%
sqr-neg45.4%
sqrt-unprod54.7%
add-sqr-sqrt54.8%
Applied egg-rr54.8%
associate-/l*90.1%
+-commutative90.1%
unsub-neg90.1%
Simplified90.1%
Final simplification89.6%
(FPCore (x y z t a) :precision binary64 (if (<= t -5.5e+59) (+ x (- y (/ y (/ t z)))) (if (<= t 7e+14) (+ x (* z (/ y (- a t)))) (+ x (/ t (/ (- t a) y))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -5.5e+59) {
tmp = x + (y - (y / (t / z)));
} else if (t <= 7e+14) {
tmp = x + (z * (y / (a - t)));
} else {
tmp = x + (t / ((t - a) / y));
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (t <= (-5.5d+59)) then
tmp = x + (y - (y / (t / z)))
else if (t <= 7d+14) then
tmp = x + (z * (y / (a - t)))
else
tmp = x + (t / ((t - a) / 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 <= -5.5e+59) {
tmp = x + (y - (y / (t / z)));
} else if (t <= 7e+14) {
tmp = x + (z * (y / (a - t)));
} else {
tmp = x + (t / ((t - a) / y));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if t <= -5.5e+59: tmp = x + (y - (y / (t / z))) elif t <= 7e+14: tmp = x + (z * (y / (a - t))) else: tmp = x + (t / ((t - a) / y)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (t <= -5.5e+59) tmp = Float64(x + Float64(y - Float64(y / Float64(t / z)))); elseif (t <= 7e+14) tmp = Float64(x + Float64(z * Float64(y / Float64(a - t)))); else tmp = Float64(x + Float64(t / Float64(Float64(t - a) / y))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (t <= -5.5e+59) tmp = x + (y - (y / (t / z))); elseif (t <= 7e+14) tmp = x + (z * (y / (a - t))); else tmp = x + (t / ((t - a) / y)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, -5.5e+59], N[(x + N[(y - N[(y / N[(t / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 7e+14], N[(x + N[(z * N[(y / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(t / N[(N[(t - a), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -5.5 \cdot 10^{+59}:\\
\;\;\;\;x + \left(y - \frac{y}{\frac{t}{z}}\right)\\
\mathbf{elif}\;t \leq 7 \cdot 10^{+14}:\\
\;\;\;\;x + z \cdot \frac{y}{a - t}\\
\mathbf{else}:\\
\;\;\;\;x + \frac{t}{\frac{t - a}{y}}\\
\end{array}
\end{array}
if t < -5.4999999999999999e59Initial program 99.9%
Taylor expanded in x around 0 71.2%
*-commutative71.2%
associate-/l*93.2%
Simplified93.2%
Taylor expanded in a around 0 68.9%
+-commutative68.9%
mul-1-neg68.9%
*-commutative68.9%
unsub-neg68.9%
*-commutative68.9%
associate-/l*93.2%
Simplified93.2%
Taylor expanded in t around 0 80.7%
neg-mul-180.7%
unsub-neg80.7%
associate-/l*93.2%
Simplified93.2%
if -5.4999999999999999e59 < t < 7e14Initial program 97.6%
Taylor expanded in x around 0 93.4%
*-commutative93.4%
associate-/l*96.1%
Simplified96.1%
Taylor expanded in z around inf 86.3%
*-commutative86.3%
associate-*r/90.8%
Simplified90.8%
if 7e14 < t Initial program 99.9%
Taylor expanded in x around 0 57.8%
*-commutative57.8%
associate-/l*97.2%
Simplified97.2%
Taylor expanded in z around 0 54.8%
mul-1-neg54.8%
*-commutative54.8%
associate-*r/91.1%
distribute-lft-neg-in91.1%
Simplified91.1%
associate-*r/54.8%
frac-2neg54.8%
add-sqr-sqrt0.0%
sqrt-unprod23.8%
sqr-neg23.8%
sqrt-unprod36.3%
add-sqr-sqrt36.3%
distribute-lft-neg-out36.3%
add-sqr-sqrt0.0%
sqrt-unprod35.6%
sqr-neg35.6%
sqrt-unprod54.7%
add-sqr-sqrt54.8%
sub-neg54.8%
distribute-neg-in54.8%
add-sqr-sqrt0.0%
sqrt-unprod38.4%
sqr-neg38.4%
sqrt-unprod38.7%
add-sqr-sqrt38.7%
add-sqr-sqrt0.0%
sqrt-unprod45.4%
sqr-neg45.4%
sqrt-unprod54.7%
add-sqr-sqrt54.8%
Applied egg-rr54.8%
associate-/l*90.1%
+-commutative90.1%
unsub-neg90.1%
Simplified90.1%
Final simplification91.1%
(FPCore (x y z t a)
:precision binary64
(if (<= t -4.8e+59)
(+ x (- y (/ y (/ t z))))
(if (<= t 6400000000.0)
(+ x (* z (/ y (- a t))))
(- x (/ y (+ (/ a t) -1.0))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -4.8e+59) {
tmp = x + (y - (y / (t / z)));
} else if (t <= 6400000000.0) {
tmp = x + (z * (y / (a - t)));
} else {
tmp = x - (y / ((a / t) + -1.0));
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (t <= (-4.8d+59)) then
tmp = x + (y - (y / (t / z)))
else if (t <= 6400000000.0d0) then
tmp = x + (z * (y / (a - t)))
else
tmp = x - (y / ((a / t) + (-1.0d0)))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -4.8e+59) {
tmp = x + (y - (y / (t / z)));
} else if (t <= 6400000000.0) {
tmp = x + (z * (y / (a - t)));
} else {
tmp = x - (y / ((a / t) + -1.0));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if t <= -4.8e+59: tmp = x + (y - (y / (t / z))) elif t <= 6400000000.0: tmp = x + (z * (y / (a - t))) else: tmp = x - (y / ((a / t) + -1.0)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (t <= -4.8e+59) tmp = Float64(x + Float64(y - Float64(y / Float64(t / z)))); elseif (t <= 6400000000.0) tmp = Float64(x + Float64(z * Float64(y / Float64(a - t)))); else tmp = Float64(x - Float64(y / Float64(Float64(a / t) + -1.0))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (t <= -4.8e+59) tmp = x + (y - (y / (t / z))); elseif (t <= 6400000000.0) tmp = x + (z * (y / (a - t))); else tmp = x - (y / ((a / t) + -1.0)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, -4.8e+59], N[(x + N[(y - N[(y / N[(t / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 6400000000.0], N[(x + N[(z * N[(y / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x - N[(y / N[(N[(a / t), $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -4.8 \cdot 10^{+59}:\\
\;\;\;\;x + \left(y - \frac{y}{\frac{t}{z}}\right)\\
\mathbf{elif}\;t \leq 6400000000:\\
\;\;\;\;x + z \cdot \frac{y}{a - t}\\
\mathbf{else}:\\
\;\;\;\;x - \frac{y}{\frac{a}{t} + -1}\\
\end{array}
\end{array}
if t < -4.8000000000000004e59Initial program 99.9%
Taylor expanded in x around 0 71.2%
*-commutative71.2%
associate-/l*93.2%
Simplified93.2%
Taylor expanded in a around 0 68.9%
+-commutative68.9%
mul-1-neg68.9%
*-commutative68.9%
unsub-neg68.9%
*-commutative68.9%
associate-/l*93.2%
Simplified93.2%
Taylor expanded in t around 0 80.7%
neg-mul-180.7%
unsub-neg80.7%
associate-/l*93.2%
Simplified93.2%
if -4.8000000000000004e59 < t < 6.4e9Initial program 97.6%
Taylor expanded in x around 0 93.4%
*-commutative93.4%
associate-/l*96.1%
Simplified96.1%
Taylor expanded in z around inf 86.3%
*-commutative86.3%
associate-*r/90.8%
Simplified90.8%
if 6.4e9 < t Initial program 99.9%
Taylor expanded in z around 0 54.8%
+-commutative54.8%
mul-1-neg54.8%
unsub-neg54.8%
associate-/l*92.9%
div-sub92.9%
*-inverses92.9%
Simplified92.9%
Final simplification91.9%
(FPCore (x y z t a) :precision binary64 (if (<= t -1.5e+14) (+ x y) (if (<= t 1.65e-16) (+ x (* y (/ z a))) (+ x y))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -1.5e+14) {
tmp = x + y;
} else if (t <= 1.65e-16) {
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 <= (-1.5d+14)) then
tmp = x + y
else if (t <= 1.65d-16) 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 <= -1.5e+14) {
tmp = x + y;
} else if (t <= 1.65e-16) {
tmp = x + (y * (z / a));
} else {
tmp = x + y;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if t <= -1.5e+14: tmp = x + y elif t <= 1.65e-16: tmp = x + (y * (z / a)) else: tmp = x + y return tmp
function code(x, y, z, t, a) tmp = 0.0 if (t <= -1.5e+14) tmp = Float64(x + y); elseif (t <= 1.65e-16) 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 <= -1.5e+14) tmp = x + y; elseif (t <= 1.65e-16) tmp = x + (y * (z / a)); else tmp = x + y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, -1.5e+14], N[(x + y), $MachinePrecision], If[LessEqual[t, 1.65e-16], N[(x + N[(y * N[(z / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + y), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.5 \cdot 10^{+14}:\\
\;\;\;\;x + y\\
\mathbf{elif}\;t \leq 1.65 \cdot 10^{-16}:\\
\;\;\;\;x + y \cdot \frac{z}{a}\\
\mathbf{else}:\\
\;\;\;\;x + y\\
\end{array}
\end{array}
if t < -1.5e14 or 1.64999999999999994e-16 < t Initial program 99.9%
Taylor expanded in t around inf 80.4%
if -1.5e14 < t < 1.64999999999999994e-16Initial program 97.4%
Taylor expanded in t around 0 83.6%
Final simplification81.8%
(FPCore (x y z t a) :precision binary64 (if (<= t -20000000000000.0) (+ x y) (if (<= t 2.4e-17) (+ x (* z (/ y a))) (+ x y))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -20000000000000.0) {
tmp = x + y;
} else if (t <= 2.4e-17) {
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 <= (-20000000000000.0d0)) then
tmp = x + y
else if (t <= 2.4d-17) 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 <= -20000000000000.0) {
tmp = x + y;
} else if (t <= 2.4e-17) {
tmp = x + (z * (y / a));
} else {
tmp = x + y;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if t <= -20000000000000.0: tmp = x + y elif t <= 2.4e-17: tmp = x + (z * (y / a)) else: tmp = x + y return tmp
function code(x, y, z, t, a) tmp = 0.0 if (t <= -20000000000000.0) tmp = Float64(x + y); elseif (t <= 2.4e-17) 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 <= -20000000000000.0) tmp = x + y; elseif (t <= 2.4e-17) tmp = x + (z * (y / a)); else tmp = x + y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, -20000000000000.0], N[(x + y), $MachinePrecision], If[LessEqual[t, 2.4e-17], N[(x + N[(z * N[(y / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + y), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -20000000000000:\\
\;\;\;\;x + y\\
\mathbf{elif}\;t \leq 2.4 \cdot 10^{-17}:\\
\;\;\;\;x + z \cdot \frac{y}{a}\\
\mathbf{else}:\\
\;\;\;\;x + y\\
\end{array}
\end{array}
if t < -2e13 or 2.39999999999999986e-17 < t Initial program 99.9%
Taylor expanded in t around inf 80.4%
if -2e13 < t < 2.39999999999999986e-17Initial program 97.4%
Taylor expanded in t around 0 79.4%
associate-/l*83.6%
associate-/r/83.7%
Simplified83.7%
Final simplification81.9%
(FPCore (x y z t a) :precision binary64 (if (<= t -2.9e-163) (+ x y) (if (<= t 2.4e-18) x (+ x y))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -2.9e-163) {
tmp = x + y;
} else if (t <= 2.4e-18) {
tmp = x;
} 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 <= (-2.9d-163)) then
tmp = x + y
else if (t <= 2.4d-18) then
tmp = x
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 <= -2.9e-163) {
tmp = x + y;
} else if (t <= 2.4e-18) {
tmp = x;
} else {
tmp = x + y;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if t <= -2.9e-163: tmp = x + y elif t <= 2.4e-18: tmp = x else: tmp = x + y return tmp
function code(x, y, z, t, a) tmp = 0.0 if (t <= -2.9e-163) tmp = Float64(x + y); elseif (t <= 2.4e-18) tmp = x; else tmp = Float64(x + y); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (t <= -2.9e-163) tmp = x + y; elseif (t <= 2.4e-18) tmp = x; else tmp = x + y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, -2.9e-163], N[(x + y), $MachinePrecision], If[LessEqual[t, 2.4e-18], x, N[(x + y), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -2.9 \cdot 10^{-163}:\\
\;\;\;\;x + y\\
\mathbf{elif}\;t \leq 2.4 \cdot 10^{-18}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;x + y\\
\end{array}
\end{array}
if t < -2.9000000000000001e-163 or 2.39999999999999994e-18 < t Initial program 99.9%
Taylor expanded in t around inf 76.1%
if -2.9000000000000001e-163 < t < 2.39999999999999994e-18Initial program 96.6%
Taylor expanded in x around inf 56.6%
Final simplification69.5%
(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.8%
Taylor expanded in x around inf 49.5%
Final simplification49.5%
(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 2023268
(FPCore (x y z t a)
:name "Graphics.Rendering.Plot.Render.Plot.Axis:renderAxisLine from plot-0.2.3.4, B"
:precision binary64
:herbie-target
(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)))))