
(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 13 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 85.2%
associate-/l*98.5%
Simplified98.5%
Final simplification98.5%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (+ x (* z (/ y (- a t))))))
(if (<= t -3.3e+79)
(+ x y)
(if (<= t -2.8e-137)
t_1
(if (<= t -1.6e-215)
(+ x (/ y (/ a (- z t))))
(if (<= t 1.2e+145) t_1 (+ x y)))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = x + (z * (y / (a - t)));
double tmp;
if (t <= -3.3e+79) {
tmp = x + y;
} else if (t <= -2.8e-137) {
tmp = t_1;
} else if (t <= -1.6e-215) {
tmp = x + (y / (a / (z - t)));
} else if (t <= 1.2e+145) {
tmp = t_1;
} 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) :: t_1
real(8) :: tmp
t_1 = x + (z * (y / (a - t)))
if (t <= (-3.3d+79)) then
tmp = x + y
else if (t <= (-2.8d-137)) then
tmp = t_1
else if (t <= (-1.6d-215)) then
tmp = x + (y / (a / (z - t)))
else if (t <= 1.2d+145) then
tmp = t_1
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 t_1 = x + (z * (y / (a - t)));
double tmp;
if (t <= -3.3e+79) {
tmp = x + y;
} else if (t <= -2.8e-137) {
tmp = t_1;
} else if (t <= -1.6e-215) {
tmp = x + (y / (a / (z - t)));
} else if (t <= 1.2e+145) {
tmp = t_1;
} else {
tmp = x + y;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = x + (z * (y / (a - t))) tmp = 0 if t <= -3.3e+79: tmp = x + y elif t <= -2.8e-137: tmp = t_1 elif t <= -1.6e-215: tmp = x + (y / (a / (z - t))) elif t <= 1.2e+145: tmp = t_1 else: tmp = x + y return tmp
function code(x, y, z, t, a) t_1 = Float64(x + Float64(z * Float64(y / Float64(a - t)))) tmp = 0.0 if (t <= -3.3e+79) tmp = Float64(x + y); elseif (t <= -2.8e-137) tmp = t_1; elseif (t <= -1.6e-215) tmp = Float64(x + Float64(y / Float64(a / Float64(z - t)))); elseif (t <= 1.2e+145) tmp = t_1; else tmp = Float64(x + y); end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = x + (z * (y / (a - t))); tmp = 0.0; if (t <= -3.3e+79) tmp = x + y; elseif (t <= -2.8e-137) tmp = t_1; elseif (t <= -1.6e-215) tmp = x + (y / (a / (z - t))); elseif (t <= 1.2e+145) tmp = t_1; else tmp = x + y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(x + N[(z * N[(y / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -3.3e+79], N[(x + y), $MachinePrecision], If[LessEqual[t, -2.8e-137], t$95$1, If[LessEqual[t, -1.6e-215], N[(x + N[(y / N[(a / N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 1.2e+145], t$95$1, N[(x + y), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x + z \cdot \frac{y}{a - t}\\
\mathbf{if}\;t \leq -3.3 \cdot 10^{+79}:\\
\;\;\;\;x + y\\
\mathbf{elif}\;t \leq -2.8 \cdot 10^{-137}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq -1.6 \cdot 10^{-215}:\\
\;\;\;\;x + \frac{y}{\frac{a}{z - t}}\\
\mathbf{elif}\;t \leq 1.2 \cdot 10^{+145}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;x + y\\
\end{array}
\end{array}
if t < -3.3000000000000002e79 or 1.19999999999999996e145 < t Initial program 68.0%
associate-/l*99.9%
Simplified99.9%
Taylor expanded in t around inf 83.0%
+-commutative83.0%
Simplified83.0%
if -3.3000000000000002e79 < t < -2.7999999999999999e-137 or -1.6000000000000001e-215 < t < 1.19999999999999996e145Initial program 91.2%
associate-/l*97.7%
Simplified97.7%
Taylor expanded in z around inf 81.9%
associate-*l/87.3%
*-commutative87.3%
Simplified87.3%
if -2.7999999999999999e-137 < t < -1.6000000000000001e-215Initial program 95.9%
associate-/l*99.8%
Simplified99.8%
Taylor expanded in a around inf 95.9%
+-commutative95.9%
associate-/l*99.8%
Simplified99.8%
Final simplification87.3%
(FPCore (x y z t a)
:precision binary64
(if (<= t -3.5e+45)
(+ x y)
(if (<= t 2.2e-81)
(+ x (/ z (/ a y)))
(if (<= t 6.5e+145) (+ x (/ z (/ (- t) y))) (+ x y)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -3.5e+45) {
tmp = x + y;
} else if (t <= 2.2e-81) {
tmp = x + (z / (a / y));
} else if (t <= 6.5e+145) {
tmp = x + (z / (-t / y));
} 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 <= (-3.5d+45)) then
tmp = x + y
else if (t <= 2.2d-81) then
tmp = x + (z / (a / y))
else if (t <= 6.5d+145) then
tmp = x + (z / (-t / y))
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 <= -3.5e+45) {
tmp = x + y;
} else if (t <= 2.2e-81) {
tmp = x + (z / (a / y));
} else if (t <= 6.5e+145) {
tmp = x + (z / (-t / y));
} else {
tmp = x + y;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if t <= -3.5e+45: tmp = x + y elif t <= 2.2e-81: tmp = x + (z / (a / y)) elif t <= 6.5e+145: tmp = x + (z / (-t / y)) else: tmp = x + y return tmp
function code(x, y, z, t, a) tmp = 0.0 if (t <= -3.5e+45) tmp = Float64(x + y); elseif (t <= 2.2e-81) tmp = Float64(x + Float64(z / Float64(a / y))); elseif (t <= 6.5e+145) tmp = Float64(x + Float64(z / Float64(Float64(-t) / y))); else tmp = Float64(x + y); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (t <= -3.5e+45) tmp = x + y; elseif (t <= 2.2e-81) tmp = x + (z / (a / y)); elseif (t <= 6.5e+145) tmp = x + (z / (-t / y)); else tmp = x + y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, -3.5e+45], N[(x + y), $MachinePrecision], If[LessEqual[t, 2.2e-81], N[(x + N[(z / N[(a / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 6.5e+145], N[(x + N[(z / N[((-t) / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + y), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -3.5 \cdot 10^{+45}:\\
\;\;\;\;x + y\\
\mathbf{elif}\;t \leq 2.2 \cdot 10^{-81}:\\
\;\;\;\;x + \frac{z}{\frac{a}{y}}\\
\mathbf{elif}\;t \leq 6.5 \cdot 10^{+145}:\\
\;\;\;\;x + \frac{z}{\frac{-t}{y}}\\
\mathbf{else}:\\
\;\;\;\;x + y\\
\end{array}
\end{array}
if t < -3.50000000000000023e45 or 6.50000000000000034e145 < t Initial program 68.4%
associate-/l*99.9%
Simplified99.9%
Taylor expanded in t around inf 79.5%
+-commutative79.5%
Simplified79.5%
if -3.50000000000000023e45 < t < 2.1999999999999999e-81Initial program 93.5%
associate-/l*97.2%
Simplified97.2%
Taylor expanded in z around inf 83.2%
associate-*l/87.1%
*-commutative87.1%
Simplified87.1%
associate-*r/83.2%
frac-2neg83.2%
sub-neg83.2%
distribute-neg-in83.2%
add-sqr-sqrt51.3%
sqrt-unprod78.6%
sqr-neg78.6%
sqrt-unprod27.3%
add-sqr-sqrt72.8%
add-sqr-sqrt45.4%
sqrt-unprod75.0%
sqr-neg75.0%
sqrt-unprod31.9%
add-sqr-sqrt83.2%
Applied egg-rr83.2%
distribute-rgt-neg-in83.2%
associate-/l*87.4%
+-commutative87.4%
unsub-neg87.4%
Simplified87.4%
Taylor expanded in t around 0 78.1%
if 2.1999999999999999e-81 < t < 6.50000000000000034e145Initial program 90.0%
associate-/l*99.9%
Simplified99.9%
Taylor expanded in z around inf 80.6%
associate-*l/84.7%
*-commutative84.7%
Simplified84.7%
associate-*r/80.6%
frac-2neg80.6%
sub-neg80.6%
distribute-neg-in80.6%
add-sqr-sqrt0.0%
sqrt-unprod57.1%
sqr-neg57.1%
sqrt-unprod57.1%
add-sqr-sqrt57.1%
add-sqr-sqrt0.0%
sqrt-unprod80.6%
sqr-neg80.6%
sqrt-unprod80.5%
add-sqr-sqrt80.6%
Applied egg-rr80.6%
distribute-rgt-neg-in80.6%
associate-/l*84.7%
+-commutative84.7%
unsub-neg84.7%
Simplified84.7%
Taylor expanded in t around inf 76.6%
associate-*r/76.6%
neg-mul-176.6%
Simplified76.6%
Final simplification78.3%
(FPCore (x y z t a)
:precision binary64
(if (<= t -1.85e+46)
(+ x y)
(if (<= t 4.8e-84)
(+ x (/ z (/ a y)))
(if (<= t 1.35e+145) (- x (* z (/ y t))) (+ x y)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -1.85e+46) {
tmp = x + y;
} else if (t <= 4.8e-84) {
tmp = x + (z / (a / y));
} else if (t <= 1.35e+145) {
tmp = x - (z * (y / 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.85d+46)) then
tmp = x + y
else if (t <= 4.8d-84) then
tmp = x + (z / (a / y))
else if (t <= 1.35d+145) then
tmp = x - (z * (y / 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.85e+46) {
tmp = x + y;
} else if (t <= 4.8e-84) {
tmp = x + (z / (a / y));
} else if (t <= 1.35e+145) {
tmp = x - (z * (y / t));
} else {
tmp = x + y;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if t <= -1.85e+46: tmp = x + y elif t <= 4.8e-84: tmp = x + (z / (a / y)) elif t <= 1.35e+145: tmp = x - (z * (y / t)) else: tmp = x + y return tmp
function code(x, y, z, t, a) tmp = 0.0 if (t <= -1.85e+46) tmp = Float64(x + y); elseif (t <= 4.8e-84) tmp = Float64(x + Float64(z / Float64(a / y))); elseif (t <= 1.35e+145) tmp = Float64(x - Float64(z * Float64(y / 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.85e+46) tmp = x + y; elseif (t <= 4.8e-84) tmp = x + (z / (a / y)); elseif (t <= 1.35e+145) tmp = x - (z * (y / t)); else tmp = x + y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, -1.85e+46], N[(x + y), $MachinePrecision], If[LessEqual[t, 4.8e-84], N[(x + N[(z / N[(a / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 1.35e+145], N[(x - N[(z * N[(y / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + y), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.85 \cdot 10^{+46}:\\
\;\;\;\;x + y\\
\mathbf{elif}\;t \leq 4.8 \cdot 10^{-84}:\\
\;\;\;\;x + \frac{z}{\frac{a}{y}}\\
\mathbf{elif}\;t \leq 1.35 \cdot 10^{+145}:\\
\;\;\;\;x - z \cdot \frac{y}{t}\\
\mathbf{else}:\\
\;\;\;\;x + y\\
\end{array}
\end{array}
if t < -1.84999999999999995e46 or 1.35000000000000011e145 < t Initial program 68.4%
associate-/l*99.9%
Simplified99.9%
Taylor expanded in t around inf 79.5%
+-commutative79.5%
Simplified79.5%
if -1.84999999999999995e46 < t < 4.80000000000000035e-84Initial program 93.5%
associate-/l*97.2%
Simplified97.2%
Taylor expanded in z around inf 83.2%
associate-*l/87.1%
*-commutative87.1%
Simplified87.1%
associate-*r/83.2%
frac-2neg83.2%
sub-neg83.2%
distribute-neg-in83.2%
add-sqr-sqrt51.3%
sqrt-unprod78.6%
sqr-neg78.6%
sqrt-unprod27.3%
add-sqr-sqrt72.8%
add-sqr-sqrt45.4%
sqrt-unprod75.0%
sqr-neg75.0%
sqrt-unprod31.9%
add-sqr-sqrt83.2%
Applied egg-rr83.2%
distribute-rgt-neg-in83.2%
associate-/l*87.4%
+-commutative87.4%
unsub-neg87.4%
Simplified87.4%
Taylor expanded in t around 0 78.1%
if 4.80000000000000035e-84 < t < 1.35000000000000011e145Initial program 90.0%
associate-/l*99.9%
Simplified99.9%
Taylor expanded in z around inf 80.6%
associate-*l/84.7%
*-commutative84.7%
Simplified84.7%
Taylor expanded in a around 0 72.0%
mul-1-neg72.0%
unsub-neg72.0%
associate-/l*76.0%
Simplified76.0%
associate-/r/76.6%
Applied egg-rr76.6%
Final simplification78.2%
(FPCore (x y z t a) :precision binary64 (if (or (<= t -4.8e+79) (not (<= t 1.6e+145))) (+ x y) (+ x (* z (/ y (- a t))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -4.8e+79) || !(t <= 1.6e+145)) {
tmp = x + y;
} 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 <= (-4.8d+79)) .or. (.not. (t <= 1.6d+145))) then
tmp = x + y
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 <= -4.8e+79) || !(t <= 1.6e+145)) {
tmp = x + y;
} else {
tmp = x + (z * (y / (a - t)));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (t <= -4.8e+79) or not (t <= 1.6e+145): tmp = x + y else: tmp = x + (z * (y / (a - t))) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((t <= -4.8e+79) || !(t <= 1.6e+145)) tmp = Float64(x + y); 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 <= -4.8e+79) || ~((t <= 1.6e+145))) tmp = x + y; else tmp = x + (z * (y / (a - t))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[t, -4.8e+79], N[Not[LessEqual[t, 1.6e+145]], $MachinePrecision]], N[(x + y), $MachinePrecision], N[(x + N[(z * N[(y / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -4.8 \cdot 10^{+79} \lor \neg \left(t \leq 1.6 \cdot 10^{+145}\right):\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;x + z \cdot \frac{y}{a - t}\\
\end{array}
\end{array}
if t < -4.79999999999999971e79 or 1.60000000000000004e145 < t Initial program 68.0%
associate-/l*99.9%
Simplified99.9%
Taylor expanded in t around inf 83.0%
+-commutative83.0%
Simplified83.0%
if -4.79999999999999971e79 < t < 1.60000000000000004e145Initial program 91.8%
associate-/l*98.0%
Simplified98.0%
Taylor expanded in z around inf 82.2%
associate-*l/86.5%
*-commutative86.5%
Simplified86.5%
Final simplification85.5%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -1e-78) (not (<= z 6e-44))) (+ x (* z (/ y (- a t)))) (+ x (/ (* y t) (- t a)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -1e-78) || !(z <= 6e-44)) {
tmp = x + (z * (y / (a - t)));
} else {
tmp = x + ((y * t) / (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 ((z <= (-1d-78)) .or. (.not. (z <= 6d-44))) then
tmp = x + (z * (y / (a - t)))
else
tmp = x + ((y * t) / (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 ((z <= -1e-78) || !(z <= 6e-44)) {
tmp = x + (z * (y / (a - t)));
} else {
tmp = x + ((y * t) / (t - a));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -1e-78) or not (z <= 6e-44): tmp = x + (z * (y / (a - t))) else: tmp = x + ((y * t) / (t - a)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -1e-78) || !(z <= 6e-44)) tmp = Float64(x + Float64(z * Float64(y / Float64(a - t)))); else tmp = Float64(x + Float64(Float64(y * t) / Float64(t - a))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((z <= -1e-78) || ~((z <= 6e-44))) tmp = x + (z * (y / (a - t))); else tmp = x + ((y * t) / (t - a)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -1e-78], N[Not[LessEqual[z, 6e-44]], $MachinePrecision]], N[(x + N[(z * N[(y / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(N[(y * t), $MachinePrecision] / N[(t - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1 \cdot 10^{-78} \lor \neg \left(z \leq 6 \cdot 10^{-44}\right):\\
\;\;\;\;x + z \cdot \frac{y}{a - t}\\
\mathbf{else}:\\
\;\;\;\;x + \frac{y \cdot t}{t - a}\\
\end{array}
\end{array}
if z < -9.99999999999999999e-79 or 6.0000000000000005e-44 < z Initial program 82.4%
associate-/l*97.5%
Simplified97.5%
Taylor expanded in z around inf 79.4%
associate-*l/86.5%
*-commutative86.5%
Simplified86.5%
if -9.99999999999999999e-79 < z < 6.0000000000000005e-44Initial program 89.2%
associate-/l*99.9%
Simplified99.9%
Taylor expanded in z around 0 83.4%
+-commutative83.4%
mul-1-neg83.4%
*-commutative83.4%
associate-*l/89.2%
distribute-rgt-neg-out89.2%
Simplified89.2%
associate-*l/83.4%
frac-2neg83.4%
add-sqr-sqrt44.6%
sqrt-unprod57.6%
sqr-neg57.6%
sqrt-unprod26.7%
add-sqr-sqrt58.1%
distribute-rgt-neg-out58.1%
add-sqr-sqrt31.4%
sqrt-unprod57.8%
sqr-neg57.8%
sqrt-unprod38.7%
add-sqr-sqrt83.4%
sub-neg83.4%
distribute-neg-in83.4%
add-sqr-sqrt44.6%
sqrt-unprod71.4%
sqr-neg71.4%
sqrt-unprod30.6%
add-sqr-sqrt68.5%
add-sqr-sqrt37.9%
sqrt-unprod74.1%
sqr-neg74.1%
Applied egg-rr83.4%
*-commutative83.4%
+-commutative83.4%
unsub-neg83.4%
Simplified83.4%
Final simplification85.2%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -6.5e-78) (not (<= z 8.8e+112))) (+ x (* z (/ y (- a t)))) (- x (/ t (/ (- a t) y)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -6.5e-78) || !(z <= 8.8e+112)) {
tmp = x + (z * (y / (a - t)));
} else {
tmp = x - (t / ((a - t) / 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 ((z <= (-6.5d-78)) .or. (.not. (z <= 8.8d+112))) then
tmp = x + (z * (y / (a - t)))
else
tmp = x - (t / ((a - t) / y))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -6.5e-78) || !(z <= 8.8e+112)) {
tmp = x + (z * (y / (a - t)));
} else {
tmp = x - (t / ((a - t) / y));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -6.5e-78) or not (z <= 8.8e+112): tmp = x + (z * (y / (a - t))) else: tmp = x - (t / ((a - t) / y)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -6.5e-78) || !(z <= 8.8e+112)) tmp = Float64(x + Float64(z * Float64(y / Float64(a - t)))); else tmp = Float64(x - Float64(t / Float64(Float64(a - t) / y))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((z <= -6.5e-78) || ~((z <= 8.8e+112))) tmp = x + (z * (y / (a - t))); else tmp = x - (t / ((a - t) / y)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -6.5e-78], N[Not[LessEqual[z, 8.8e+112]], $MachinePrecision]], N[(x + N[(z * N[(y / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x - N[(t / N[(N[(a - t), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -6.5 \cdot 10^{-78} \lor \neg \left(z \leq 8.8 \cdot 10^{+112}\right):\\
\;\;\;\;x + z \cdot \frac{y}{a - t}\\
\mathbf{else}:\\
\;\;\;\;x - \frac{t}{\frac{a - t}{y}}\\
\end{array}
\end{array}
if z < -6.5000000000000003e-78 or 8.7999999999999997e112 < z Initial program 82.6%
associate-/l*97.0%
Simplified97.0%
Taylor expanded in z around inf 80.6%
associate-*l/90.0%
*-commutative90.0%
Simplified90.0%
if -6.5000000000000003e-78 < z < 8.7999999999999997e112Initial program 87.4%
associate-/l*99.9%
Simplified99.9%
clear-num99.8%
associate-/r/99.8%
clear-num99.9%
Applied egg-rr99.9%
Taylor expanded in z around 0 79.6%
mul-1-neg79.6%
unsub-neg79.6%
associate-/l*88.0%
Simplified88.0%
Final simplification88.9%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (/ y (- a t))))
(if (or (<= z -7.2e-78) (not (<= z 1.85e+114)))
(+ x (* z t_1))
(- x (* t t_1)))))
double code(double x, double y, double z, double t, double a) {
double t_1 = y / (a - t);
double tmp;
if ((z <= -7.2e-78) || !(z <= 1.85e+114)) {
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 / (a - t)
if ((z <= (-7.2d-78)) .or. (.not. (z <= 1.85d+114))) 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 / (a - t);
double tmp;
if ((z <= -7.2e-78) || !(z <= 1.85e+114)) {
tmp = x + (z * t_1);
} else {
tmp = x - (t * t_1);
}
return tmp;
}
def code(x, y, z, t, a): t_1 = y / (a - t) tmp = 0 if (z <= -7.2e-78) or not (z <= 1.85e+114): 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(a - t)) tmp = 0.0 if ((z <= -7.2e-78) || !(z <= 1.85e+114)) 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 / (a - t); tmp = 0.0; if ((z <= -7.2e-78) || ~((z <= 1.85e+114))) 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[(a - t), $MachinePrecision]), $MachinePrecision]}, If[Or[LessEqual[z, -7.2e-78], N[Not[LessEqual[z, 1.85e+114]], $MachinePrecision]], 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}{a - t}\\
\mathbf{if}\;z \leq -7.2 \cdot 10^{-78} \lor \neg \left(z \leq 1.85 \cdot 10^{+114}\right):\\
\;\;\;\;x + z \cdot t\_1\\
\mathbf{else}:\\
\;\;\;\;x - t \cdot t\_1\\
\end{array}
\end{array}
if z < -7.2000000000000005e-78 or 1.85e114 < z Initial program 82.6%
associate-/l*97.0%
Simplified97.0%
Taylor expanded in z around inf 80.6%
associate-*l/90.0%
*-commutative90.0%
Simplified90.0%
if -7.2000000000000005e-78 < z < 1.85e114Initial program 87.4%
associate-/l*99.9%
Simplified99.9%
Taylor expanded in z around 0 79.6%
+-commutative79.6%
mul-1-neg79.6%
*-commutative79.6%
associate-*l/88.2%
distribute-rgt-neg-out88.2%
Simplified88.2%
Final simplification89.1%
(FPCore (x y z t a) :precision binary64 (if (or (<= t -3.5e+46) (not (<= t 1.9e+37))) (+ x y) (+ x (* y (/ z a)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -3.5e+46) || !(t <= 1.9e+37)) {
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 <= (-3.5d+46)) .or. (.not. (t <= 1.9d+37))) 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 <= -3.5e+46) || !(t <= 1.9e+37)) {
tmp = x + y;
} else {
tmp = x + (y * (z / a));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (t <= -3.5e+46) or not (t <= 1.9e+37): tmp = x + y else: tmp = x + (y * (z / a)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((t <= -3.5e+46) || !(t <= 1.9e+37)) 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 <= -3.5e+46) || ~((t <= 1.9e+37))) tmp = x + y; else tmp = x + (y * (z / a)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[t, -3.5e+46], N[Not[LessEqual[t, 1.9e+37]], $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 -3.5 \cdot 10^{+46} \lor \neg \left(t \leq 1.9 \cdot 10^{+37}\right):\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot \frac{z}{a}\\
\end{array}
\end{array}
if t < -3.49999999999999985e46 or 1.89999999999999995e37 < t Initial program 70.9%
associate-/l*99.9%
Simplified99.9%
Taylor expanded in t around inf 74.9%
+-commutative74.9%
Simplified74.9%
if -3.49999999999999985e46 < t < 1.89999999999999995e37Initial program 94.5%
associate-/l*97.6%
Simplified97.6%
clear-num97.5%
associate-/r/97.3%
clear-num97.4%
Applied egg-rr97.4%
Taylor expanded in t around 0 74.6%
Final simplification74.7%
(FPCore (x y z t a) :precision binary64 (if (or (<= t -5.8e+43) (not (<= t 1.16e+33))) (+ x y) (+ x (/ z (/ a y)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -5.8e+43) || !(t <= 1.16e+33)) {
tmp = x + y;
} else {
tmp = x + (z / (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.8d+43)) .or. (.not. (t <= 1.16d+33))) then
tmp = x + y
else
tmp = x + (z / (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.8e+43) || !(t <= 1.16e+33)) {
tmp = x + y;
} else {
tmp = x + (z / (a / y));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (t <= -5.8e+43) or not (t <= 1.16e+33): tmp = x + y else: tmp = x + (z / (a / y)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((t <= -5.8e+43) || !(t <= 1.16e+33)) tmp = Float64(x + y); else tmp = Float64(x + Float64(z / Float64(a / y))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((t <= -5.8e+43) || ~((t <= 1.16e+33))) tmp = x + y; else tmp = x + (z / (a / y)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[t, -5.8e+43], N[Not[LessEqual[t, 1.16e+33]], $MachinePrecision]], N[(x + y), $MachinePrecision], N[(x + N[(z / N[(a / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -5.8 \cdot 10^{+43} \lor \neg \left(t \leq 1.16 \cdot 10^{+33}\right):\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;x + \frac{z}{\frac{a}{y}}\\
\end{array}
\end{array}
if t < -5.8000000000000004e43 or 1.16000000000000001e33 < t Initial program 70.9%
associate-/l*99.9%
Simplified99.9%
Taylor expanded in t around inf 74.9%
+-commutative74.9%
Simplified74.9%
if -5.8000000000000004e43 < t < 1.16000000000000001e33Initial program 94.5%
associate-/l*97.6%
Simplified97.6%
Taylor expanded in z around inf 84.0%
associate-*l/87.3%
*-commutative87.3%
Simplified87.3%
associate-*r/84.0%
frac-2neg84.0%
sub-neg84.0%
distribute-neg-in84.0%
add-sqr-sqrt43.0%
sqrt-unprod75.0%
sqr-neg75.0%
sqrt-unprod32.0%
add-sqr-sqrt70.1%
add-sqr-sqrt38.1%
sqrt-unprod77.2%
sqr-neg77.2%
sqrt-unprod40.9%
add-sqr-sqrt84.0%
Applied egg-rr84.0%
distribute-rgt-neg-in84.0%
associate-/l*87.6%
+-commutative87.6%
unsub-neg87.6%
Simplified87.6%
Taylor expanded in t around 0 75.3%
Final simplification75.1%
(FPCore (x y z t a) :precision binary64 (if (<= a -5.7e+131) x (if (<= a 4e+130) (+ x y) x)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= -5.7e+131) {
tmp = x;
} else if (a <= 4e+130) {
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 <= (-5.7d+131)) then
tmp = x
else if (a <= 4d+130) 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 <= -5.7e+131) {
tmp = x;
} else if (a <= 4e+130) {
tmp = x + y;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if a <= -5.7e+131: tmp = x elif a <= 4e+130: tmp = x + y else: tmp = x return tmp
function code(x, y, z, t, a) tmp = 0.0 if (a <= -5.7e+131) tmp = x; elseif (a <= 4e+130) 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 <= -5.7e+131) tmp = x; elseif (a <= 4e+130) tmp = x + y; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[a, -5.7e+131], x, If[LessEqual[a, 4e+130], N[(x + y), $MachinePrecision], x]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -5.7 \cdot 10^{+131}:\\
\;\;\;\;x\\
\mathbf{elif}\;a \leq 4 \cdot 10^{+130}:\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if a < -5.7e131 or 4.0000000000000002e130 < a Initial program 80.4%
associate-/l*99.8%
Simplified99.8%
Taylor expanded in x around inf 66.9%
if -5.7e131 < a < 4.0000000000000002e130Initial program 87.2%
associate-/l*97.9%
Simplified97.9%
Taylor expanded in t around inf 60.1%
+-commutative60.1%
Simplified60.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 85.2%
associate-/l*98.5%
Simplified98.5%
clear-num98.4%
associate-/r/98.3%
clear-num98.4%
Applied egg-rr98.4%
Final simplification98.4%
(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 85.2%
associate-/l*98.5%
Simplified98.5%
Taylor expanded in x around inf 51.1%
Final simplification51.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 2024036
(FPCore (x y z t a)
:name "Graphics.Rendering.Plot.Render.Plot.Axis:renderAxisTicks from plot-0.2.3.4, B"
:precision binary64
:herbie-target
(+ x (/ y (/ (- a t) (- z t))))
(+ x (/ (* y (- z t)) (- a t))))