
(FPCore (x y z t a) :precision binary64 (- (+ x y) (/ (* (- z t) y) (- a t))))
double code(double x, double y, double z, double t, double a) {
return (x + y) - (((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 + y) - (((z - t) * y) / (a - t))
end function
public static double code(double x, double y, double z, double t, double a) {
return (x + y) - (((z - t) * y) / (a - t));
}
def code(x, y, z, t, a): return (x + y) - (((z - t) * y) / (a - t))
function code(x, y, z, t, a) return Float64(Float64(x + y) - Float64(Float64(Float64(z - t) * y) / Float64(a - t))) end
function tmp = code(x, y, z, t, a) tmp = (x + y) - (((z - t) * y) / (a - t)); end
code[x_, y_, z_, t_, a_] := N[(N[(x + y), $MachinePrecision] - N[(N[(N[(z - t), $MachinePrecision] * y), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(x + y\right) - \frac{\left(z - t\right) \cdot y}{a - t}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 7 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t a) :precision binary64 (- (+ x y) (/ (* (- z t) y) (- a t))))
double code(double x, double y, double z, double t, double a) {
return (x + y) - (((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 + y) - (((z - t) * y) / (a - t))
end function
public static double code(double x, double y, double z, double t, double a) {
return (x + y) - (((z - t) * y) / (a - t));
}
def code(x, y, z, t, a): return (x + y) - (((z - t) * y) / (a - t))
function code(x, y, z, t, a) return Float64(Float64(x + y) - Float64(Float64(Float64(z - t) * y) / Float64(a - t))) end
function tmp = code(x, y, z, t, a) tmp = (x + y) - (((z - t) * y) / (a - t)); end
code[x_, y_, z_, t_, a_] := N[(N[(x + y), $MachinePrecision] - N[(N[(N[(z - t), $MachinePrecision] * y), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(x + y\right) - \frac{\left(z - t\right) \cdot y}{a - t}
\end{array}
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (fma (- y) (/ (- a z) t) x)))
(if (<= t -7.9e+102)
t_1
(if (<= t 2.65e-12) (- (+ x y) (* (/ z (- a t)) y)) t_1))))
double code(double x, double y, double z, double t, double a) {
double t_1 = fma(-y, ((a - z) / t), x);
double tmp;
if (t <= -7.9e+102) {
tmp = t_1;
} else if (t <= 2.65e-12) {
tmp = (x + y) - ((z / (a - t)) * y);
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a) t_1 = fma(Float64(-y), Float64(Float64(a - z) / t), x) tmp = 0.0 if (t <= -7.9e+102) tmp = t_1; elseif (t <= 2.65e-12) tmp = Float64(Float64(x + y) - Float64(Float64(z / Float64(a - t)) * y)); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[((-y) * N[(N[(a - z), $MachinePrecision] / t), $MachinePrecision] + x), $MachinePrecision]}, If[LessEqual[t, -7.9e+102], t$95$1, If[LessEqual[t, 2.65e-12], N[(N[(x + y), $MachinePrecision] - N[(N[(z / N[(a - t), $MachinePrecision]), $MachinePrecision] * y), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(-y, \frac{a - z}{t}, x\right)\\
\mathbf{if}\;t \leq -7.9 \cdot 10^{+102}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 2.65 \cdot 10^{-12}:\\
\;\;\;\;\left(x + y\right) - \frac{z}{a - t} \cdot y\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t < -7.9000000000000003e102 or 2.64999999999999982e-12 < t Initial program 54.8%
lift-*.f64N/A
lift--.f64N/A
flip--N/A
associate-*l/N/A
lower-/.f64N/A
lower-*.f64N/A
difference-of-squaresN/A
lift--.f64N/A
lower-*.f64N/A
+-commutativeN/A
lower-+.f64N/A
+-commutativeN/A
lower-+.f6422.0
Applied rewrites22.0%
Taylor expanded in z around inf
associate-*l/N/A
associate-*l*N/A
*-commutativeN/A
associate-*l*N/A
lower-*.f64N/A
lower-/.f64N/A
lower--.f64N/A
mul-1-negN/A
lower-neg.f6424.8
Applied rewrites24.8%
Taylor expanded in t around inf
associate--l+N/A
distribute-lft-out--N/A
div-subN/A
*-commutativeN/A
distribute-rgt-out--N/A
+-commutativeN/A
associate-/l*N/A
associate-*r*N/A
lower-fma.f64N/A
mul-1-negN/A
lower-neg.f64N/A
lower-/.f64N/A
lower--.f6487.1
Applied rewrites87.1%
if -7.9000000000000003e102 < t < 2.64999999999999982e-12Initial program 92.4%
Taylor expanded in z around inf
associate-/l*N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f64N/A
lower--.f6494.3
Applied rewrites94.3%
(FPCore (x y z t a) :precision binary64 (if (<= a -4.9e-61) (+ x y) (if (<= a 7e-305) x (if (<= a 1.35e-124) (* (/ y t) z) (+ x y)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= -4.9e-61) {
tmp = x + y;
} else if (a <= 7e-305) {
tmp = x;
} else if (a <= 1.35e-124) {
tmp = (y / t) * 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 (a <= (-4.9d-61)) then
tmp = x + y
else if (a <= 7d-305) then
tmp = x
else if (a <= 1.35d-124) then
tmp = (y / t) * 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 (a <= -4.9e-61) {
tmp = x + y;
} else if (a <= 7e-305) {
tmp = x;
} else if (a <= 1.35e-124) {
tmp = (y / t) * z;
} else {
tmp = x + y;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if a <= -4.9e-61: tmp = x + y elif a <= 7e-305: tmp = x elif a <= 1.35e-124: tmp = (y / t) * z else: tmp = x + y return tmp
function code(x, y, z, t, a) tmp = 0.0 if (a <= -4.9e-61) tmp = Float64(x + y); elseif (a <= 7e-305) tmp = x; elseif (a <= 1.35e-124) tmp = Float64(Float64(y / t) * z); else tmp = Float64(x + y); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (a <= -4.9e-61) tmp = x + y; elseif (a <= 7e-305) tmp = x; elseif (a <= 1.35e-124) tmp = (y / t) * z; else tmp = x + y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[a, -4.9e-61], N[(x + y), $MachinePrecision], If[LessEqual[a, 7e-305], x, If[LessEqual[a, 1.35e-124], N[(N[(y / t), $MachinePrecision] * z), $MachinePrecision], N[(x + y), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -4.9 \cdot 10^{-61}:\\
\;\;\;\;x + y\\
\mathbf{elif}\;a \leq 7 \cdot 10^{-305}:\\
\;\;\;\;x\\
\mathbf{elif}\;a \leq 1.35 \cdot 10^{-124}:\\
\;\;\;\;\frac{y}{t} \cdot z\\
\mathbf{else}:\\
\;\;\;\;x + y\\
\end{array}
\end{array}
if a < -4.90000000000000002e-61 or 1.35000000000000009e-124 < a Initial program 78.0%
Taylor expanded in a around inf
+-commutativeN/A
lower-+.f6474.1
Applied rewrites74.1%
if -4.90000000000000002e-61 < a < 6.9999999999999996e-305Initial program 79.2%
lift-*.f64N/A
lift--.f64N/A
flip--N/A
associate-*l/N/A
lower-/.f64N/A
lower-*.f64N/A
difference-of-squaresN/A
lift--.f64N/A
lower-*.f64N/A
+-commutativeN/A
lower-+.f64N/A
+-commutativeN/A
lower-+.f6455.3
Applied rewrites55.3%
Taylor expanded in z around 0
cancel-sign-sub-invN/A
metadata-evalN/A
*-lft-identityN/A
+-commutativeN/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
lower--.f64N/A
+-commutativeN/A
lower-+.f6452.2
Applied rewrites52.2%
Taylor expanded in a around 0
Applied rewrites60.0%
Applied rewrites60.0%
if 6.9999999999999996e-305 < a < 1.35000000000000009e-124Initial program 63.2%
lift-*.f64N/A
lift--.f64N/A
flip--N/A
associate-*l/N/A
lower-/.f64N/A
lower-*.f64N/A
difference-of-squaresN/A
lift--.f64N/A
lower-*.f64N/A
+-commutativeN/A
lower-+.f64N/A
+-commutativeN/A
lower-+.f6447.4
Applied rewrites47.4%
Taylor expanded in z around inf
associate-*l/N/A
associate-*l*N/A
*-commutativeN/A
associate-*l*N/A
lower-*.f64N/A
lower-/.f64N/A
lower--.f64N/A
mul-1-negN/A
lower-neg.f6459.8
Applied rewrites59.8%
Applied rewrites58.4%
Taylor expanded in a around 0
Applied rewrites54.6%
Final simplification67.9%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (fma y (- 1.0 (/ z a)) x)))
(if (<= a -5.1e+64)
t_1
(if (<= a 2.2e-54) (fma (- y) (/ (- a z) t) x) t_1))))
double code(double x, double y, double z, double t, double a) {
double t_1 = fma(y, (1.0 - (z / a)), x);
double tmp;
if (a <= -5.1e+64) {
tmp = t_1;
} else if (a <= 2.2e-54) {
tmp = fma(-y, ((a - z) / t), x);
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a) t_1 = fma(y, Float64(1.0 - Float64(z / a)), x) tmp = 0.0 if (a <= -5.1e+64) tmp = t_1; elseif (a <= 2.2e-54) tmp = fma(Float64(-y), Float64(Float64(a - z) / t), x); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(y * N[(1.0 - N[(z / a), $MachinePrecision]), $MachinePrecision] + x), $MachinePrecision]}, If[LessEqual[a, -5.1e+64], t$95$1, If[LessEqual[a, 2.2e-54], N[((-y) * N[(N[(a - z), $MachinePrecision] / t), $MachinePrecision] + x), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(y, 1 - \frac{z}{a}, x\right)\\
\mathbf{if}\;a \leq -5.1 \cdot 10^{+64}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;a \leq 2.2 \cdot 10^{-54}:\\
\;\;\;\;\mathsf{fma}\left(-y, \frac{a - z}{t}, x\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if a < -5.10000000000000024e64 or 2.2e-54 < a Initial program 78.6%
Taylor expanded in t around 0
associate--l+N/A
+-commutativeN/A
*-rgt-identityN/A
associate-/l*N/A
distribute-lft-out--N/A
lower-fma.f64N/A
lower--.f64N/A
lower-/.f6490.1
Applied rewrites90.1%
if -5.10000000000000024e64 < a < 2.2e-54Initial program 74.0%
lift-*.f64N/A
lift--.f64N/A
flip--N/A
associate-*l/N/A
lower-/.f64N/A
lower-*.f64N/A
difference-of-squaresN/A
lift--.f64N/A
lower-*.f64N/A
+-commutativeN/A
lower-+.f64N/A
+-commutativeN/A
lower-+.f6450.9
Applied rewrites50.9%
Taylor expanded in z around inf
associate-*l/N/A
associate-*l*N/A
*-commutativeN/A
associate-*l*N/A
lower-*.f64N/A
lower-/.f64N/A
lower--.f64N/A
mul-1-negN/A
lower-neg.f6443.1
Applied rewrites43.1%
Taylor expanded in t around inf
associate--l+N/A
distribute-lft-out--N/A
div-subN/A
*-commutativeN/A
distribute-rgt-out--N/A
+-commutativeN/A
associate-/l*N/A
associate-*r*N/A
lower-fma.f64N/A
mul-1-negN/A
lower-neg.f64N/A
lower-/.f64N/A
lower--.f6486.9
Applied rewrites86.9%
(FPCore (x y z t a) :precision binary64 (let* ((t_1 (fma y (- 1.0 (/ z a)) x))) (if (<= a -5.1e+64) t_1 (if (<= a 8.2e-32) (fma y (/ z t) x) t_1))))
double code(double x, double y, double z, double t, double a) {
double t_1 = fma(y, (1.0 - (z / a)), x);
double tmp;
if (a <= -5.1e+64) {
tmp = t_1;
} else if (a <= 8.2e-32) {
tmp = fma(y, (z / t), x);
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a) t_1 = fma(y, Float64(1.0 - Float64(z / a)), x) tmp = 0.0 if (a <= -5.1e+64) tmp = t_1; elseif (a <= 8.2e-32) tmp = fma(y, Float64(z / t), x); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(y * N[(1.0 - N[(z / a), $MachinePrecision]), $MachinePrecision] + x), $MachinePrecision]}, If[LessEqual[a, -5.1e+64], t$95$1, If[LessEqual[a, 8.2e-32], N[(y * N[(z / t), $MachinePrecision] + x), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(y, 1 - \frac{z}{a}, x\right)\\
\mathbf{if}\;a \leq -5.1 \cdot 10^{+64}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;a \leq 8.2 \cdot 10^{-32}:\\
\;\;\;\;\mathsf{fma}\left(y, \frac{z}{t}, x\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if a < -5.10000000000000024e64 or 8.1999999999999995e-32 < a Initial program 78.0%
Taylor expanded in t around 0
associate--l+N/A
+-commutativeN/A
*-rgt-identityN/A
associate-/l*N/A
distribute-lft-out--N/A
lower-fma.f64N/A
lower--.f64N/A
lower-/.f6490.7
Applied rewrites90.7%
if -5.10000000000000024e64 < a < 8.1999999999999995e-32Initial program 74.6%
Taylor expanded in t around inf
Applied rewrites80.3%
Taylor expanded in a around 0
Applied rewrites79.7%
Applied rewrites85.7%
(FPCore (x y z t a) :precision binary64 (if (<= a -6.5e+65) (+ x y) (if (<= a 5.5e-30) (fma y (/ z t) x) (+ x y))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= -6.5e+65) {
tmp = x + y;
} else if (a <= 5.5e-30) {
tmp = fma(y, (z / t), x);
} else {
tmp = x + y;
}
return tmp;
}
function code(x, y, z, t, a) tmp = 0.0 if (a <= -6.5e+65) tmp = Float64(x + y); elseif (a <= 5.5e-30) tmp = fma(y, Float64(z / t), x); else tmp = Float64(x + y); end return tmp end
code[x_, y_, z_, t_, a_] := If[LessEqual[a, -6.5e+65], N[(x + y), $MachinePrecision], If[LessEqual[a, 5.5e-30], N[(y * N[(z / t), $MachinePrecision] + x), $MachinePrecision], N[(x + y), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -6.5 \cdot 10^{+65}:\\
\;\;\;\;x + y\\
\mathbf{elif}\;a \leq 5.5 \cdot 10^{-30}:\\
\;\;\;\;\mathsf{fma}\left(y, \frac{z}{t}, x\right)\\
\mathbf{else}:\\
\;\;\;\;x + y\\
\end{array}
\end{array}
if a < -6.5000000000000003e65 or 5.49999999999999976e-30 < a Initial program 78.0%
Taylor expanded in a around inf
+-commutativeN/A
lower-+.f6483.2
Applied rewrites83.2%
if -6.5000000000000003e65 < a < 5.49999999999999976e-30Initial program 74.6%
Taylor expanded in t around inf
Applied rewrites80.3%
Taylor expanded in a around 0
Applied rewrites79.7%
Applied rewrites85.7%
Final simplification84.6%
(FPCore (x y z t a) :precision binary64 (if (<= a -4.9e-61) (+ x y) (if (<= a 6e-63) x (+ x y))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= -4.9e-61) {
tmp = x + y;
} else if (a <= 6e-63) {
tmp = x;
} else {
tmp = x + y;
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (a <= (-4.9d-61)) then
tmp = x + y
else if (a <= 6d-63) then
tmp = x
else
tmp = x + y
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= -4.9e-61) {
tmp = x + y;
} else if (a <= 6e-63) {
tmp = x;
} else {
tmp = x + y;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if a <= -4.9e-61: tmp = x + y elif a <= 6e-63: tmp = x else: tmp = x + y return tmp
function code(x, y, z, t, a) tmp = 0.0 if (a <= -4.9e-61) tmp = Float64(x + y); elseif (a <= 6e-63) tmp = x; else tmp = Float64(x + y); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (a <= -4.9e-61) tmp = x + y; elseif (a <= 6e-63) tmp = x; else tmp = x + y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[a, -4.9e-61], N[(x + y), $MachinePrecision], If[LessEqual[a, 6e-63], x, N[(x + y), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -4.9 \cdot 10^{-61}:\\
\;\;\;\;x + y\\
\mathbf{elif}\;a \leq 6 \cdot 10^{-63}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;x + y\\
\end{array}
\end{array}
if a < -4.90000000000000002e-61 or 5.99999999999999959e-63 < a Initial program 78.5%
Taylor expanded in a around inf
+-commutativeN/A
lower-+.f6478.1
Applied rewrites78.1%
if -4.90000000000000002e-61 < a < 5.99999999999999959e-63Initial program 73.4%
lift-*.f64N/A
lift--.f64N/A
flip--N/A
associate-*l/N/A
lower-/.f64N/A
lower-*.f64N/A
difference-of-squaresN/A
lift--.f64N/A
lower-*.f64N/A
+-commutativeN/A
lower-+.f64N/A
+-commutativeN/A
lower-+.f6451.6
Applied rewrites51.6%
Taylor expanded in z around 0
cancel-sign-sub-invN/A
metadata-evalN/A
*-lft-identityN/A
+-commutativeN/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
lower--.f64N/A
+-commutativeN/A
lower-+.f6443.1
Applied rewrites43.1%
Taylor expanded in a around 0
Applied rewrites51.7%
Applied rewrites51.7%
Final simplification66.0%
(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 76.1%
lift-*.f64N/A
lift--.f64N/A
flip--N/A
associate-*l/N/A
lower-/.f64N/A
lower-*.f64N/A
difference-of-squaresN/A
lift--.f64N/A
lower-*.f64N/A
+-commutativeN/A
lower-+.f64N/A
+-commutativeN/A
lower-+.f6452.2
Applied rewrites52.2%
Taylor expanded in z around 0
cancel-sign-sub-invN/A
metadata-evalN/A
*-lft-identityN/A
+-commutativeN/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
lower--.f64N/A
+-commutativeN/A
lower-+.f6462.3
Applied rewrites62.3%
Taylor expanded in a around 0
Applied rewrites52.0%
Applied rewrites52.0%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (- (+ y x) (* (* (- z t) (/ 1.0 (- a t))) y)))
(t_2 (- (+ x y) (/ (* (- z t) y) (- a t)))))
(if (< t_2 -1.3664970889390727e-7)
t_1
(if (< t_2 1.4754293444577233e-239)
(/ (- (* y (- a z)) (* x t)) (- a t))
t_1))))
double code(double x, double y, double z, double t, double a) {
double t_1 = (y + x) - (((z - t) * (1.0 / (a - t))) * y);
double t_2 = (x + y) - (((z - t) * y) / (a - t));
double tmp;
if (t_2 < -1.3664970889390727e-7) {
tmp = t_1;
} else if (t_2 < 1.4754293444577233e-239) {
tmp = ((y * (a - z)) - (x * t)) / (a - t);
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = (y + x) - (((z - t) * (1.0d0 / (a - t))) * y)
t_2 = (x + y) - (((z - t) * y) / (a - t))
if (t_2 < (-1.3664970889390727d-7)) then
tmp = t_1
else if (t_2 < 1.4754293444577233d-239) then
tmp = ((y * (a - z)) - (x * t)) / (a - t)
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double t_1 = (y + x) - (((z - t) * (1.0 / (a - t))) * y);
double t_2 = (x + y) - (((z - t) * y) / (a - t));
double tmp;
if (t_2 < -1.3664970889390727e-7) {
tmp = t_1;
} else if (t_2 < 1.4754293444577233e-239) {
tmp = ((y * (a - z)) - (x * t)) / (a - t);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = (y + x) - (((z - t) * (1.0 / (a - t))) * y) t_2 = (x + y) - (((z - t) * y) / (a - t)) tmp = 0 if t_2 < -1.3664970889390727e-7: tmp = t_1 elif t_2 < 1.4754293444577233e-239: tmp = ((y * (a - z)) - (x * t)) / (a - t) else: tmp = t_1 return tmp
function code(x, y, z, t, a) t_1 = Float64(Float64(y + x) - Float64(Float64(Float64(z - t) * Float64(1.0 / Float64(a - t))) * y)) t_2 = Float64(Float64(x + y) - Float64(Float64(Float64(z - t) * y) / Float64(a - t))) tmp = 0.0 if (t_2 < -1.3664970889390727e-7) tmp = t_1; elseif (t_2 < 1.4754293444577233e-239) tmp = Float64(Float64(Float64(y * Float64(a - z)) - Float64(x * t)) / Float64(a - t)); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = (y + x) - (((z - t) * (1.0 / (a - t))) * y); t_2 = (x + y) - (((z - t) * y) / (a - t)); tmp = 0.0; if (t_2 < -1.3664970889390727e-7) tmp = t_1; elseif (t_2 < 1.4754293444577233e-239) tmp = ((y * (a - z)) - (x * t)) / (a - t); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(y + x), $MachinePrecision] - N[(N[(N[(z - t), $MachinePrecision] * N[(1.0 / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * y), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(x + y), $MachinePrecision] - N[(N[(N[(z - t), $MachinePrecision] * y), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[Less[t$95$2, -1.3664970889390727e-7], t$95$1, If[Less[t$95$2, 1.4754293444577233e-239], N[(N[(N[(y * N[(a - z), $MachinePrecision]), $MachinePrecision] - N[(x * t), $MachinePrecision]), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(y + x\right) - \left(\left(z - t\right) \cdot \frac{1}{a - t}\right) \cdot y\\
t_2 := \left(x + y\right) - \frac{\left(z - t\right) \cdot y}{a - t}\\
\mathbf{if}\;t\_2 < -1.3664970889390727 \cdot 10^{-7}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t\_2 < 1.4754293444577233 \cdot 10^{-239}:\\
\;\;\;\;\frac{y \cdot \left(a - z\right) - x \cdot t}{a - t}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
herbie shell --seed 2024277
(FPCore (x y z t a)
:name "Graphics.Rendering.Plot.Render.Plot.Axis:renderAxisTick from plot-0.2.3.4, B"
:precision binary64
:alt
(! :herbie-platform default (if (< (- (+ x y) (/ (* (- z t) y) (- a t))) -13664970889390727/100000000000000000000000) (- (+ y x) (* (* (- z t) (/ 1 (- a t))) y)) (if (< (- (+ x y) (/ (* (- z t) y) (- a t))) 14754293444577233/1000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000) (/ (- (* y (- a z)) (* x t)) (- a t)) (- (+ y x) (* (* (- z t) (/ 1 (- a t))) y)))))
(- (+ x y) (/ (* (- z t) y) (- a t))))