
(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 (+ (* y (/ (- z t) (- a t))) x))
double code(double x, double y, double z, double t, double a) {
return (y * ((z - t) / (a - t))) + 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 = (y * ((z - t) / (a - t))) + x
end function
public static double code(double x, double y, double z, double t, double a) {
return (y * ((z - t) / (a - t))) + x;
}
def code(x, y, z, t, a): return (y * ((z - t) / (a - t))) + x
function code(x, y, z, t, a) return Float64(Float64(y * Float64(Float64(z - t) / Float64(a - t))) + x) end
function tmp = code(x, y, z, t, a) tmp = (y * ((z - t) / (a - t))) + x; end
code[x_, y_, z_, t_, a_] := N[(N[(y * N[(N[(z - t), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + x), $MachinePrecision]
\begin{array}{l}
\\
y \cdot \frac{z - t}{a - t} + x
\end{array}
Initial program 86.7%
+-commutative86.7%
associate-*r/99.2%
fma-def99.2%
Simplified99.2%
fma-udef99.2%
Applied egg-rr99.2%
Final simplification99.2%
(FPCore (x y z t a)
:precision binary64
(if (<= t -4.5e-73)
(+ y x)
(if (<= t 4.9e-92)
(+ x (* y (/ z a)))
(if (<= t 7e-25)
(- x (* z (/ y t)))
(if (<= t 34.0) (+ x (/ z (/ a y))) (+ y x))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -4.5e-73) {
tmp = y + x;
} else if (t <= 4.9e-92) {
tmp = x + (y * (z / a));
} else if (t <= 7e-25) {
tmp = x - (z * (y / t));
} else if (t <= 34.0) {
tmp = x + (z / (a / y));
} else {
tmp = y + 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 (t <= (-4.5d-73)) then
tmp = y + x
else if (t <= 4.9d-92) then
tmp = x + (y * (z / a))
else if (t <= 7d-25) then
tmp = x - (z * (y / t))
else if (t <= 34.0d0) then
tmp = x + (z / (a / y))
else
tmp = y + x
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-73) {
tmp = y + x;
} else if (t <= 4.9e-92) {
tmp = x + (y * (z / a));
} else if (t <= 7e-25) {
tmp = x - (z * (y / t));
} else if (t <= 34.0) {
tmp = x + (z / (a / y));
} else {
tmp = y + x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if t <= -4.5e-73: tmp = y + x elif t <= 4.9e-92: tmp = x + (y * (z / a)) elif t <= 7e-25: tmp = x - (z * (y / t)) elif t <= 34.0: tmp = x + (z / (a / y)) else: tmp = y + x return tmp
function code(x, y, z, t, a) tmp = 0.0 if (t <= -4.5e-73) tmp = Float64(y + x); elseif (t <= 4.9e-92) tmp = Float64(x + Float64(y * Float64(z / a))); elseif (t <= 7e-25) tmp = Float64(x - Float64(z * Float64(y / t))); elseif (t <= 34.0) tmp = Float64(x + Float64(z / Float64(a / y))); else tmp = Float64(y + x); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (t <= -4.5e-73) tmp = y + x; elseif (t <= 4.9e-92) tmp = x + (y * (z / a)); elseif (t <= 7e-25) tmp = x - (z * (y / t)); elseif (t <= 34.0) tmp = x + (z / (a / y)); else tmp = y + x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, -4.5e-73], N[(y + x), $MachinePrecision], If[LessEqual[t, 4.9e-92], N[(x + N[(y * N[(z / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 7e-25], N[(x - N[(z * N[(y / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 34.0], N[(x + N[(z / N[(a / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(y + x), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -4.5 \cdot 10^{-73}:\\
\;\;\;\;y + x\\
\mathbf{elif}\;t \leq 4.9 \cdot 10^{-92}:\\
\;\;\;\;x + y \cdot \frac{z}{a}\\
\mathbf{elif}\;t \leq 7 \cdot 10^{-25}:\\
\;\;\;\;x - z \cdot \frac{y}{t}\\
\mathbf{elif}\;t \leq 34:\\
\;\;\;\;x + \frac{z}{\frac{a}{y}}\\
\mathbf{else}:\\
\;\;\;\;y + x\\
\end{array}
\end{array}
if t < -4.5e-73 or 34 < t Initial program 78.7%
associate-*l/93.9%
Simplified93.9%
Taylor expanded in t around inf 81.2%
if -4.5e-73 < t < 4.9e-92Initial program 95.9%
+-commutative95.9%
associate-*r/97.9%
fma-def97.9%
Simplified97.9%
fma-udef97.9%
Applied egg-rr97.9%
Taylor expanded in t around 0 86.7%
if 4.9e-92 < t < 7.0000000000000004e-25Initial program 94.7%
associate-*l/95.0%
Simplified95.0%
Taylor expanded in z around inf 66.5%
associate-*l/71.5%
*-commutative71.5%
Simplified71.5%
Taylor expanded in a around 0 66.8%
+-commutative66.8%
mul-1-neg66.8%
sub-neg66.8%
associate-*l/66.6%
*-commutative66.6%
Simplified66.6%
if 7.0000000000000004e-25 < t < 34Initial program 99.7%
associate-*l/99.7%
Simplified99.7%
Taylor expanded in z around inf 99.7%
associate-*l/99.7%
*-commutative99.7%
Simplified99.7%
clear-num100.0%
un-div-inv100.0%
Applied egg-rr100.0%
Taylor expanded in a around inf 100.0%
Final simplification82.5%
(FPCore (x y z t a) :precision binary64 (if (or (<= t -3.5e+64) (not (<= t 2.4e+146))) (+ y x) (+ x (/ z (/ (- a t) y)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -3.5e+64) || !(t <= 2.4e+146)) {
tmp = y + x;
} else {
tmp = x + (z / ((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 ((t <= (-3.5d+64)) .or. (.not. (t <= 2.4d+146))) then
tmp = y + x
else
tmp = x + (z / ((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 ((t <= -3.5e+64) || !(t <= 2.4e+146)) {
tmp = y + x;
} else {
tmp = x + (z / ((a - t) / y));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (t <= -3.5e+64) or not (t <= 2.4e+146): tmp = y + x else: tmp = x + (z / ((a - t) / y)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((t <= -3.5e+64) || !(t <= 2.4e+146)) tmp = Float64(y + x); else tmp = Float64(x + Float64(z / Float64(Float64(a - t) / y))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((t <= -3.5e+64) || ~((t <= 2.4e+146))) tmp = y + x; else tmp = x + (z / ((a - t) / y)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[t, -3.5e+64], N[Not[LessEqual[t, 2.4e+146]], $MachinePrecision]], N[(y + x), $MachinePrecision], N[(x + N[(z / N[(N[(a - t), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -3.5 \cdot 10^{+64} \lor \neg \left(t \leq 2.4 \cdot 10^{+146}\right):\\
\;\;\;\;y + x\\
\mathbf{else}:\\
\;\;\;\;x + \frac{z}{\frac{a - t}{y}}\\
\end{array}
\end{array}
if t < -3.4999999999999999e64 or 2.4000000000000002e146 < t Initial program 73.3%
associate-*l/91.6%
Simplified91.6%
Taylor expanded in t around inf 87.1%
if -3.4999999999999999e64 < t < 2.4000000000000002e146Initial program 93.7%
associate-*l/94.9%
Simplified94.9%
Taylor expanded in z around inf 81.6%
associate-*l/84.4%
*-commutative84.4%
Simplified84.4%
clear-num84.3%
un-div-inv84.8%
Applied egg-rr84.8%
Final simplification85.6%
(FPCore (x y z t a) :precision binary64 (if (or (<= t -2.2e-25) (not (<= t 4.2e-93))) (- (+ y x) (/ y (/ t z))) (+ x (* y (/ (- z t) a)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -2.2e-25) || !(t <= 4.2e-93)) {
tmp = (y + x) - (y / (t / z));
} else {
tmp = x + (y * ((z - t) / a));
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if ((t <= (-2.2d-25)) .or. (.not. (t <= 4.2d-93))) then
tmp = (y + x) - (y / (t / z))
else
tmp = x + (y * ((z - t) / a))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -2.2e-25) || !(t <= 4.2e-93)) {
tmp = (y + x) - (y / (t / z));
} else {
tmp = x + (y * ((z - t) / a));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (t <= -2.2e-25) or not (t <= 4.2e-93): tmp = (y + x) - (y / (t / z)) else: tmp = x + (y * ((z - t) / a)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((t <= -2.2e-25) || !(t <= 4.2e-93)) tmp = Float64(Float64(y + x) - Float64(y / Float64(t / z))); else tmp = Float64(x + Float64(y * Float64(Float64(z - t) / a))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((t <= -2.2e-25) || ~((t <= 4.2e-93))) tmp = (y + x) - (y / (t / z)); else tmp = x + (y * ((z - t) / a)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[t, -2.2e-25], N[Not[LessEqual[t, 4.2e-93]], $MachinePrecision]], N[(N[(y + x), $MachinePrecision] - N[(y / N[(t / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(y * N[(N[(z - t), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -2.2 \cdot 10^{-25} \lor \neg \left(t \leq 4.2 \cdot 10^{-93}\right):\\
\;\;\;\;\left(y + x\right) - \frac{y}{\frac{t}{z}}\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot \frac{z - t}{a}\\
\end{array}
\end{array}
if t < -2.2000000000000002e-25 or 4.2000000000000002e-93 < t Initial program 80.4%
associate-*l/94.0%
Simplified94.0%
Taylor expanded in t around -inf 81.4%
+-commutative81.4%
mul-1-neg81.4%
unsub-neg81.4%
*-commutative81.4%
distribute-lft-out--81.4%
associate-/l*86.3%
Simplified86.3%
Taylor expanded in z around inf 89.5%
if -2.2000000000000002e-25 < t < 4.2000000000000002e-93Initial program 96.1%
+-commutative96.1%
associate-*r/98.0%
fma-def98.0%
Simplified98.0%
fma-udef98.0%
Applied egg-rr98.0%
Taylor expanded in a around inf 90.2%
Final simplification89.8%
(FPCore (x y z t a) :precision binary64 (if (<= t -4.7e+64) (+ y x) (if (<= t 3e+146) (+ x (* z (/ y (- a t)))) (+ y x))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -4.7e+64) {
tmp = y + x;
} else if (t <= 3e+146) {
tmp = x + (z * (y / (a - t)));
} else {
tmp = y + 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 (t <= (-4.7d+64)) then
tmp = y + x
else if (t <= 3d+146) then
tmp = x + (z * (y / (a - t)))
else
tmp = y + x
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.7e+64) {
tmp = y + x;
} else if (t <= 3e+146) {
tmp = x + (z * (y / (a - t)));
} else {
tmp = y + x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if t <= -4.7e+64: tmp = y + x elif t <= 3e+146: tmp = x + (z * (y / (a - t))) else: tmp = y + x return tmp
function code(x, y, z, t, a) tmp = 0.0 if (t <= -4.7e+64) tmp = Float64(y + x); elseif (t <= 3e+146) tmp = Float64(x + Float64(z * Float64(y / Float64(a - t)))); else tmp = Float64(y + x); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (t <= -4.7e+64) tmp = y + x; elseif (t <= 3e+146) tmp = x + (z * (y / (a - t))); else tmp = y + x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, -4.7e+64], N[(y + x), $MachinePrecision], If[LessEqual[t, 3e+146], N[(x + N[(z * N[(y / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(y + x), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -4.7 \cdot 10^{+64}:\\
\;\;\;\;y + x\\
\mathbf{elif}\;t \leq 3 \cdot 10^{+146}:\\
\;\;\;\;x + z \cdot \frac{y}{a - t}\\
\mathbf{else}:\\
\;\;\;\;y + x\\
\end{array}
\end{array}
if t < -4.70000000000000029e64 or 3.00000000000000002e146 < t Initial program 73.0%
associate-*l/92.3%
Simplified92.3%
Taylor expanded in t around inf 88.0%
if -4.70000000000000029e64 < t < 3.00000000000000002e146Initial program 93.7%
associate-*l/94.5%
Simplified94.5%
Taylor expanded in z around inf 81.8%
associate-*l/84.0%
*-commutative84.0%
Simplified84.0%
Final simplification85.4%
(FPCore (x y z t a) :precision binary64 (if (<= t 2.45e+190) (+ x (* (- z t) (/ y (- a t)))) (- (+ y x) (/ y (/ t z)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= 2.45e+190) {
tmp = x + ((z - t) * (y / (a - t)));
} else {
tmp = (y + x) - (y / (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 <= 2.45d+190) then
tmp = x + ((z - t) * (y / (a - t)))
else
tmp = (y + x) - (y / (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 <= 2.45e+190) {
tmp = x + ((z - t) * (y / (a - t)));
} else {
tmp = (y + x) - (y / (t / z));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if t <= 2.45e+190: tmp = x + ((z - t) * (y / (a - t))) else: tmp = (y + x) - (y / (t / z)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (t <= 2.45e+190) tmp = Float64(x + Float64(Float64(z - t) * Float64(y / Float64(a - t)))); else tmp = Float64(Float64(y + x) - Float64(y / Float64(t / z))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (t <= 2.45e+190) tmp = x + ((z - t) * (y / (a - t))); else tmp = (y + x) - (y / (t / z)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, 2.45e+190], N[(x + N[(N[(z - t), $MachinePrecision] * N[(y / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(y + x), $MachinePrecision] - N[(y / N[(t / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq 2.45 \cdot 10^{+190}:\\
\;\;\;\;x + \left(z - t\right) \cdot \frac{y}{a - t}\\
\mathbf{else}:\\
\;\;\;\;\left(y + x\right) - \frac{y}{\frac{t}{z}}\\
\end{array}
\end{array}
if t < 2.4499999999999998e190Initial program 89.4%
associate-*l/95.0%
Simplified95.0%
if 2.4499999999999998e190 < t Initial program 67.5%
associate-*l/85.2%
Simplified85.2%
Taylor expanded in t around -inf 91.1%
+-commutative91.1%
mul-1-neg91.1%
unsub-neg91.1%
*-commutative91.1%
distribute-lft-out--91.1%
associate-/l*100.0%
Simplified100.0%
Taylor expanded in z around inf 100.0%
Final simplification95.6%
(FPCore (x y z t a) :precision binary64 (if (or (<= t -4.8e-73) (not (<= t 3.8e-90))) (+ y x) (+ x (/ z (/ a y)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -4.8e-73) || !(t <= 3.8e-90)) {
tmp = y + x;
} 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 <= (-4.8d-73)) .or. (.not. (t <= 3.8d-90))) then
tmp = y + x
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 <= -4.8e-73) || !(t <= 3.8e-90)) {
tmp = y + x;
} else {
tmp = x + (z / (a / y));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (t <= -4.8e-73) or not (t <= 3.8e-90): tmp = y + x else: tmp = x + (z / (a / y)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((t <= -4.8e-73) || !(t <= 3.8e-90)) tmp = Float64(y + x); 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 <= -4.8e-73) || ~((t <= 3.8e-90))) tmp = y + x; else tmp = x + (z / (a / y)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[t, -4.8e-73], N[Not[LessEqual[t, 3.8e-90]], $MachinePrecision]], N[(y + x), $MachinePrecision], N[(x + N[(z / N[(a / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -4.8 \cdot 10^{-73} \lor \neg \left(t \leq 3.8 \cdot 10^{-90}\right):\\
\;\;\;\;y + x\\
\mathbf{else}:\\
\;\;\;\;x + \frac{z}{\frac{a}{y}}\\
\end{array}
\end{array}
if t < -4.80000000000000011e-73 or 3.8e-90 < t Initial program 81.1%
associate-*l/94.2%
Simplified94.2%
Taylor expanded in t around inf 77.7%
if -4.80000000000000011e-73 < t < 3.8e-90Initial program 95.9%
associate-*l/93.1%
Simplified93.1%
Taylor expanded in z around inf 89.4%
associate-*l/89.2%
*-commutative89.2%
Simplified89.2%
clear-num89.2%
un-div-inv90.0%
Applied egg-rr90.0%
Taylor expanded in a around inf 85.6%
Final simplification80.7%
(FPCore (x y z t a) :precision binary64 (if (<= t -2.4e-74) (+ y x) (if (<= t 2.8e-88) (+ x (* z (/ y a))) (+ y x))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -2.4e-74) {
tmp = y + x;
} else if (t <= 2.8e-88) {
tmp = x + (z * (y / a));
} else {
tmp = y + 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 (t <= (-2.4d-74)) then
tmp = y + x
else if (t <= 2.8d-88) then
tmp = x + (z * (y / a))
else
tmp = y + x
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -2.4e-74) {
tmp = y + x;
} else if (t <= 2.8e-88) {
tmp = x + (z * (y / a));
} else {
tmp = y + x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if t <= -2.4e-74: tmp = y + x elif t <= 2.8e-88: tmp = x + (z * (y / a)) else: tmp = y + x return tmp
function code(x, y, z, t, a) tmp = 0.0 if (t <= -2.4e-74) tmp = Float64(y + x); elseif (t <= 2.8e-88) tmp = Float64(x + Float64(z * Float64(y / a))); else tmp = Float64(y + x); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (t <= -2.4e-74) tmp = y + x; elseif (t <= 2.8e-88) tmp = x + (z * (y / a)); else tmp = y + x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, -2.4e-74], N[(y + x), $MachinePrecision], If[LessEqual[t, 2.8e-88], N[(x + N[(z * N[(y / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(y + x), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -2.4 \cdot 10^{-74}:\\
\;\;\;\;y + x\\
\mathbf{elif}\;t \leq 2.8 \cdot 10^{-88}:\\
\;\;\;\;x + z \cdot \frac{y}{a}\\
\mathbf{else}:\\
\;\;\;\;y + x\\
\end{array}
\end{array}
if t < -2.3999999999999999e-74 or 2.79999999999999976e-88 < t Initial program 81.1%
associate-*l/94.2%
Simplified94.2%
Taylor expanded in t around inf 77.7%
if -2.3999999999999999e-74 < t < 2.79999999999999976e-88Initial program 95.9%
associate-*l/93.1%
Simplified93.1%
Taylor expanded in z around inf 89.4%
associate-*l/89.2%
*-commutative89.2%
Simplified89.2%
Taylor expanded in a around inf 85.0%
Final simplification80.4%
(FPCore (x y z t a) :precision binary64 (if (<= t -4.9e-73) (+ y x) (if (<= t 1.35e-90) (+ x (* y (/ z a))) (+ y x))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -4.9e-73) {
tmp = y + x;
} else if (t <= 1.35e-90) {
tmp = x + (y * (z / a));
} else {
tmp = y + 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 (t <= (-4.9d-73)) then
tmp = y + x
else if (t <= 1.35d-90) then
tmp = x + (y * (z / a))
else
tmp = y + x
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.9e-73) {
tmp = y + x;
} else if (t <= 1.35e-90) {
tmp = x + (y * (z / a));
} else {
tmp = y + x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if t <= -4.9e-73: tmp = y + x elif t <= 1.35e-90: tmp = x + (y * (z / a)) else: tmp = y + x return tmp
function code(x, y, z, t, a) tmp = 0.0 if (t <= -4.9e-73) tmp = Float64(y + x); elseif (t <= 1.35e-90) tmp = Float64(x + Float64(y * Float64(z / a))); else tmp = Float64(y + x); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (t <= -4.9e-73) tmp = y + x; elseif (t <= 1.35e-90) tmp = x + (y * (z / a)); else tmp = y + x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, -4.9e-73], N[(y + x), $MachinePrecision], If[LessEqual[t, 1.35e-90], N[(x + N[(y * N[(z / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(y + x), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -4.9 \cdot 10^{-73}:\\
\;\;\;\;y + x\\
\mathbf{elif}\;t \leq 1.35 \cdot 10^{-90}:\\
\;\;\;\;x + y \cdot \frac{z}{a}\\
\mathbf{else}:\\
\;\;\;\;y + x\\
\end{array}
\end{array}
if t < -4.90000000000000028e-73 or 1.34999999999999998e-90 < t Initial program 81.1%
associate-*l/94.2%
Simplified94.2%
Taylor expanded in t around inf 77.7%
if -4.90000000000000028e-73 < t < 1.34999999999999998e-90Initial program 95.9%
+-commutative95.9%
associate-*r/97.9%
fma-def97.9%
Simplified97.9%
fma-udef97.9%
Applied egg-rr97.9%
Taylor expanded in t around 0 85.8%
Final simplification80.8%
(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 86.7%
associate-/l*99.1%
Simplified99.1%
Final simplification99.1%
(FPCore (x y z t a) :precision binary64 (if (<= t -1.15e-75) (+ y x) (if (<= t 1e-88) x (+ y x))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -1.15e-75) {
tmp = y + x;
} else if (t <= 1e-88) {
tmp = x;
} else {
tmp = y + 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 (t <= (-1.15d-75)) then
tmp = y + x
else if (t <= 1d-88) then
tmp = x
else
tmp = y + x
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.15e-75) {
tmp = y + x;
} else if (t <= 1e-88) {
tmp = x;
} else {
tmp = y + x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if t <= -1.15e-75: tmp = y + x elif t <= 1e-88: tmp = x else: tmp = y + x return tmp
function code(x, y, z, t, a) tmp = 0.0 if (t <= -1.15e-75) tmp = Float64(y + x); elseif (t <= 1e-88) tmp = x; else tmp = Float64(y + x); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (t <= -1.15e-75) tmp = y + x; elseif (t <= 1e-88) tmp = x; else tmp = y + x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, -1.15e-75], N[(y + x), $MachinePrecision], If[LessEqual[t, 1e-88], x, N[(y + x), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.15 \cdot 10^{-75}:\\
\;\;\;\;y + x\\
\mathbf{elif}\;t \leq 10^{-88}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;y + x\\
\end{array}
\end{array}
if t < -1.15e-75 or 9.99999999999999934e-89 < t Initial program 81.1%
associate-*l/94.2%
Simplified94.2%
Taylor expanded in t around inf 77.7%
if -1.15e-75 < t < 9.99999999999999934e-89Initial program 95.9%
associate-*l/93.1%
Simplified93.1%
Taylor expanded in x around inf 53.7%
Final simplification68.7%
(FPCore (x y z t a) :precision binary64 x)
double code(double x, double y, double z, double t, double a) {
return x;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
code = x
end function
public static double code(double x, double y, double z, double t, double a) {
return x;
}
def code(x, y, z, t, a): return x
function code(x, y, z, t, a) return x end
function tmp = code(x, y, z, t, a) tmp = x; end
code[x_, y_, z_, t_, a_] := x
\begin{array}{l}
\\
x
\end{array}
Initial program 86.7%
associate-*l/93.8%
Simplified93.8%
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 2023196
(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))))