
(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 14 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.6%
associate-/l*99.2%
Simplified99.2%
Final simplification99.2%
(FPCore (x y z t a)
:precision binary64
(if (<= t -1.7e+40)
(+ x y)
(if (or (<= t 1.86e-87) (and (not (<= t 4.7e-23)) (<= t 1.6e+60)))
(+ x (/ y (/ a z)))
(+ x y))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -1.7e+40) {
tmp = x + y;
} else if ((t <= 1.86e-87) || (!(t <= 4.7e-23) && (t <= 1.6e+60))) {
tmp = x + (y / (a / z));
} 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.7d+40)) then
tmp = x + y
else if ((t <= 1.86d-87) .or. (.not. (t <= 4.7d-23)) .and. (t <= 1.6d+60)) then
tmp = x + (y / (a / z))
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.7e+40) {
tmp = x + y;
} else if ((t <= 1.86e-87) || (!(t <= 4.7e-23) && (t <= 1.6e+60))) {
tmp = x + (y / (a / z));
} else {
tmp = x + y;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if t <= -1.7e+40: tmp = x + y elif (t <= 1.86e-87) or (not (t <= 4.7e-23) and (t <= 1.6e+60)): tmp = x + (y / (a / z)) else: tmp = x + y return tmp
function code(x, y, z, t, a) tmp = 0.0 if (t <= -1.7e+40) tmp = Float64(x + y); elseif ((t <= 1.86e-87) || (!(t <= 4.7e-23) && (t <= 1.6e+60))) tmp = Float64(x + Float64(y / Float64(a / z))); else tmp = Float64(x + y); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (t <= -1.7e+40) tmp = x + y; elseif ((t <= 1.86e-87) || (~((t <= 4.7e-23)) && (t <= 1.6e+60))) tmp = x + (y / (a / z)); else tmp = x + y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, -1.7e+40], N[(x + y), $MachinePrecision], If[Or[LessEqual[t, 1.86e-87], And[N[Not[LessEqual[t, 4.7e-23]], $MachinePrecision], LessEqual[t, 1.6e+60]]], N[(x + N[(y / N[(a / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + y), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.7 \cdot 10^{+40}:\\
\;\;\;\;x + y\\
\mathbf{elif}\;t \leq 1.86 \cdot 10^{-87} \lor \neg \left(t \leq 4.7 \cdot 10^{-23}\right) \land t \leq 1.6 \cdot 10^{+60}:\\
\;\;\;\;x + \frac{y}{\frac{a}{z}}\\
\mathbf{else}:\\
\;\;\;\;x + y\\
\end{array}
\end{array}
if t < -1.69999999999999994e40 or 1.8600000000000001e-87 < t < 4.7000000000000001e-23 or 1.59999999999999995e60 < t Initial program 71.8%
associate-*l/93.2%
Simplified93.2%
Taylor expanded in t around inf 76.8%
if -1.69999999999999994e40 < t < 1.8600000000000001e-87 or 4.7000000000000001e-23 < t < 1.59999999999999995e60Initial program 97.0%
associate-*l/96.9%
Simplified96.9%
Taylor expanded in t around 0 77.2%
associate-/l*79.2%
Simplified79.2%
Final simplification78.1%
(FPCore (x y z t a)
:precision binary64
(if (<= t -1.4e+45)
(+ x y)
(if (<= t 1.86e-87)
(+ x (/ y (/ a z)))
(if (or (<= t 1.1e-22) (not (<= t 1.4e+61)))
(+ x y)
(- x (/ t (/ a y)))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -1.4e+45) {
tmp = x + y;
} else if (t <= 1.86e-87) {
tmp = x + (y / (a / z));
} else if ((t <= 1.1e-22) || !(t <= 1.4e+61)) {
tmp = x + y;
} else {
tmp = x - (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 <= (-1.4d+45)) then
tmp = x + y
else if (t <= 1.86d-87) then
tmp = x + (y / (a / z))
else if ((t <= 1.1d-22) .or. (.not. (t <= 1.4d+61))) then
tmp = x + y
else
tmp = x - (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 <= -1.4e+45) {
tmp = x + y;
} else if (t <= 1.86e-87) {
tmp = x + (y / (a / z));
} else if ((t <= 1.1e-22) || !(t <= 1.4e+61)) {
tmp = x + y;
} else {
tmp = x - (t / (a / y));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if t <= -1.4e+45: tmp = x + y elif t <= 1.86e-87: tmp = x + (y / (a / z)) elif (t <= 1.1e-22) or not (t <= 1.4e+61): tmp = x + y else: tmp = x - (t / (a / y)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (t <= -1.4e+45) tmp = Float64(x + y); elseif (t <= 1.86e-87) tmp = Float64(x + Float64(y / Float64(a / z))); elseif ((t <= 1.1e-22) || !(t <= 1.4e+61)) tmp = Float64(x + y); else tmp = Float64(x - Float64(t / Float64(a / y))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (t <= -1.4e+45) tmp = x + y; elseif (t <= 1.86e-87) tmp = x + (y / (a / z)); elseif ((t <= 1.1e-22) || ~((t <= 1.4e+61))) tmp = x + y; else tmp = x - (t / (a / y)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, -1.4e+45], N[(x + y), $MachinePrecision], If[LessEqual[t, 1.86e-87], N[(x + N[(y / N[(a / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[t, 1.1e-22], N[Not[LessEqual[t, 1.4e+61]], $MachinePrecision]], N[(x + y), $MachinePrecision], N[(x - N[(t / N[(a / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.4 \cdot 10^{+45}:\\
\;\;\;\;x + y\\
\mathbf{elif}\;t \leq 1.86 \cdot 10^{-87}:\\
\;\;\;\;x + \frac{y}{\frac{a}{z}}\\
\mathbf{elif}\;t \leq 1.1 \cdot 10^{-22} \lor \neg \left(t \leq 1.4 \cdot 10^{+61}\right):\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;x - \frac{t}{\frac{a}{y}}\\
\end{array}
\end{array}
if t < -1.4e45 or 1.8600000000000001e-87 < t < 1.1e-22 or 1.4000000000000001e61 < t Initial program 71.8%
associate-*l/93.2%
Simplified93.2%
Taylor expanded in t around inf 76.8%
if -1.4e45 < t < 1.8600000000000001e-87Initial program 96.7%
associate-*l/96.9%
Simplified96.9%
Taylor expanded in t around 0 78.2%
associate-/l*80.4%
Simplified80.4%
if 1.1e-22 < t < 1.4000000000000001e61Initial program 99.6%
+-commutative99.6%
associate-*r/99.9%
fma-def99.7%
Simplified99.7%
fma-udef99.9%
Applied egg-rr99.9%
Taylor expanded in a around inf 81.7%
*-commutative81.7%
associate-*r/81.9%
Simplified81.9%
Taylor expanded in z around 0 73.0%
+-commutative73.0%
mul-1-neg73.0%
unsub-neg73.0%
*-commutative73.0%
associate-/l*73.1%
Simplified73.1%
Final simplification78.3%
(FPCore (x y z t a) :precision binary64 (if (or (<= t -4.5e+61) (not (<= t 1.05e+73))) (+ x y) (+ x (* z (/ y (- a t))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -4.5e+61) || !(t <= 1.05e+73)) {
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.5d+61)) .or. (.not. (t <= 1.05d+73))) 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.5e+61) || !(t <= 1.05e+73)) {
tmp = x + y;
} else {
tmp = x + (z * (y / (a - t)));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (t <= -4.5e+61) or not (t <= 1.05e+73): 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.5e+61) || !(t <= 1.05e+73)) 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.5e+61) || ~((t <= 1.05e+73))) 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.5e+61], N[Not[LessEqual[t, 1.05e+73]], $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.5 \cdot 10^{+61} \lor \neg \left(t \leq 1.05 \cdot 10^{+73}\right):\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;x + z \cdot \frac{y}{a - t}\\
\end{array}
\end{array}
if t < -4.5e61 or 1.0500000000000001e73 < t Initial program 67.1%
associate-*l/92.6%
Simplified92.6%
Taylor expanded in t around inf 79.2%
if -4.5e61 < t < 1.0500000000000001e73Initial program 95.8%
associate-*l/96.7%
Simplified96.7%
Taylor expanded in z around inf 82.8%
associate-*l/83.7%
*-commutative83.7%
Simplified83.7%
Final simplification82.1%
(FPCore (x y z t a) :precision binary64 (if (or (<= t -1.36e+63) (not (<= t 8.8e+72))) (+ x y) (+ x (/ y (/ (- a t) z)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -1.36e+63) || !(t <= 8.8e+72)) {
tmp = x + y;
} else {
tmp = x + (y / ((a - t) / z));
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if ((t <= (-1.36d+63)) .or. (.not. (t <= 8.8d+72))) then
tmp = x + y
else
tmp = x + (y / ((a - t) / z))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -1.36e+63) || !(t <= 8.8e+72)) {
tmp = x + y;
} else {
tmp = x + (y / ((a - t) / z));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (t <= -1.36e+63) or not (t <= 8.8e+72): tmp = x + y else: tmp = x + (y / ((a - t) / z)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((t <= -1.36e+63) || !(t <= 8.8e+72)) tmp = Float64(x + y); else tmp = Float64(x + Float64(y / Float64(Float64(a - t) / z))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((t <= -1.36e+63) || ~((t <= 8.8e+72))) tmp = x + y; else tmp = x + (y / ((a - t) / z)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[t, -1.36e+63], N[Not[LessEqual[t, 8.8e+72]], $MachinePrecision]], N[(x + y), $MachinePrecision], N[(x + N[(y / N[(N[(a - t), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.36 \cdot 10^{+63} \lor \neg \left(t \leq 8.8 \cdot 10^{+72}\right):\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;x + \frac{y}{\frac{a - t}{z}}\\
\end{array}
\end{array}
if t < -1.36000000000000006e63 or 8.8e72 < t Initial program 67.1%
associate-*l/92.6%
Simplified92.6%
Taylor expanded in t around inf 79.2%
if -1.36000000000000006e63 < t < 8.8e72Initial program 95.8%
associate-/l*98.7%
Simplified98.7%
Taylor expanded in z around inf 85.0%
Final simplification83.0%
(FPCore (x y z t a) :precision binary64 (if (or (<= t -1.36e-33) (not (<= t 1.12e-63))) (- x (/ y (+ (/ a t) -1.0))) (+ x (/ y (/ (- a t) z)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -1.36e-33) || !(t <= 1.12e-63)) {
tmp = x - (y / ((a / t) + -1.0));
} else {
tmp = x + (y / ((a - t) / z));
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if ((t <= (-1.36d-33)) .or. (.not. (t <= 1.12d-63))) then
tmp = x - (y / ((a / t) + (-1.0d0)))
else
tmp = x + (y / ((a - t) / z))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -1.36e-33) || !(t <= 1.12e-63)) {
tmp = x - (y / ((a / t) + -1.0));
} else {
tmp = x + (y / ((a - t) / z));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (t <= -1.36e-33) or not (t <= 1.12e-63): tmp = x - (y / ((a / t) + -1.0)) else: tmp = x + (y / ((a - t) / z)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((t <= -1.36e-33) || !(t <= 1.12e-63)) tmp = Float64(x - Float64(y / Float64(Float64(a / t) + -1.0))); else tmp = Float64(x + Float64(y / Float64(Float64(a - t) / z))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((t <= -1.36e-33) || ~((t <= 1.12e-63))) tmp = x - (y / ((a / t) + -1.0)); else tmp = x + (y / ((a - t) / z)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[t, -1.36e-33], N[Not[LessEqual[t, 1.12e-63]], $MachinePrecision]], N[(x - N[(y / N[(N[(a / t), $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(y / N[(N[(a - t), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.36 \cdot 10^{-33} \lor \neg \left(t \leq 1.12 \cdot 10^{-63}\right):\\
\;\;\;\;x - \frac{y}{\frac{a}{t} + -1}\\
\mathbf{else}:\\
\;\;\;\;x + \frac{y}{\frac{a - t}{z}}\\
\end{array}
\end{array}
if t < -1.36e-33 or 1.12000000000000002e-63 < t Initial program 77.2%
+-commutative77.2%
associate-*r/99.9%
fma-def99.9%
Simplified99.9%
fma-udef99.9%
Applied egg-rr99.9%
Taylor expanded in z around 0 69.4%
+-commutative69.4%
mul-1-neg69.4%
unsub-neg69.4%
associate-/l*87.0%
div-sub87.0%
*-inverses87.0%
Simplified87.0%
if -1.36e-33 < t < 1.12000000000000002e-63Initial program 96.5%
associate-/l*98.2%
Simplified98.2%
Taylor expanded in z around inf 93.9%
Final simplification90.0%
(FPCore (x y z t a) :precision binary64 (if (or (<= t -4.1e+42) (not (<= t 1.86e-87))) (+ x y) (+ x (* z (/ y a)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -4.1e+42) || !(t <= 1.86e-87)) {
tmp = x + y;
} else {
tmp = x + (z * (y / a));
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if ((t <= (-4.1d+42)) .or. (.not. (t <= 1.86d-87))) then
tmp = x + y
else
tmp = x + (z * (y / a))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -4.1e+42) || !(t <= 1.86e-87)) {
tmp = x + y;
} else {
tmp = x + (z * (y / a));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (t <= -4.1e+42) or not (t <= 1.86e-87): tmp = x + y else: tmp = x + (z * (y / a)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((t <= -4.1e+42) || !(t <= 1.86e-87)) tmp = Float64(x + y); else tmp = Float64(x + Float64(z * Float64(y / a))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((t <= -4.1e+42) || ~((t <= 1.86e-87))) tmp = x + y; else tmp = x + (z * (y / a)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[t, -4.1e+42], N[Not[LessEqual[t, 1.86e-87]], $MachinePrecision]], N[(x + y), $MachinePrecision], N[(x + N[(z * N[(y / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -4.1 \cdot 10^{+42} \lor \neg \left(t \leq 1.86 \cdot 10^{-87}\right):\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;x + z \cdot \frac{y}{a}\\
\end{array}
\end{array}
if t < -4.1e42 or 1.8600000000000001e-87 < t Initial program 75.2%
associate-*l/93.6%
Simplified93.6%
Taylor expanded in t around inf 72.6%
if -4.1e42 < t < 1.8600000000000001e-87Initial program 96.7%
associate-*l/96.9%
Simplified96.9%
Taylor expanded in z around inf 88.6%
associate-*l/88.8%
*-commutative88.8%
Simplified88.8%
Taylor expanded in a around inf 78.3%
Final simplification75.4%
(FPCore (x y z t a) :precision binary64 (if (<= a -2.3e-280) (+ x y) (if (<= a 8e-134) (* y (- 1.0 (/ z t))) x)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= -2.3e-280) {
tmp = x + y;
} else if (a <= 8e-134) {
tmp = y * (1.0 - (z / t));
} 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 <= (-2.3d-280)) then
tmp = x + y
else if (a <= 8d-134) then
tmp = y * (1.0d0 - (z / t))
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 <= -2.3e-280) {
tmp = x + y;
} else if (a <= 8e-134) {
tmp = y * (1.0 - (z / t));
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if a <= -2.3e-280: tmp = x + y elif a <= 8e-134: tmp = y * (1.0 - (z / t)) else: tmp = x return tmp
function code(x, y, z, t, a) tmp = 0.0 if (a <= -2.3e-280) tmp = Float64(x + y); elseif (a <= 8e-134) tmp = Float64(y * Float64(1.0 - Float64(z / t))); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (a <= -2.3e-280) tmp = x + y; elseif (a <= 8e-134) tmp = y * (1.0 - (z / t)); else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[a, -2.3e-280], N[(x + y), $MachinePrecision], If[LessEqual[a, 8e-134], N[(y * N[(1.0 - N[(z / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], x]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -2.3 \cdot 10^{-280}:\\
\;\;\;\;x + y\\
\mathbf{elif}\;a \leq 8 \cdot 10^{-134}:\\
\;\;\;\;y \cdot \left(1 - \frac{z}{t}\right)\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if a < -2.3e-280Initial program 87.1%
associate-*l/96.2%
Simplified96.2%
Taylor expanded in t around inf 66.2%
if -2.3e-280 < a < 8.00000000000000032e-134Initial program 72.7%
associate-*l/96.9%
Simplified96.9%
Taylor expanded in a around 0 62.4%
mul-1-neg62.4%
*-commutative62.4%
associate-/l*89.4%
distribute-neg-frac89.4%
Simplified89.4%
Taylor expanded in y around inf 75.5%
if 8.00000000000000032e-134 < a Initial program 88.2%
associate-*l/93.4%
Simplified93.4%
Taylor expanded in x around inf 64.3%
Final simplification66.7%
(FPCore (x y z t a) :precision binary64 (if (<= t -3.2e+38) (+ x y) (if (<= t 1.85e-87) (+ x (/ z (/ a y))) (+ x y))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -3.2e+38) {
tmp = x + y;
} else if (t <= 1.85e-87) {
tmp = x + (z / (a / 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.2d+38)) then
tmp = x + y
else if (t <= 1.85d-87) then
tmp = x + (z / (a / 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.2e+38) {
tmp = x + y;
} else if (t <= 1.85e-87) {
tmp = x + (z / (a / y));
} else {
tmp = x + y;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if t <= -3.2e+38: tmp = x + y elif t <= 1.85e-87: tmp = x + (z / (a / y)) else: tmp = x + y return tmp
function code(x, y, z, t, a) tmp = 0.0 if (t <= -3.2e+38) tmp = Float64(x + y); elseif (t <= 1.85e-87) tmp = Float64(x + Float64(z / Float64(a / 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.2e+38) tmp = x + y; elseif (t <= 1.85e-87) tmp = x + (z / (a / y)); else tmp = x + y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, -3.2e+38], N[(x + y), $MachinePrecision], If[LessEqual[t, 1.85e-87], N[(x + N[(z / N[(a / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + y), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -3.2 \cdot 10^{+38}:\\
\;\;\;\;x + y\\
\mathbf{elif}\;t \leq 1.85 \cdot 10^{-87}:\\
\;\;\;\;x + \frac{z}{\frac{a}{y}}\\
\mathbf{else}:\\
\;\;\;\;x + y\\
\end{array}
\end{array}
if t < -3.19999999999999985e38 or 1.8500000000000001e-87 < t Initial program 75.2%
associate-*l/93.6%
Simplified93.6%
Taylor expanded in t around inf 72.6%
if -3.19999999999999985e38 < t < 1.8500000000000001e-87Initial program 96.7%
associate-*l/96.9%
Simplified96.9%
Taylor expanded in z around inf 88.6%
associate-*l/88.8%
*-commutative88.8%
Simplified88.8%
clear-num88.7%
un-div-inv89.2%
Applied egg-rr89.2%
Taylor expanded in a around inf 78.7%
Final simplification75.6%
(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 85.6%
associate-*l/95.2%
Simplified95.2%
Final simplification95.2%
(FPCore (x y z t a) :precision binary64 (if (<= a 1.38e-307) (+ x y) (if (<= a 2.4e-245) (* z (- (/ y t))) (if (<= a 1550000000.0) (+ x y) x))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= 1.38e-307) {
tmp = x + y;
} else if (a <= 2.4e-245) {
tmp = z * -(y / t);
} else if (a <= 1550000000.0) {
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.38d-307) then
tmp = x + y
else if (a <= 2.4d-245) then
tmp = z * -(y / t)
else if (a <= 1550000000.0d0) 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.38e-307) {
tmp = x + y;
} else if (a <= 2.4e-245) {
tmp = z * -(y / t);
} else if (a <= 1550000000.0) {
tmp = x + y;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if a <= 1.38e-307: tmp = x + y elif a <= 2.4e-245: tmp = z * -(y / t) elif a <= 1550000000.0: tmp = x + y else: tmp = x return tmp
function code(x, y, z, t, a) tmp = 0.0 if (a <= 1.38e-307) tmp = Float64(x + y); elseif (a <= 2.4e-245) tmp = Float64(z * Float64(-Float64(y / t))); elseif (a <= 1550000000.0) 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.38e-307) tmp = x + y; elseif (a <= 2.4e-245) tmp = z * -(y / t); elseif (a <= 1550000000.0) tmp = x + y; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[a, 1.38e-307], N[(x + y), $MachinePrecision], If[LessEqual[a, 2.4e-245], N[(z * (-N[(y / t), $MachinePrecision])), $MachinePrecision], If[LessEqual[a, 1550000000.0], N[(x + y), $MachinePrecision], x]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq 1.38 \cdot 10^{-307}:\\
\;\;\;\;x + y\\
\mathbf{elif}\;a \leq 2.4 \cdot 10^{-245}:\\
\;\;\;\;z \cdot \left(-\frac{y}{t}\right)\\
\mathbf{elif}\;a \leq 1550000000:\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if a < 1.3799999999999999e-307 or 2.4e-245 < a < 1.55e9Initial program 85.5%
associate-*l/95.1%
Simplified95.1%
Taylor expanded in t around inf 66.2%
if 1.3799999999999999e-307 < a < 2.4e-245Initial program 89.9%
associate-*l/99.7%
Simplified99.7%
Taylor expanded in a around 0 80.3%
mul-1-neg80.3%
*-commutative80.3%
associate-/l*90.2%
distribute-neg-frac90.2%
Simplified90.2%
Taylor expanded in y around inf 79.5%
Taylor expanded in z around inf 68.8%
mul-1-neg68.8%
associate-/l*69.0%
distribute-neg-frac69.0%
Simplified69.0%
Taylor expanded in y around 0 68.8%
mul-1-neg68.8%
associate-*l/68.8%
distribute-rgt-neg-in68.8%
Simplified68.8%
if 1.55e9 < a Initial program 85.4%
associate-*l/94.9%
Simplified94.9%
Taylor expanded in x around inf 67.5%
Final simplification66.6%
(FPCore (x y z t a) :precision binary64 (if (<= a 1.38e-307) (+ x y) (if (<= a 2.4e-245) (/ (- y) (/ t z)) (if (<= a 820000000.0) (+ x y) x))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= 1.38e-307) {
tmp = x + y;
} else if (a <= 2.4e-245) {
tmp = -y / (t / z);
} else if (a <= 820000000.0) {
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.38d-307) then
tmp = x + y
else if (a <= 2.4d-245) then
tmp = -y / (t / z)
else if (a <= 820000000.0d0) 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.38e-307) {
tmp = x + y;
} else if (a <= 2.4e-245) {
tmp = -y / (t / z);
} else if (a <= 820000000.0) {
tmp = x + y;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if a <= 1.38e-307: tmp = x + y elif a <= 2.4e-245: tmp = -y / (t / z) elif a <= 820000000.0: tmp = x + y else: tmp = x return tmp
function code(x, y, z, t, a) tmp = 0.0 if (a <= 1.38e-307) tmp = Float64(x + y); elseif (a <= 2.4e-245) tmp = Float64(Float64(-y) / Float64(t / z)); elseif (a <= 820000000.0) 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.38e-307) tmp = x + y; elseif (a <= 2.4e-245) tmp = -y / (t / z); elseif (a <= 820000000.0) tmp = x + y; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[a, 1.38e-307], N[(x + y), $MachinePrecision], If[LessEqual[a, 2.4e-245], N[((-y) / N[(t / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 820000000.0], N[(x + y), $MachinePrecision], x]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq 1.38 \cdot 10^{-307}:\\
\;\;\;\;x + y\\
\mathbf{elif}\;a \leq 2.4 \cdot 10^{-245}:\\
\;\;\;\;\frac{-y}{\frac{t}{z}}\\
\mathbf{elif}\;a \leq 820000000:\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if a < 1.3799999999999999e-307 or 2.4e-245 < a < 8.2e8Initial program 85.5%
associate-*l/95.1%
Simplified95.1%
Taylor expanded in t around inf 66.2%
if 1.3799999999999999e-307 < a < 2.4e-245Initial program 89.9%
associate-*l/99.7%
Simplified99.7%
Taylor expanded in a around 0 80.3%
mul-1-neg80.3%
*-commutative80.3%
associate-/l*90.2%
distribute-neg-frac90.2%
Simplified90.2%
Taylor expanded in y around inf 79.5%
Taylor expanded in z around inf 68.8%
mul-1-neg68.8%
associate-/l*69.0%
distribute-neg-frac69.0%
Simplified69.0%
if 8.2e8 < a Initial program 85.4%
associate-*l/94.9%
Simplified94.9%
Taylor expanded in x around inf 67.5%
Final simplification66.6%
(FPCore (x y z t a) :precision binary64 (if (<= a 1550000000.0) (+ x y) x))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= 1550000000.0) {
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 <= 1550000000.0d0) 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 <= 1550000000.0) {
tmp = x + y;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if a <= 1550000000.0: tmp = x + y else: tmp = x return tmp
function code(x, y, z, t, a) tmp = 0.0 if (a <= 1550000000.0) 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 <= 1550000000.0) tmp = x + y; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[a, 1550000000.0], N[(x + y), $MachinePrecision], x]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq 1550000000:\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if a < 1.55e9Initial program 85.7%
associate-*l/95.3%
Simplified95.3%
Taylor expanded in t around inf 64.1%
if 1.55e9 < a Initial program 85.4%
associate-*l/94.9%
Simplified94.9%
Taylor expanded in x around inf 67.5%
Final simplification65.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 85.6%
associate-*l/95.2%
Simplified95.2%
Taylor expanded in x around inf 49.9%
Final simplification49.9%
(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 2023238
(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))))