
(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 12 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t a) :precision binary64 (+ x (/ (* y (- z t)) (- a t))))
double code(double x, double y, double z, double t, double a) {
return x + ((y * (z - t)) / (a - t));
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
code = x + ((y * (z - t)) / (a - t))
end function
public static double code(double x, double y, double z, double t, double a) {
return x + ((y * (z - t)) / (a - t));
}
def code(x, y, z, t, a): return x + ((y * (z - t)) / (a - t))
function code(x, y, z, t, a) return Float64(x + Float64(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 90.3%
associate-/l*98.6%
Simplified98.6%
Final simplification98.6%
(FPCore (x y z t a) :precision binary64 (if (or (<= t -5e+73) (not (<= t 2.4e+15))) (+ x y) (+ x (* z (/ y (- a t))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -5e+73) || !(t <= 2.4e+15)) {
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 <= (-5d+73)) .or. (.not. (t <= 2.4d+15))) 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 <= -5e+73) || !(t <= 2.4e+15)) {
tmp = x + y;
} else {
tmp = x + (z * (y / (a - t)));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (t <= -5e+73) or not (t <= 2.4e+15): tmp = x + y else: tmp = x + (z * (y / (a - t))) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((t <= -5e+73) || !(t <= 2.4e+15)) 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 <= -5e+73) || ~((t <= 2.4e+15))) 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, -5e+73], N[Not[LessEqual[t, 2.4e+15]], $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 -5 \cdot 10^{+73} \lor \neg \left(t \leq 2.4 \cdot 10^{+15}\right):\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;x + z \cdot \frac{y}{a - t}\\
\end{array}
\end{array}
if t < -4.99999999999999976e73 or 2.4e15 < t Initial program 80.3%
associate-*l/93.9%
Simplified93.9%
Taylor expanded in t around inf 80.0%
+-commutative80.0%
Simplified80.0%
if -4.99999999999999976e73 < t < 2.4e15Initial program 97.9%
associate-*l/96.0%
Simplified96.0%
Taylor expanded in z around inf 88.0%
associate-*l/87.4%
*-commutative87.4%
Simplified87.4%
Final simplification84.2%
(FPCore (x y z t a) :precision binary64 (if (or (<= t -2e+34) (not (<= t 5.6e-85))) (+ x (/ y (- 1.0 (/ a t)))) (+ x (* z (/ y (- a t))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -2e+34) || !(t <= 5.6e-85)) {
tmp = x + (y / (1.0 - (a / t)));
} else {
tmp = x + (z * (y / (a - t)));
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if ((t <= (-2d+34)) .or. (.not. (t <= 5.6d-85))) then
tmp = x + (y / (1.0d0 - (a / t)))
else
tmp = x + (z * (y / (a - t)))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -2e+34) || !(t <= 5.6e-85)) {
tmp = x + (y / (1.0 - (a / t)));
} else {
tmp = x + (z * (y / (a - t)));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (t <= -2e+34) or not (t <= 5.6e-85): tmp = x + (y / (1.0 - (a / t))) else: tmp = x + (z * (y / (a - t))) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((t <= -2e+34) || !(t <= 5.6e-85)) tmp = Float64(x + Float64(y / Float64(1.0 - Float64(a / t)))); else tmp = Float64(x + Float64(z * Float64(y / Float64(a - t)))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((t <= -2e+34) || ~((t <= 5.6e-85))) tmp = x + (y / (1.0 - (a / t))); else tmp = x + (z * (y / (a - t))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[t, -2e+34], N[Not[LessEqual[t, 5.6e-85]], $MachinePrecision]], N[(x + N[(y / N[(1.0 - N[(a / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(z * N[(y / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -2 \cdot 10^{+34} \lor \neg \left(t \leq 5.6 \cdot 10^{-85}\right):\\
\;\;\;\;x + \frac{y}{1 - \frac{a}{t}}\\
\mathbf{else}:\\
\;\;\;\;x + z \cdot \frac{y}{a - t}\\
\end{array}
\end{array}
if t < -1.99999999999999989e34 or 5.60000000000000033e-85 < t Initial program 83.4%
associate-/l*99.9%
Simplified99.9%
Taylor expanded in z around 0 89.6%
mul-1-neg89.6%
div-sub89.7%
sub-neg89.7%
*-inverses89.7%
metadata-eval89.7%
Simplified89.7%
Taylor expanded in y around 0 89.7%
if -1.99999999999999989e34 < t < 5.60000000000000033e-85Initial program 97.5%
associate-*l/96.1%
Simplified96.1%
Taylor expanded in z around inf 90.6%
associate-*l/90.7%
*-commutative90.7%
Simplified90.7%
Final simplification90.2%
(FPCore (x y z t a)
:precision binary64
(if (<= t -5.5e-13)
(- x (/ y (/ t (- z t))))
(if (<= t 26000000000000.0)
(+ x (/ (* y z) (- a t)))
(+ x (/ y (- 1.0 (/ a t)))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -5.5e-13) {
tmp = x - (y / (t / (z - t)));
} else if (t <= 26000000000000.0) {
tmp = x + ((y * z) / (a - t));
} else {
tmp = x + (y / (1.0 - (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 <= (-5.5d-13)) then
tmp = x - (y / (t / (z - t)))
else if (t <= 26000000000000.0d0) then
tmp = x + ((y * z) / (a - t))
else
tmp = x + (y / (1.0d0 - (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 <= -5.5e-13) {
tmp = x - (y / (t / (z - t)));
} else if (t <= 26000000000000.0) {
tmp = x + ((y * z) / (a - t));
} else {
tmp = x + (y / (1.0 - (a / t)));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if t <= -5.5e-13: tmp = x - (y / (t / (z - t))) elif t <= 26000000000000.0: tmp = x + ((y * z) / (a - t)) else: tmp = x + (y / (1.0 - (a / t))) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (t <= -5.5e-13) tmp = Float64(x - Float64(y / Float64(t / Float64(z - t)))); elseif (t <= 26000000000000.0) tmp = Float64(x + Float64(Float64(y * z) / Float64(a - t))); else tmp = Float64(x + Float64(y / Float64(1.0 - Float64(a / t)))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (t <= -5.5e-13) tmp = x - (y / (t / (z - t))); elseif (t <= 26000000000000.0) tmp = x + ((y * z) / (a - t)); else tmp = x + (y / (1.0 - (a / t))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, -5.5e-13], N[(x - N[(y / N[(t / N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 26000000000000.0], N[(x + N[(N[(y * z), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(y / N[(1.0 - N[(a / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -5.5 \cdot 10^{-13}:\\
\;\;\;\;x - \frac{y}{\frac{t}{z - t}}\\
\mathbf{elif}\;t \leq 26000000000000:\\
\;\;\;\;x + \frac{y \cdot z}{a - t}\\
\mathbf{else}:\\
\;\;\;\;x + \frac{y}{1 - \frac{a}{t}}\\
\end{array}
\end{array}
if t < -5.49999999999999979e-13Initial program 82.8%
associate-*l/96.8%
Simplified96.8%
Taylor expanded in a around 0 76.9%
mul-1-neg76.9%
unsub-neg76.9%
associate-/l*89.7%
Simplified89.7%
if -5.49999999999999979e-13 < t < 2.6e13Initial program 98.4%
associate-*l/95.6%
Simplified95.6%
Taylor expanded in z around inf 91.0%
if 2.6e13 < t Initial program 80.4%
associate-/l*99.8%
Simplified99.8%
Taylor expanded in z around 0 89.6%
mul-1-neg89.6%
div-sub89.6%
sub-neg89.6%
*-inverses89.6%
metadata-eval89.6%
Simplified89.6%
Taylor expanded in y around 0 89.6%
Final simplification90.3%
(FPCore (x y z t a) :precision binary64 (if (<= a -1.75e-86) x (if (<= a 1.15e-178) (* y (- 1.0 (/ z t))) (if (<= a 9.4e+123) (+ x y) x))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= -1.75e-86) {
tmp = x;
} else if (a <= 1.15e-178) {
tmp = y * (1.0 - (z / t));
} else if (a <= 9.4e+123) {
tmp = x + y;
} else {
tmp = x;
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (a <= (-1.75d-86)) then
tmp = x
else if (a <= 1.15d-178) then
tmp = y * (1.0d0 - (z / t))
else if (a <= 9.4d+123) then
tmp = x + y
else
tmp = x
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= -1.75e-86) {
tmp = x;
} else if (a <= 1.15e-178) {
tmp = y * (1.0 - (z / t));
} else if (a <= 9.4e+123) {
tmp = x + y;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if a <= -1.75e-86: tmp = x elif a <= 1.15e-178: tmp = y * (1.0 - (z / t)) elif a <= 9.4e+123: tmp = x + y else: tmp = x return tmp
function code(x, y, z, t, a) tmp = 0.0 if (a <= -1.75e-86) tmp = x; elseif (a <= 1.15e-178) tmp = Float64(y * Float64(1.0 - Float64(z / t))); elseif (a <= 9.4e+123) tmp = Float64(x + y); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (a <= -1.75e-86) tmp = x; elseif (a <= 1.15e-178) tmp = y * (1.0 - (z / t)); elseif (a <= 9.4e+123) tmp = x + y; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[a, -1.75e-86], x, If[LessEqual[a, 1.15e-178], N[(y * N[(1.0 - N[(z / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 9.4e+123], N[(x + y), $MachinePrecision], x]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -1.75 \cdot 10^{-86}:\\
\;\;\;\;x\\
\mathbf{elif}\;a \leq 1.15 \cdot 10^{-178}:\\
\;\;\;\;y \cdot \left(1 - \frac{z}{t}\right)\\
\mathbf{elif}\;a \leq 9.4 \cdot 10^{+123}:\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if a < -1.7500000000000001e-86 or 9.39999999999999958e123 < a Initial program 88.2%
associate-*l/96.7%
Simplified96.7%
Taylor expanded in x around inf 67.5%
if -1.7500000000000001e-86 < a < 1.14999999999999997e-178Initial program 91.7%
associate-*l/91.7%
Simplified91.7%
Taylor expanded in a around 0 81.6%
mul-1-neg81.6%
unsub-neg81.6%
associate-/l*88.1%
Simplified88.1%
Taylor expanded in y around inf 68.6%
if 1.14999999999999997e-178 < a < 9.39999999999999958e123Initial program 92.9%
associate-*l/95.6%
Simplified95.6%
Taylor expanded in t around inf 79.8%
+-commutative79.8%
Simplified79.8%
Final simplification70.9%
(FPCore (x y z t a) :precision binary64 (if (or (<= t -1.35e-16) (not (<= t 9.2e-58))) (+ x y) (+ x (/ (* y z) a))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -1.35e-16) || !(t <= 9.2e-58)) {
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 <= (-1.35d-16)) .or. (.not. (t <= 9.2d-58))) 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 <= -1.35e-16) || !(t <= 9.2e-58)) {
tmp = x + y;
} else {
tmp = x + ((y * z) / a);
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (t <= -1.35e-16) or not (t <= 9.2e-58): tmp = x + y else: tmp = x + ((y * z) / a) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((t <= -1.35e-16) || !(t <= 9.2e-58)) tmp = Float64(x + y); else tmp = Float64(x + Float64(Float64(y * z) / a)); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((t <= -1.35e-16) || ~((t <= 9.2e-58))) tmp = x + y; else tmp = x + ((y * z) / a); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[t, -1.35e-16], N[Not[LessEqual[t, 9.2e-58]], $MachinePrecision]], N[(x + y), $MachinePrecision], N[(x + N[(N[(y * z), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.35 \cdot 10^{-16} \lor \neg \left(t \leq 9.2 \cdot 10^{-58}\right):\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;x + \frac{y \cdot z}{a}\\
\end{array}
\end{array}
if t < -1.35e-16 or 9.1999999999999995e-58 < t Initial program 83.2%
associate-*l/95.0%
Simplified95.0%
Taylor expanded in t around inf 77.6%
+-commutative77.6%
Simplified77.6%
if -1.35e-16 < t < 9.1999999999999995e-58Initial program 98.2%
associate-*l/95.2%
Simplified95.2%
Taylor expanded in t around 0 80.4%
Final simplification79.0%
(FPCore (x y z t a) :precision binary64 (if (or (<= t -3.1e-12) (not (<= t 1e-57))) (+ x y) (+ x (* y (/ z a)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -3.1e-12) || !(t <= 1e-57)) {
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.1d-12)) .or. (.not. (t <= 1d-57))) 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.1e-12) || !(t <= 1e-57)) {
tmp = x + y;
} else {
tmp = x + (y * (z / a));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (t <= -3.1e-12) or not (t <= 1e-57): tmp = x + y else: tmp = x + (y * (z / a)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((t <= -3.1e-12) || !(t <= 1e-57)) 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.1e-12) || ~((t <= 1e-57))) 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.1e-12], N[Not[LessEqual[t, 1e-57]], $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.1 \cdot 10^{-12} \lor \neg \left(t \leq 10^{-57}\right):\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot \frac{z}{a}\\
\end{array}
\end{array}
if t < -3.1000000000000001e-12 or 9.99999999999999955e-58 < t Initial program 83.2%
associate-*l/95.0%
Simplified95.0%
Taylor expanded in t around inf 77.6%
+-commutative77.6%
Simplified77.6%
if -3.1000000000000001e-12 < t < 9.99999999999999955e-58Initial program 98.2%
associate-*l/95.2%
Simplified95.2%
Taylor expanded in t around 0 80.4%
+-commutative80.4%
associate-/l*81.0%
Simplified81.0%
div-inv80.4%
clear-num80.5%
Applied egg-rr80.5%
Final simplification79.0%
(FPCore (x y z t a) :precision binary64 (if (or (<= t -4.2e-12) (not (<= t 8.6e-58))) (+ x y) (+ x (/ y (/ a z)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -4.2e-12) || !(t <= 8.6e-58)) {
tmp = x + y;
} else {
tmp = x + (y / (a / z));
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if ((t <= (-4.2d-12)) .or. (.not. (t <= 8.6d-58))) then
tmp = x + y
else
tmp = x + (y / (a / z))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -4.2e-12) || !(t <= 8.6e-58)) {
tmp = x + y;
} else {
tmp = x + (y / (a / z));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (t <= -4.2e-12) or not (t <= 8.6e-58): tmp = x + y else: tmp = x + (y / (a / z)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((t <= -4.2e-12) || !(t <= 8.6e-58)) tmp = Float64(x + y); else tmp = Float64(x + Float64(y / Float64(a / z))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((t <= -4.2e-12) || ~((t <= 8.6e-58))) tmp = x + y; else tmp = x + (y / (a / z)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[t, -4.2e-12], N[Not[LessEqual[t, 8.6e-58]], $MachinePrecision]], N[(x + y), $MachinePrecision], N[(x + N[(y / N[(a / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -4.2 \cdot 10^{-12} \lor \neg \left(t \leq 8.6 \cdot 10^{-58}\right):\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;x + \frac{y}{\frac{a}{z}}\\
\end{array}
\end{array}
if t < -4.19999999999999988e-12 or 8.5999999999999999e-58 < t Initial program 83.2%
associate-*l/95.0%
Simplified95.0%
Taylor expanded in t around inf 77.6%
+-commutative77.6%
Simplified77.6%
if -4.19999999999999988e-12 < t < 8.5999999999999999e-58Initial program 98.2%
associate-*l/95.2%
Simplified95.2%
Taylor expanded in t around 0 80.4%
+-commutative80.4%
associate-/l*81.0%
Simplified81.0%
Final simplification79.2%
(FPCore (x y z t a) :precision binary64 (if (<= a -1.4e+31) x (if (<= a 1.4e+124) (+ x y) x)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= -1.4e+31) {
tmp = x;
} else if (a <= 1.4e+124) {
tmp = x + y;
} else {
tmp = x;
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (a <= (-1.4d+31)) then
tmp = x
else if (a <= 1.4d+124) then
tmp = x + y
else
tmp = x
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= -1.4e+31) {
tmp = x;
} else if (a <= 1.4e+124) {
tmp = x + y;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if a <= -1.4e+31: tmp = x elif a <= 1.4e+124: tmp = x + y else: tmp = x return tmp
function code(x, y, z, t, a) tmp = 0.0 if (a <= -1.4e+31) tmp = x; elseif (a <= 1.4e+124) tmp = Float64(x + y); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (a <= -1.4e+31) tmp = x; elseif (a <= 1.4e+124) tmp = x + y; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[a, -1.4e+31], x, If[LessEqual[a, 1.4e+124], N[(x + y), $MachinePrecision], x]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -1.4 \cdot 10^{+31}:\\
\;\;\;\;x\\
\mathbf{elif}\;a \leq 1.4 \cdot 10^{+124}:\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if a < -1.40000000000000008e31 or 1.4e124 < a Initial program 87.2%
associate-*l/96.2%
Simplified96.2%
Taylor expanded in x around inf 72.1%
if -1.40000000000000008e31 < a < 1.4e124Initial program 92.5%
associate-*l/94.3%
Simplified94.3%
Taylor expanded in t around inf 65.7%
+-commutative65.7%
Simplified65.7%
Final simplification68.3%
(FPCore (x y z t a) :precision binary64 (if (<= x -3.45e-242) x (if (<= x 9.5e-105) y x)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (x <= -3.45e-242) {
tmp = x;
} else if (x <= 9.5e-105) {
tmp = 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 (x <= (-3.45d-242)) then
tmp = x
else if (x <= 9.5d-105) then
tmp = 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 (x <= -3.45e-242) {
tmp = x;
} else if (x <= 9.5e-105) {
tmp = y;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if x <= -3.45e-242: tmp = x elif x <= 9.5e-105: tmp = y else: tmp = x return tmp
function code(x, y, z, t, a) tmp = 0.0 if (x <= -3.45e-242) tmp = x; elseif (x <= 9.5e-105) tmp = y; else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (x <= -3.45e-242) tmp = x; elseif (x <= 9.5e-105) tmp = y; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[x, -3.45e-242], x, If[LessEqual[x, 9.5e-105], y, x]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -3.45 \cdot 10^{-242}:\\
\;\;\;\;x\\
\mathbf{elif}\;x \leq 9.5 \cdot 10^{-105}:\\
\;\;\;\;y\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if x < -3.44999999999999998e-242 or 9.5000000000000002e-105 < x Initial program 90.2%
associate-*l/97.6%
Simplified97.6%
Taylor expanded in x around inf 62.9%
if -3.44999999999999998e-242 < x < 9.5000000000000002e-105Initial program 90.8%
associate-*l/85.1%
Simplified85.1%
Taylor expanded in a around 0 57.4%
mul-1-neg57.4%
unsub-neg57.4%
associate-/l*63.1%
Simplified63.1%
Taylor expanded in y around inf 55.7%
Taylor expanded in z around 0 39.4%
Final simplification58.2%
(FPCore (x y z t a) :precision binary64 (+ x (* (- z t) (/ y (- a t)))))
double code(double x, double y, double z, double t, double a) {
return x + ((z - t) * (y / (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 + ((z - t) * (y / (a - t)))
end function
public static double code(double x, double y, double z, double t, double a) {
return x + ((z - t) * (y / (a - t)));
}
def code(x, y, z, t, a): return x + ((z - t) * (y / (a - t)))
function code(x, y, z, t, a) return Float64(x + Float64(Float64(z - t) * Float64(y / Float64(a - t)))) end
function tmp = code(x, y, z, t, a) tmp = x + ((z - t) * (y / (a - t))); end
code[x_, y_, z_, t_, a_] := N[(x + N[(N[(z - t), $MachinePrecision] * N[(y / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \left(z - t\right) \cdot \frac{y}{a - t}
\end{array}
Initial program 90.3%
associate-*l/95.1%
Simplified95.1%
Final simplification95.1%
(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 90.3%
associate-*l/95.1%
Simplified95.1%
Taylor expanded in x around inf 53.3%
Final simplification53.3%
(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 2024034
(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))))